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