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