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