1 // WARNING: This file was automatically generated. Do not edit it directly,
2 // or you will lose your changes.
3
4 /*
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License. You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied. See the License for the
19 * specific language governing permissions and limitations
20 * under the License.
21 */
22 package org.apache.myfaces.trinidad.component.core.input;
23
24 import java.util.Arrays;
25 import java.util.Collection;
26 import java.util.Collections;
27 import java.util.List;
28 import java.util.Map;
29 import javax.faces.component.UIComponent;
30 import javax.faces.component.behavior.ClientBehavior;
31 import javax.faces.component.behavior.ClientBehaviorHolder;
32 import org.apache.myfaces.trinidad.bean.FacesBean;
33 import org.apache.myfaces.trinidad.bean.PropertyKey;
34 import org.apache.myfaces.trinidad.component.UIXSelectOne;
35 import org.apache.myfaces.trinidad.util.ComponentUtils;
36
37 /**
38 *
39 * <html>The UIXSelectOneListbox component creates a component which allows
40 * the user to select a single value from a list of items.
41 * The UIXSelectOneListbox component contains any number of
42 * <f:selectItem>, <f:selectItems>, or
43 * <tr:selectItem> components, each of which
44 * represents an available option that the user may select.</html>
45 *
46 * <h4>Events:</h4>
47 * <table border="1" width="100%" cellpadding="3" summary="">
48 * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
49 * <th align="left">Type</th>
50 * <th align="left">Phases</th>
51 * <th align="left">Description</th>
52 * </tr>
53 * <tr class="TableRowColor">
54 * <td valign="top"><code>javax.faces.event.ValueChangeEvent</code></td>
55 * <td valign="top" nowrap>Process<br>Validations<br>Apply<br>Request<br>Values</td>
56 * <td valign="top">The valueChange event is delivered when the value
57 attribute is changed.</td>
58 * </tr>
59 * <tr class="TableRowColor">
60 * <td valign="top"><code>org.apache.myfaces.trinidad.event.AttributeChangeEvent</code></td>
61 * <td valign="top" nowrap>Invoke<br>Application<br>Apply<br>Request<br>Values</td>
62 * <td valign="top">Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change event might include the width of a column that supported client-side resizing.</td>
63 * </tr>
64 * </table>
65 */
66 public class CoreSelectOneListbox extends UIXSelectOne
67 implements ClientBehaviorHolder
68 {
69 static public final FacesBean.Type TYPE = new FacesBean.Type(
70 UIXSelectOne.TYPE);
71 static public final PropertyKey CONTENT_STYLE_KEY =
72 TYPE.registerKey("contentStyle", String.class);
73 static public final PropertyKey SIZE_KEY =
74 TYPE.registerKey("size", Integer.class);
75 static public final PropertyKey VALUE_PASS_THRU_KEY =
76 TYPE.registerKey("valuePassThru", Boolean.class, Boolean.FALSE);
77 static public final PropertyKey UNSELECTED_LABEL_KEY =
78 TYPE.registerKey("unselectedLabel", String.class);
79 static public final PropertyKey READ_ONLY_KEY =
80 TYPE.registerKey("readOnly", Boolean.class, Boolean.FALSE);
81 static public final PropertyKey DISABLED_KEY =
82 TYPE.registerKey("disabled", Boolean.class, Boolean.FALSE);
83 static public final PropertyKey LABEL_KEY =
84 TYPE.registerKey("label", String.class);
85 static public final PropertyKey SIMPLE_KEY =
86 TYPE.registerKey("simple", Boolean.class, Boolean.FALSE);
87 static public final PropertyKey ONCHANGE_KEY =
88 TYPE.registerKey("onchange", String.class);
89 static public final PropertyKey INLINE_STYLE_KEY =
90 TYPE.registerKey("inlineStyle", String.class);
91 static public final PropertyKey STYLE_CLASS_KEY =
92 TYPE.registerKey("styleClass", String.class);
93 static public final PropertyKey SHORT_DESC_KEY =
94 TYPE.registerKey("shortDesc", String.class);
95 static public final PropertyKey PARTIAL_TRIGGERS_KEY =
96 TYPE.registerKey("partialTriggers", String[].class, null, 0, PropertyKey.Mutable.RARELY);
97 static public final PropertyKey ONCLICK_KEY =
98 TYPE.registerKey("onclick", String.class);
99 static public final PropertyKey ONDBLCLICK_KEY =
100 TYPE.registerKey("ondblclick", String.class);
101 static public final PropertyKey ONMOUSEDOWN_KEY =
102 TYPE.registerKey("onmousedown", String.class);
103 static public final PropertyKey ONMOUSEUP_KEY =
104 TYPE.registerKey("onmouseup", String.class);
105 static public final PropertyKey ONMOUSEOVER_KEY =
106 TYPE.registerKey("onmouseover", String.class);
107 static public final PropertyKey ONMOUSEMOVE_KEY =
108 TYPE.registerKey("onmousemove", String.class);
109 static public final PropertyKey ONMOUSEOUT_KEY =
110 TYPE.registerKey("onmouseout", String.class);
111 static public final PropertyKey ONKEYPRESS_KEY =
112 TYPE.registerKey("onkeypress", String.class);
113 static public final PropertyKey ONKEYDOWN_KEY =
114 TYPE.registerKey("onkeydown", String.class);
115 static public final PropertyKey ONKEYUP_KEY =
116 TYPE.registerKey("onkeyup", String.class);
117 static public final PropertyKey ONBLUR_KEY =
118 TYPE.registerKey("onblur", String.class);
119 static public final PropertyKey ONFOCUS_KEY =
120 TYPE.registerKey("onfocus", String.class);
121 static public final PropertyKey SHOW_REQUIRED_KEY =
122 TYPE.registerKey("showRequired", Boolean.class, Boolean.FALSE);
123 static public final PropertyKey ACCESS_KEY_KEY =
124 TYPE.registerKey("accessKey", Character.class);
125 static public final PropertyKey AUTO_SUBMIT_KEY =
126 TYPE.registerKey("autoSubmit", Boolean.class, Boolean.FALSE);
127 static public final String HELP_FACET = "help";
128
129 static public final String COMPONENT_FAMILY =
130 "org.apache.myfaces.trinidad.SelectOne";
131 static public final String COMPONENT_TYPE =
132 "org.apache.myfaces.trinidad.CoreSelectOneListbox";
133 // Supported client events for client behaviors:
134 private final static Collection<String> _EVENT_NAMES = Collections.unmodifiableCollection(
135 Arrays.asList(
136 "change", "click", "dblclick", "mousedown", "mouseup", "mouseover",
137 "mousemove", "mouseout", "keypress", "keydown", "keyup", "focus",
138 "blur", "valueChange"
139 ));
140
141 /**
142 * Construct an instance of the CoreSelectOneListbox.
143 */
144 public CoreSelectOneListbox()
145 {
146 super("org.apache.myfaces.trinidad.Listbox");
147 }
148
149 /**
150 * This facet should contain field level help.
151 */
152 final public UIComponent getHelp()
153 {
154 return getFacet(HELP_FACET);
155 }
156
157 /**
158 * This facet should contain field level help.
159 */
160 @SuppressWarnings("unchecked")
161 final public void setHelp(UIComponent helpFacet)
162 {
163 getFacets().put(HELP_FACET, helpFacet);
164 }
165
166 /**
167 * Gets the CSS styles to attach to the content of the component. For example, you can set the width of that portion to 100 pixels by setting this attribute to "width: 100px".
168 *
169 * @return the new contentStyle value
170 */
171 final public String getContentStyle()
172 {
173 return ComponentUtils.resolveString(getProperty(CONTENT_STYLE_KEY));
174 }
175
176 /**
177 * Sets the CSS styles to attach to the content of the component. For example, you can set the width of that portion to 100 pixels by setting this attribute to "width: 100px".
178 *
179 * @param contentStyle the new contentStyle value
180 */
181 final public void setContentStyle(String contentStyle)
182 {
183 setProperty(CONTENT_STYLE_KEY, (contentStyle));
184 }
185
186 /**
187 * Gets The number of items that should be visible in the list. The renderer may constrain the maximum and minimum number of items shown.
188 *
189 * @return the new size value
190 */
191 final public int getSize()
192 {
193 return ComponentUtils.resolveInteger(getProperty(SIZE_KEY));
194 }
195
196 /**
197 * Sets The number of items that should be visible in the list. The renderer may constrain the maximum and minimum number of items shown.
198 *
199 * @param size the new size value
200 */
201 final public void setSize(int size)
202 {
203 setProperty(SIZE_KEY, Integer.valueOf(size));
204 }
205
206 /**
207 * Gets whether or not the values are passed through to
208 * the client. When valuePassThru is false
209 * the value and the options' values
210 * are converted to indexes before being sent to the client.
211 * Therefore, when valuePassThru is false,
212 * there is no need to write your own converter when you are using custom Objects
213 * as your values and/or options.
214 * If you need to know the actual values on the client-side, then you can set
215 * valuePassThru to true. This will pass the values through to the client,
216 * using your custom converter if it is available; a custom converter is
217 * needed if you are using custom objects. The default is false.
218 *
219 * @return the new valuePassThru value
220 */
221 final public boolean isValuePassThru()
222 {
223 return ComponentUtils.resolveBoolean(getProperty(VALUE_PASS_THRU_KEY), false);
224 }
225
226 /**
227 * Sets whether or not the values are passed through to
228 * the client. When valuePassThru is false
229 * the value and the options' values
230 * are converted to indexes before being sent to the client.
231 * Therefore, when valuePassThru is false,
232 * there is no need to write your own converter when you are using custom Objects
233 * as your values and/or options.
234 * If you need to know the actual values on the client-side, then you can set
235 * valuePassThru to true. This will pass the values through to the client,
236 * using your custom converter if it is available; a custom converter is
237 * needed if you are using custom objects. The default is false.
238 *
239 * @param valuePassThru the new valuePassThru value
240 */
241 final public void setValuePassThru(boolean valuePassThru)
242 {
243 setProperty(VALUE_PASS_THRU_KEY, valuePassThru ? Boolean.TRUE : Boolean.FALSE);
244 }
245
246 /**
247 * Gets the label for an additional item that indicates no selection has
248 * been made. When the user selects this item, "required" validation will
249 * not pass, or a null value will be set if the component is not "required".
250 *
251 * @return the new unselectedLabel value
252 */
253 final public String getUnselectedLabel()
254 {
255 return ComponentUtils.resolveString(getProperty(UNSELECTED_LABEL_KEY));
256 }
257
258 /**
259 * Sets the label for an additional item that indicates no selection has
260 * been made. When the user selects this item, "required" validation will
261 * not pass, or a null value will be set if the component is not "required".
262 *
263 * @param unselectedLabel the new unselectedLabel value
264 */
265 final public void setUnselectedLabel(String unselectedLabel)
266 {
267 setProperty(UNSELECTED_LABEL_KEY, (unselectedLabel));
268 }
269
270 /**
271 * Gets whether the element is read-only.
272 *
273 * @return the new readOnly value
274 */
275 final public boolean isReadOnly()
276 {
277 return ComponentUtils.resolveBoolean(getProperty(READ_ONLY_KEY), false);
278 }
279
280 /**
281 * Sets whether the element is read-only.
282 *
283 * @param readOnly the new readOnly value
284 */
285 final public void setReadOnly(boolean readOnly)
286 {
287 setProperty(READ_ONLY_KEY, readOnly ? Boolean.TRUE : Boolean.FALSE);
288 }
289
290 /**
291 * Gets whether the element is disabled.
292 *
293 * @return the new disabled value
294 */
295 final public boolean isDisabled()
296 {
297 return ComponentUtils.resolveBoolean(getProperty(DISABLED_KEY), false);
298 }
299
300 /**
301 * Sets whether the element is disabled.
302 *
303 * @param disabled the new disabled value
304 */
305 final public void setDisabled(boolean disabled)
306 {
307 setProperty(DISABLED_KEY, disabled ? Boolean.TRUE : Boolean.FALSE);
308 }
309
310 /**
311 * Gets the label of the bean.
312 *
313 * @return the new label value
314 */
315 final public String getLabel()
316 {
317 return ComponentUtils.resolveString(getProperty(LABEL_KEY));
318 }
319
320 /**
321 * Sets the label of the bean.
322 *
323 * @param label the new label value
324 */
325 final public void setLabel(String label)
326 {
327 setProperty(LABEL_KEY, (label));
328 }
329
330 /**
331 * Gets a boolean value that controls whether the component
332 * provides label and message support; when set to "true", the component will
333 * not display messaging support or the label (these attributes may be ignored: label,
334 * labelAndAccessKey, accessKey, showRequired,
335 * tip), and may use simpler layout primitives
336 *
337 * @return the new simple value
338 */
339 final public boolean isSimple()
340 {
341 return ComponentUtils.resolveBoolean(getProperty(SIMPLE_KEY), false);
342 }
343
344 /**
345 * Sets a boolean value that controls whether the component
346 * provides label and message support; when set to "true", the component will
347 * not display messaging support or the label (these attributes may be ignored: label,
348 * labelAndAccessKey, accessKey, showRequired,
349 * tip), and may use simpler layout primitives
350 *
351 * @param simple the new simple value
352 */
353 final public void setSimple(boolean simple)
354 {
355 setProperty(SIMPLE_KEY, simple ? Boolean.TRUE : Boolean.FALSE);
356 }
357
358 /**
359 * Gets event handler for when the value is changed.
360 *
361 * @return the new onchange value
362 */
363 final public String getOnchange()
364 {
365 return ComponentUtils.resolveString(getProperty(ONCHANGE_KEY));
366 }
367
368 /**
369 * Sets event handler for when the value is changed.
370 *
371 * @param onchange the new onchange value
372 */
373 final public void setOnchange(String onchange)
374 {
375 setProperty(ONCHANGE_KEY, (onchange));
376 }
377
378 /**
379 * Gets the CSS styles to use for this component.
380 *
381 * @return the new inlineStyle value
382 */
383 final public String getInlineStyle()
384 {
385 return ComponentUtils.resolveString(getProperty(INLINE_STYLE_KEY));
386 }
387
388 /**
389 * Sets the CSS styles to use for this component.
390 *
391 * @param inlineStyle the new inlineStyle value
392 */
393 final public void setInlineStyle(String inlineStyle)
394 {
395 setProperty(INLINE_STYLE_KEY, (inlineStyle));
396 }
397
398 /**
399 * Gets a CSS style class to use for this component.
400 *
401 * @return the new styleClass value
402 */
403 final public String getStyleClass()
404 {
405 return ComponentUtils.resolveString(getProperty(STYLE_CLASS_KEY));
406 }
407
408 /**
409 * Sets a CSS style class to use for this component.
410 *
411 * @param styleClass the new styleClass value
412 */
413 final public void setStyleClass(String styleClass)
414 {
415 setProperty(STYLE_CLASS_KEY, (styleClass));
416 }
417
418 /**
419 * Gets The short description of the component. This text is commonly used by user agents to display tooltip help text.
420 *
421 * @return the new shortDesc value
422 */
423 final public String getShortDesc()
424 {
425 return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));
426 }
427
428 /**
429 * Sets The short description of the component. This text is commonly used by user agents to display tooltip help text.
430 *
431 * @param shortDesc the new shortDesc value
432 */
433 final public void setShortDesc(String shortDesc)
434 {
435 setProperty(SHORT_DESC_KEY, (shortDesc));
436 }
437
438 /**
439 * Gets the IDs of the components that should trigger a partial update.
440 * <p>
441 * This component will listen on the trigger components. If one of the
442 * trigger components receives an event that will cause it to update
443 * in some way, this component will request to be updated too.</p>
444 * <p>
445 * Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
446 * </p>
447 * <p>
448 * Identifiers must account for NamingContainers. You can use a single colon to start the search from the root,
449 * or use multiple colons to move up through the NamingContainer. For example,
450 * "::" will pop out of this component's naming container (it pops out of itself if it is a naming container),
451 * ":::" will pop out of two naming containers, etc. The search for
452 * the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the
453 * component with id = commandButton1 after popping out of two naming containers relative to this component.
454 * To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
455 *
456 * @return the new partialTriggers value
457 */
458 final public String[] getPartialTriggers()
459 {
460 return (String[])getProperty(PARTIAL_TRIGGERS_KEY);
461 }
462
463 /**
464 * Sets the IDs of the components that should trigger a partial update.
465 * <p>
466 * This component will listen on the trigger components. If one of the
467 * trigger components receives an event that will cause it to update
468 * in some way, this component will request to be updated too.</p>
469 * <p>
470 * Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
471 * </p>
472 * <p>
473 * Identifiers must account for NamingContainers. You can use a single colon to start the search from the root,
474 * or use multiple colons to move up through the NamingContainer. For example,
475 * "::" will pop out of this component's naming container (it pops out of itself if it is a naming container),
476 * ":::" will pop out of two naming containers, etc. The search for
477 * the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the
478 * component with id = commandButton1 after popping out of two naming containers relative to this component.
479 * To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
480 *
481 * @param partialTriggers the new partialTriggers value
482 */
483 final public void setPartialTriggers(String[] partialTriggers)
484 {
485 setProperty(PARTIAL_TRIGGERS_KEY, (partialTriggers));
486 }
487
488 /**
489 * Gets an onclick Javascript handler.
490 *
491 * @return the new onclick value
492 */
493 final public String getOnclick()
494 {
495 return ComponentUtils.resolveString(getProperty(ONCLICK_KEY));
496 }
497
498 /**
499 * Sets an onclick Javascript handler.
500 *
501 * @param onclick the new onclick value
502 */
503 final public void setOnclick(String onclick)
504 {
505 setProperty(ONCLICK_KEY, (onclick));
506 }
507
508 /**
509 * Gets an ondblclick Javascript handler.
510 *
511 * @return the new ondblclick value
512 */
513 final public String getOndblclick()
514 {
515 return ComponentUtils.resolveString(getProperty(ONDBLCLICK_KEY));
516 }
517
518 /**
519 * Sets an ondblclick Javascript handler.
520 *
521 * @param ondblclick the new ondblclick value
522 */
523 final public void setOndblclick(String ondblclick)
524 {
525 setProperty(ONDBLCLICK_KEY, (ondblclick));
526 }
527
528 /**
529 * Gets an onmousedown Javascript handler.
530 *
531 * @return the new onmousedown value
532 */
533 final public String getOnmousedown()
534 {
535 return ComponentUtils.resolveString(getProperty(ONMOUSEDOWN_KEY));
536 }
537
538 /**
539 * Sets an onmousedown Javascript handler.
540 *
541 * @param onmousedown the new onmousedown value
542 */
543 final public void setOnmousedown(String onmousedown)
544 {
545 setProperty(ONMOUSEDOWN_KEY, (onmousedown));
546 }
547
548 /**
549 * Gets an onmouseup Javascript handler.
550 *
551 * @return the new onmouseup value
552 */
553 final public String getOnmouseup()
554 {
555 return ComponentUtils.resolveString(getProperty(ONMOUSEUP_KEY));
556 }
557
558 /**
559 * Sets an onmouseup Javascript handler.
560 *
561 * @param onmouseup the new onmouseup value
562 */
563 final public void setOnmouseup(String onmouseup)
564 {
565 setProperty(ONMOUSEUP_KEY, (onmouseup));
566 }
567
568 /**
569 * Gets an onmouseover Javascript handler.
570 *
571 * @return the new onmouseover value
572 */
573 final public String getOnmouseover()
574 {
575 return ComponentUtils.resolveString(getProperty(ONMOUSEOVER_KEY));
576 }
577
578 /**
579 * Sets an onmouseover Javascript handler.
580 *
581 * @param onmouseover the new onmouseover value
582 */
583 final public void setOnmouseover(String onmouseover)
584 {
585 setProperty(ONMOUSEOVER_KEY, (onmouseover));
586 }
587
588 /**
589 * Gets an onmousemove Javascript handler.
590 *
591 * @return the new onmousemove value
592 */
593 final public String getOnmousemove()
594 {
595 return ComponentUtils.resolveString(getProperty(ONMOUSEMOVE_KEY));
596 }
597
598 /**
599 * Sets an onmousemove Javascript handler.
600 *
601 * @param onmousemove the new onmousemove value
602 */
603 final public void setOnmousemove(String onmousemove)
604 {
605 setProperty(ONMOUSEMOVE_KEY, (onmousemove));
606 }
607
608 /**
609 * Gets an onmouseout Javascript handler.
610 *
611 * @return the new onmouseout value
612 */
613 final public String getOnmouseout()
614 {
615 return ComponentUtils.resolveString(getProperty(ONMOUSEOUT_KEY));
616 }
617
618 /**
619 * Sets an onmouseout Javascript handler.
620 *
621 * @param onmouseout the new onmouseout value
622 */
623 final public void setOnmouseout(String onmouseout)
624 {
625 setProperty(ONMOUSEOUT_KEY, (onmouseout));
626 }
627
628 /**
629 * Gets an onkeypress Javascript handler.
630 *
631 * @return the new onkeypress value
632 */
633 final public String getOnkeypress()
634 {
635 return ComponentUtils.resolveString(getProperty(ONKEYPRESS_KEY));
636 }
637
638 /**
639 * Sets an onkeypress Javascript handler.
640 *
641 * @param onkeypress the new onkeypress value
642 */
643 final public void setOnkeypress(String onkeypress)
644 {
645 setProperty(ONKEYPRESS_KEY, (onkeypress));
646 }
647
648 /**
649 * Gets an onkeydown Javascript handler.
650 *
651 * @return the new onkeydown value
652 */
653 final public String getOnkeydown()
654 {
655 return ComponentUtils.resolveString(getProperty(ONKEYDOWN_KEY));
656 }
657
658 /**
659 * Sets an onkeydown Javascript handler.
660 *
661 * @param onkeydown the new onkeydown value
662 */
663 final public void setOnkeydown(String onkeydown)
664 {
665 setProperty(ONKEYDOWN_KEY, (onkeydown));
666 }
667
668 /**
669 * Gets an onkeyup Javascript handler.
670 *
671 * @return the new onkeyup value
672 */
673 final public String getOnkeyup()
674 {
675 return ComponentUtils.resolveString(getProperty(ONKEYUP_KEY));
676 }
677
678 /**
679 * Sets an onkeyup Javascript handler.
680 *
681 * @param onkeyup the new onkeyup value
682 */
683 final public void setOnkeyup(String onkeyup)
684 {
685 setProperty(ONKEYUP_KEY, (onkeyup));
686 }
687
688 /**
689 * Gets the event handler for the component losing the focus.
690 *
691 * @return the new onblur value
692 */
693 final public String getOnblur()
694 {
695 return ComponentUtils.resolveString(getProperty(ONBLUR_KEY));
696 }
697
698 /**
699 * Sets the event handler for the component losing the focus.
700 *
701 * @param onblur the new onblur value
702 */
703 final public void setOnblur(String onblur)
704 {
705 setProperty(ONBLUR_KEY, (onblur));
706 }
707
708 /**
709 * Gets the event handler for the component gaining the focus.
710 *
711 * @return the new onfocus value
712 */
713 final public String getOnfocus()
714 {
715 return ComponentUtils.resolveString(getProperty(ONFOCUS_KEY));
716 }
717
718 /**
719 * Sets the event handler for the component gaining the focus.
720 *
721 * @param onfocus the new onfocus value
722 */
723 final public void setOnfocus(String onfocus)
724 {
725 setProperty(ONFOCUS_KEY, (onfocus));
726 }
727
728 /**
729 * Gets whether the associated control displays a visual indication of required user input. If a "required" attribute is also present, both the "required" attribute and the
730 * "showRequired" attribute must be false for the visual indication not to be displayed.
731 *
732 * @return the new showRequired value
733 */
734 final public boolean isShowRequired()
735 {
736 return ComponentUtils.resolveBoolean(getProperty(SHOW_REQUIRED_KEY), false);
737 }
738
739 /**
740 * Sets whether the associated control displays a visual indication of required user input. If a "required" attribute is also present, both the "required" attribute and the
741 * "showRequired" attribute must be false for the visual indication not to be displayed.
742 *
743 * @param showRequired the new showRequired value
744 */
745 final public void setShowRequired(boolean showRequired)
746 {
747 setProperty(SHOW_REQUIRED_KEY, showRequired ? Boolean.TRUE : Boolean.FALSE);
748 }
749
750 /**
751 * Gets <html>
752 * Character used to gain quick access to
753 * the form element specified by the
754 * <code>for</code>, if set (or this component itself,
755 * if it is a "non-simple" form element).
756 * For accessibility reasons, this functionality is not supported
757 * in screen reader mode.
758 * If the same access key appears in multiple locations in the
759 * same page of output, the rendering user agent will cycle
760 * among the elements accessed by the similar keys.
761 * <p>
762 * This attribute is sometimes referred to as the "mnemonic".
763 * </p></html>
764 *
765 * @return the new accessKey value
766 */
767 final public char getAccessKey()
768 {
769 return ComponentUtils.resolveCharacter((Character)getProperty(ACCESS_KEY_KEY));
770 }
771
772 /**
773 * Sets <html>
774 * Character used to gain quick access to
775 * the form element specified by the
776 * <code>for</code>, if set (or this component itself,
777 * if it is a "non-simple" form element).
778 * For accessibility reasons, this functionality is not supported
779 * in screen reader mode.
780 * If the same access key appears in multiple locations in the
781 * same page of output, the rendering user agent will cycle
782 * among the elements accessed by the similar keys.
783 * <p>
784 * This attribute is sometimes referred to as the "mnemonic".
785 * </p></html>
786 *
787 * @param accessKey the new accessKey value
788 */
789 final public void setAccessKey(char accessKey)
790 {
791 setProperty(ACCESS_KEY_KEY, Character.valueOf(accessKey));
792 }
793
794 /**
795 * Gets If set to TRUE on a form element, the component will automatically submit
796 * the enclosing form when an appropriate action takes place (a click, text
797 * change, etc.).
798 *
799 * @return the new autoSubmit value
800 */
801 final public boolean isAutoSubmit()
802 {
803 return ComponentUtils.resolveBoolean(getProperty(AUTO_SUBMIT_KEY), false);
804 }
805
806 /**
807 * Sets If set to TRUE on a form element, the component will automatically submit
808 * the enclosing form when an appropriate action takes place (a click, text
809 * change, etc.).
810 *
811 * @param autoSubmit the new autoSubmit value
812 */
813 final public void setAutoSubmit(boolean autoSubmit)
814 {
815 setProperty(AUTO_SUBMIT_KEY, autoSubmit ? Boolean.TRUE : Boolean.FALSE);
816 }
817
818 @Override
819 public String getDefaultEventName()
820 {
821 return "change";
822 }
823
824 @Override
825 public Collection<String> getEventNames()
826 {
827 return _EVENT_NAMES;
828 }
829
830 @Override
831 public Map<String, List<ClientBehavior>> getClientBehaviors()
832 {
833 return super.getClientBehaviors();
834 }
835
836 @Override
837 public void addClientBehavior(
838 String eventName,
839 ClientBehavior behavior)
840 {
841 super.addClientBehavior(eventName, behavior);
842 }
843
844 @Override
845 public String getFamily()
846 {
847 return COMPONENT_FAMILY;
848 }
849
850 @Override
851 protected FacesBean.Type getBeanType()
852 {
853 return TYPE;
854 }
855
856 /**
857 * Construct an instance of the CoreSelectOneListbox.
858 */
859 protected CoreSelectOneListbox(
860 String rendererType
861 )
862 {
863 super(rendererType);
864 }
865
866 static
867 {
868 TYPE.lockAndRegister("org.apache.myfaces.trinidad.SelectOne","org.apache.myfaces.trinidad.Listbox");
869 }
870 }