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