View Javadoc
1   // ---------- Attention: Generated code, please do not modify! -----------  
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one or more
5    * contributor license agreements.  See the NOTICE file distributed with
6    * this work for additional information regarding copyright ownership.
7    * The ASF licenses this file to You under the Apache License, Version 2.0
8    * (the "License"); you may not use this file except in compliance with
9    * the License.  You may obtain a copy of the License at
10   *
11   *      http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */
19  
20  package org.apache.myfaces.tobago.component;
21  
22  import javax.faces.context.FacesContext;
23  import org.apache.myfaces.tobago.context.Markup;
24  import org.apache.myfaces.tobago.internal.component.AbstractUIIn;
25  import org.apache.myfaces.tobago.renderkit.css.CustomClass;
26  import org.apache.myfaces.tobago.renderkit.css.Style;
27  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
28  import org.apache.myfaces.tobago.internal.util.StringUtils;
29  import org.apache.myfaces.tobago.internal.util.Deprecation;
30  import javax.el.ELException;
31  import javax.faces.FacesException;
32  import java.util.ArrayList;
33  import java.util.List;
34  import javax.el.MethodExpression;
35  import javax.el.ValueExpression;
36  
37  /** 
38   Renders a text input field.
39    * UIComponent class, generated from template {@code component.stg} with class
40    * {@link org.apache.myfaces.tobago.internal.taglib.component.InTagDeclaration}.
41   */
42  public class UIIn
43      extends AbstractUIIn implements Visual {
44  
45    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.In";
46  
47    public static final String COMPONENT_FAMILY = "javax.faces.Input";
48  
49  
50    enum PropertyKeys {
51      markup,
52      autocomplete,
53      labelLayout,
54      focus,
55      tabIndex,
56      label,
57      password,
58      readonly,
59      accessKey,
60      customClass,
61      disabled,
62      tip,
63      style,
64      placeholder,
65    }
66  
67    public String getFamily() {
68      return COMPONENT_FAMILY;
69    }
70  
71  
72    public org.apache.myfaces.tobago.context.Markup getMarkup() {
73      Object object = getStateHelper().eval(PropertyKeys.markup);
74      if (object != null) {
75        return Markup.valueOf(object);
76      }
77      return null;
78    }
79  
80    public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
81      getStateHelper().put(PropertyKeys.markup, markup);
82    }
83  
84    public boolean isAutocomplete() {
85      Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.autocomplete);
86      if (bool != null) {
87        return bool;
88      }
89      return true;
90    }
91  
92    public void setAutocomplete(boolean autocomplete) {
93      getStateHelper().put(PropertyKeys.autocomplete, autocomplete);
94    }
95  
96    /**
97    Defines the position of the label relative to the field.
98     The default is flexLeft, if the label is set, or none, if the label isn't set.
99  
100   */
101   public org.apache.myfaces.tobago.component.LabelLayout getLabelLayout() {
102     org.apache.myfaces.tobago.component.LabelLayout labelLayout = (org.apache.myfaces.tobago.component.LabelLayout) getStateHelper().eval(PropertyKeys.labelLayout);
103     if (labelLayout != null) {
104       return labelLayout;
105     }
106     return getLabel() != null ? org.apache.myfaces.tobago.component.LabelLayout.flexLeft : org.apache.myfaces.tobago.component.LabelLayout.none;
107   }
108 
109   public void setLabelLayout(org.apache.myfaces.tobago.component.LabelLayout labelLayout) {
110     getStateHelper().put(PropertyKeys.labelLayout, labelLayout);
111   }
112 
113   /**
114   Flag indicating this component should receive the focus.
115   <br>Default: <code>false</code>
116   */
117   public boolean isFocus() {
118     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.focus);
119     if (bool != null) {
120       return bool;
121     }
122     return false;
123   }
124 
125   public void setFocus(boolean focus) {
126     getStateHelper().put(PropertyKeys.focus, focus);
127   }
128 
129   /**
130   Controls the navigation of the focus through the
131    input controls on a page with the Tab-Key.
132    The navigation starts from the element with
133    the lowest tabIndex value to the element with the highest value.
134    Elements that have identical tabIndex values should be navigated
135    in the order they appear in the character stream
136    Elements that are disabled or with a negative tabIndex
137    do not participate in the tabbing order.
138 
139   */
140   public java.lang.Integer getTabIndex() {
141     Number value  = (Number) getStateHelper().eval(PropertyKeys.tabIndex);
142     if (value != null) {
143       return value.intValue();
144     }
145     return null;
146   }
147 
148   public void setTabIndex(java.lang.Integer tabIndex) {
149     getStateHelper().put(PropertyKeys.tabIndex, tabIndex);
150   }
151 
152   /**
153   A localized user presentable name for this component.
154 
155   */
156   public java.lang.String getLabel() {
157     return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
158   }
159 
160   public void setLabel(java.lang.String label) {
161     getStateHelper().put(PropertyKeys.label, label);
162   }
163 
164   /**
165   Flag indicating whether or not this component should be rendered as
166    password field , so you will not see the typed charakters.
167   <br>Default: <code>false</code>
168   */
169   public boolean isPassword() {
170     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.password);
171     if (bool != null) {
172       return bool;
173     }
174     return false;
175   }
176 
177   public void setPassword(boolean password) {
178     getStateHelper().put(PropertyKeys.password, password);
179   }
180 
181   /**
182   Flag indicating that this component will prohibit changes by the user.
183   <br>Default: <code>false</code>
184   */
185   public boolean isReadonly() {
186     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.readonly);
187     if (bool != null) {
188       return bool;
189     }
190     return false;
191   }
192 
193   public void setReadonly(boolean readonly) {
194     getStateHelper().put(PropertyKeys.readonly, readonly);
195   }
196 
197   /**
198   The access key of this control.
199 
200   */
201   public java.lang.Character getAccessKey() {
202     return (java.lang.Character) getStateHelper().eval(PropertyKeys.accessKey);
203   }
204 
205   public void setAccessKey(java.lang.Character accessKey) {
206     getStateHelper().put(PropertyKeys.accessKey, accessKey);
207   }
208 
209   /**
210   Sets a CSS class in its parent, if the parent supports it.
211 
212    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
213 
214    <pre>
215    &lt;tc:in&gt;
216      &lt;tc:style customClass="my-emphasized"/&gt;
217    &lt;/tc:in&gt;
218    </pre>
219 
220    One capability is, to used external CSS libs.
221    <br>
222    This feature should not be used imprudent.
223    Because it might be unstable against changes in the renderered HTML code.
224 
225   */
226   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
227     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
228   }
229 
230   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
231     getStateHelper().put(PropertyKeys.customClass, customClass);
232   }
233 
234   /**
235   Flag indicating that this element is disabled.
236   <br>Default: <code>false</code>
237   */
238   public boolean isDisabled() {
239     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
240     if (bool != null) {
241       return bool;
242     }
243     return false;
244   }
245 
246   public void setDisabled(boolean disabled) {
247     getStateHelper().put(PropertyKeys.disabled, disabled);
248   }
249 
250   /**
251   Text value to display as tooltip.
252 
253   */
254   public java.lang.String getTip() {
255     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
256   }
257 
258   public void setTip(java.lang.String tip) {
259     getStateHelper().put(PropertyKeys.tip, tip);
260   }
261 
262   /**
263   For internal use. Used for rendering, if there is a child tag &lt;tc:style&gt;
264 
265   */
266   public org.apache.myfaces.tobago.renderkit.css.Style getStyle() {
267     return (org.apache.myfaces.tobago.renderkit.css.Style) getStateHelper().eval(PropertyKeys.style);
268   }
269 
270   public void setStyle(org.apache.myfaces.tobago.renderkit.css.Style style) {
271     getStateHelper().put(PropertyKeys.style, style);
272   }
273 
274   /**
275   <p>
276    Displays a short text in the input field, that describes the meaning of this field.
277    This is part of HTML 5, the theme should emulate the behaviour, when the browser doesn't support it.
278    </p>
279    <p>
280    The text will not be displayed, when the input field is readonly or disabled.
281    </p>
282 
283   */
284   public java.lang.String getPlaceholder() {
285     return (java.lang.String) getStateHelper().eval(PropertyKeys.placeholder);
286   }
287 
288   public void setPlaceholder(java.lang.String placeholder) {
289     getStateHelper().put(PropertyKeys.placeholder, placeholder);
290   }
291 
292 
293 }