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