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