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