1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package javax.faces.component.html;
20
21 import javax.faces.el.ValueBinding;
22 import javax.el.ValueExpression;
23 import javax.faces.context.FacesContext;
24 import javax.faces.component.UIComponent;
25 import javax.faces.convert.Converter;
26 import javax.faces.el.MethodBinding;
27
28
29
30
31
32
33 public class HtmlInputText extends javax.faces.component.UIInput
34 implements javax.faces.component.behavior.ClientBehaviorHolder
35 {
36
37 static public final String COMPONENT_FAMILY =
38 "javax.faces.Input";
39 static public final String COMPONENT_TYPE =
40 "javax.faces.HtmlInputText";
41
42
43 public HtmlInputText()
44 {
45 setRendererType("javax.faces.Text");
46 }
47
48 @Override
49 public String getFamily()
50 {
51 return COMPONENT_FAMILY;
52 }
53
54
55 static private final java.util.Collection<String> CLIENT_EVENTS_LIST =
56 java.util.Collections.unmodifiableCollection(
57 java.util.Arrays.asList(
58 "blur"
59 , "focus"
60 , "click"
61 , "dblclick"
62 , "keydown"
63 , "keypress"
64 , "keyup"
65 , "mousedown"
66 , "mousemove"
67 , "mouseout"
68 , "mouseover"
69 , "mouseup"
70 , "change"
71 , "select"
72 , "valueChange"
73 ));
74
75 public java.util.Collection<String> getEventNames()
76 {
77 return CLIENT_EVENTS_LIST;
78 }
79
80 @Override
81 public void addClientBehavior(String eventName, javax.faces.component.behavior.ClientBehavior behavior)
82 {
83 super.addClientBehavior(eventName, behavior);
84 _CommonEventConstants.markEvent(this, eventName);
85 }
86
87
88 public String getDefaultEventName()
89 {
90 return "valueChange";
91 }
92
93
94
95
96 public int getMaxlength()
97 {
98 return (Integer) getStateHelper().eval(PropertyKeys.maxlength, Integer.MIN_VALUE);
99 }
100
101 public void setMaxlength(int maxlength)
102 {
103 getStateHelper().put(PropertyKeys.maxlength, maxlength );
104 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.MAXLENGTH_PROP);
105 }
106
107
108 public int getSize()
109 {
110 return (Integer) getStateHelper().eval(PropertyKeys.size, Integer.MIN_VALUE);
111 }
112
113 public void setSize(int size)
114 {
115 getStateHelper().put(PropertyKeys.size, size );
116 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.SIZE_PROP);
117 }
118
119
120 public String getAutocomplete()
121 {
122 return (String) getStateHelper().eval(PropertyKeys.autocomplete);
123 }
124
125 public void setAutocomplete(String autocomplete)
126 {
127 getStateHelper().put(PropertyKeys.autocomplete, autocomplete );
128 }
129
130
131 public String getLabel()
132 {
133 return (String) getStateHelper().eval(PropertyKeys.label);
134 }
135
136 public void setLabel(String label)
137 {
138 getStateHelper().put(PropertyKeys.label, label );
139 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.LABEL_PROP);
140 }
141
142
143 public String getStyle()
144 {
145 return (String) getStateHelper().eval(PropertyKeys.style);
146 }
147
148 public void setStyle(String style)
149 {
150 getStateHelper().put(PropertyKeys.style, style );
151 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.STYLE_PROP);
152 }
153
154
155 public String getStyleClass()
156 {
157 return (String) getStateHelper().eval(PropertyKeys.styleClass);
158 }
159
160 public void setStyleClass(String styleClass)
161 {
162 getStateHelper().put(PropertyKeys.styleClass, styleClass );
163 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.STYLECLASS_PROP);
164 }
165
166
167 public String getAlt()
168 {
169 return (String) getStateHelper().eval(PropertyKeys.alt);
170 }
171
172 public void setAlt(String alt)
173 {
174 getStateHelper().put(PropertyKeys.alt, alt );
175 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.ALT_PROP);
176 }
177
178
179 public String getTabindex()
180 {
181 return (String) getStateHelper().eval(PropertyKeys.tabindex);
182 }
183
184 public void setTabindex(String tabindex)
185 {
186 getStateHelper().put(PropertyKeys.tabindex, tabindex );
187 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.TABINDEX_PROP);
188 }
189
190
191 public String getOnblur()
192 {
193 return (String) getStateHelper().eval(PropertyKeys.onblur);
194 }
195
196 public void setOnblur(String onblur)
197 {
198 getStateHelper().put(PropertyKeys.onblur, onblur );
199 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.ONBLUR_PROP);
200 }
201
202
203 public String getOnfocus()
204 {
205 return (String) getStateHelper().eval(PropertyKeys.onfocus);
206 }
207
208 public void setOnfocus(String onfocus)
209 {
210 getStateHelper().put(PropertyKeys.onfocus, onfocus );
211 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.ONFOCUS_PROP);
212 }
213
214
215 public String getAccesskey()
216 {
217 return (String) getStateHelper().eval(PropertyKeys.accesskey);
218 }
219
220 public void setAccesskey(String accesskey)
221 {
222 getStateHelper().put(PropertyKeys.accesskey, accesskey );
223 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.ACCESSKEY_PROP);
224 }
225
226
227 public String getRole()
228 {
229 return (String) getStateHelper().eval(PropertyKeys.role);
230 }
231
232 public void setRole(String role)
233 {
234 getStateHelper().put(PropertyKeys.role, role );
235 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.ROLE_PROP);
236 }
237
238
239 public String getOnclick()
240 {
241 return (String) getStateHelper().eval(PropertyKeys.onclick);
242 }
243
244 public void setOnclick(String onclick)
245 {
246 getStateHelper().put(PropertyKeys.onclick, onclick );
247 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.ONCLICK_PROP);
248 }
249
250
251 public String getOndblclick()
252 {
253 return (String) getStateHelper().eval(PropertyKeys.ondblclick);
254 }
255
256 public void setOndblclick(String ondblclick)
257 {
258 getStateHelper().put(PropertyKeys.ondblclick, ondblclick );
259 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.ONDBLCLICK_PROP);
260 }
261
262
263 public String getOnkeydown()
264 {
265 return (String) getStateHelper().eval(PropertyKeys.onkeydown);
266 }
267
268 public void setOnkeydown(String onkeydown)
269 {
270 getStateHelper().put(PropertyKeys.onkeydown, onkeydown );
271 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.ONKEYDOWN_PROP);
272 }
273
274
275 public String getOnkeypress()
276 {
277 return (String) getStateHelper().eval(PropertyKeys.onkeypress);
278 }
279
280 public void setOnkeypress(String onkeypress)
281 {
282 getStateHelper().put(PropertyKeys.onkeypress, onkeypress );
283 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.ONKEYPRESS_PROP);
284 }
285
286
287 public String getOnkeyup()
288 {
289 return (String) getStateHelper().eval(PropertyKeys.onkeyup);
290 }
291
292 public void setOnkeyup(String onkeyup)
293 {
294 getStateHelper().put(PropertyKeys.onkeyup, onkeyup );
295 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.ONKEYUP_PROP);
296 }
297
298
299 public String getOnmousedown()
300 {
301 return (String) getStateHelper().eval(PropertyKeys.onmousedown);
302 }
303
304 public void setOnmousedown(String onmousedown)
305 {
306 getStateHelper().put(PropertyKeys.onmousedown, onmousedown );
307 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.ONMOUSEDOWN_PROP);
308 }
309
310
311 public String getOnmousemove()
312 {
313 return (String) getStateHelper().eval(PropertyKeys.onmousemove);
314 }
315
316 public void setOnmousemove(String onmousemove)
317 {
318 getStateHelper().put(PropertyKeys.onmousemove, onmousemove );
319 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.ONMOUSEMOVE_PROP);
320 }
321
322
323 public String getOnmouseout()
324 {
325 return (String) getStateHelper().eval(PropertyKeys.onmouseout);
326 }
327
328 public void setOnmouseout(String onmouseout)
329 {
330 getStateHelper().put(PropertyKeys.onmouseout, onmouseout );
331 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.ONMOUSEOUT_PROP);
332 }
333
334
335 public String getOnmouseover()
336 {
337 return (String) getStateHelper().eval(PropertyKeys.onmouseover);
338 }
339
340 public void setOnmouseover(String onmouseover)
341 {
342 getStateHelper().put(PropertyKeys.onmouseover, onmouseover );
343 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.ONMOUSEOVER_PROP);
344 }
345
346
347 public String getOnmouseup()
348 {
349 return (String) getStateHelper().eval(PropertyKeys.onmouseup);
350 }
351
352 public void setOnmouseup(String onmouseup)
353 {
354 getStateHelper().put(PropertyKeys.onmouseup, onmouseup );
355 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.ONMOUSEUP_PROP);
356 }
357
358
359 public String getOnchange()
360 {
361 return (String) getStateHelper().eval(PropertyKeys.onchange);
362 }
363
364 public void setOnchange(String onchange)
365 {
366 getStateHelper().put(PropertyKeys.onchange, onchange );
367 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.ONCHANGE_PROP);
368 }
369
370
371 public String getOnselect()
372 {
373 return (String) getStateHelper().eval(PropertyKeys.onselect);
374 }
375
376 public void setOnselect(String onselect)
377 {
378 getStateHelper().put(PropertyKeys.onselect, onselect );
379 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.ONSELECT_PROP);
380 }
381
382
383 public String getDir()
384 {
385 return (String) getStateHelper().eval(PropertyKeys.dir);
386 }
387
388 public void setDir(String dir)
389 {
390 getStateHelper().put(PropertyKeys.dir, dir );
391 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.DIR_PROP);
392 }
393
394
395 public String getLang()
396 {
397 return (String) getStateHelper().eval(PropertyKeys.lang);
398 }
399
400 public void setLang(String lang)
401 {
402 getStateHelper().put(PropertyKeys.lang, lang );
403 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.LANG_PROP);
404 }
405
406
407 public String getTitle()
408 {
409 return (String) getStateHelper().eval(PropertyKeys.title);
410 }
411
412 public void setTitle(String title)
413 {
414 getStateHelper().put(PropertyKeys.title, title );
415 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.TITLE_PROP);
416 }
417
418
419 public boolean isDisabled()
420 {
421 return (Boolean) getStateHelper().eval(PropertyKeys.disabled, false);
422 }
423
424 public void setDisabled(boolean disabled)
425 {
426 getStateHelper().put(PropertyKeys.disabled, disabled );
427 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.DISABLED_PROP);
428 }
429
430
431 public boolean isReadonly()
432 {
433 return (Boolean) getStateHelper().eval(PropertyKeys.readonly, false);
434 }
435
436 public void setReadonly(boolean readonly)
437 {
438 getStateHelper().put(PropertyKeys.readonly, readonly );
439 _CommonPropertyConstants.markProperty(this, _CommonPropertyConstants.READONLY_PROP);
440 }
441
442 public void setValueBinding(String name, ValueBinding binding)
443 {
444 super.setValueBinding(name, binding);
445 _CommonPropertyConstants.markProperty(this, name);
446 }
447
448 public void setValueExpression(String name, ValueExpression expression)
449 {
450 super.setValueExpression(name, expression);
451 _CommonPropertyConstants.markProperty(this, name);
452 }
453
454 protected enum PropertyKeys
455 {
456 maxlength
457 , size
458 , autocomplete
459 , label
460 , style
461 , styleClass
462 , alt
463 , tabindex
464 , onblur
465 , onfocus
466 , accesskey
467 , role
468 , onclick
469 , ondblclick
470 , onkeydown
471 , onkeypress
472 , onkeyup
473 , onmousedown
474 , onmousemove
475 , onmouseout
476 , onmouseover
477 , onmouseup
478 , onchange
479 , onselect
480 , dir
481 , lang
482 , title
483 , disabled
484 , readonly
485 }
486
487 }