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      customClass,
60      disabled,
61      tip,
62      style,
63      placeholder,
64    }
65  
66    public String getFamily() {
67      return COMPONENT_FAMILY;
68    }
69  
70  
71    public org.apache.myfaces.tobago.context.Markup getMarkup() {
72      Object object = getStateHelper().eval(PropertyKeys.markup);
73      if (object != null) {
74        return Markup.valueOf(object);
75      }
76      return null;
77    }
78  
79    public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
80      getStateHelper().put(PropertyKeys.markup, markup);
81    }
82  
83    public boolean isAutocomplete() {
84      Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.autocomplete);
85      if (bool != null) {
86        return bool;
87      }
88      return true;
89    }
90  
91    public void setAutocomplete(boolean autocomplete) {
92      getStateHelper().put(PropertyKeys.autocomplete, autocomplete);
93    }
94  
95    /**
96    Defines the position of the label relative to the field.
97     The default is flexLeft, if the label is set, or none, if the label isn't set.
98  
99    */
100   public org.apache.myfaces.tobago.component.LabelLayout getLabelLayout() {
101     org.apache.myfaces.tobago.component.LabelLayout labelLayout = (org.apache.myfaces.tobago.component.LabelLayout) getStateHelper().eval(PropertyKeys.labelLayout);
102     if (labelLayout != null) {
103       return labelLayout;
104     }
105     return getLabel() != null ? org.apache.myfaces.tobago.component.LabelLayout.flexLeft : org.apache.myfaces.tobago.component.LabelLayout.none;
106   }
107 
108   public void setLabelLayout(org.apache.myfaces.tobago.component.LabelLayout labelLayout) {
109     getStateHelper().put(PropertyKeys.labelLayout, labelLayout);
110   }
111 
112   /**
113   Flag indicating this component should receive the focus.
114   <br>Default: <code>false</code>
115   */
116   public boolean isFocus() {
117     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.focus);
118     if (bool != null) {
119       return bool;
120     }
121     return false;
122   }
123 
124   public void setFocus(boolean focus) {
125     getStateHelper().put(PropertyKeys.focus, focus);
126   }
127 
128   /**
129   Controls the navigation of the focus through the
130    input controls on a page with the Tab-Key.
131    The navigation starts from the element with
132    the lowest tabIndex value to the element with the highest value.
133    Elements that have identical tabIndex values should be navigated
134    in the order they appear in the character stream
135    Elements that are disabled or with a negative tabIndex
136    do not participate in the tabbing order.
137 
138   */
139   public java.lang.Integer getTabIndex() {
140     Number value  = (Number) getStateHelper().eval(PropertyKeys.tabIndex);
141     if (value != null) {
142       return value.intValue();
143     }
144     return null;
145   }
146 
147   public void setTabIndex(java.lang.Integer tabIndex) {
148     getStateHelper().put(PropertyKeys.tabIndex, tabIndex);
149   }
150 
151   /**
152   A localized user presentable name for this component.
153 
154   */
155   public java.lang.String getLabel() {
156     return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
157   }
158 
159   public void setLabel(java.lang.String label) {
160     getStateHelper().put(PropertyKeys.label, label);
161   }
162 
163   /**
164   Flag indicating whether or not this component should be rendered as
165    password field , so you will not see the typed charakters.
166   <br>Default: <code>false</code>
167   */
168   public boolean isPassword() {
169     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.password);
170     if (bool != null) {
171       return bool;
172     }
173     return false;
174   }
175 
176   public void setPassword(boolean password) {
177     getStateHelper().put(PropertyKeys.password, password);
178   }
179 
180   /**
181   Flag indicating that this component will prohibit changes by the user.
182   <br>Default: <code>false</code>
183   */
184   public boolean isReadonly() {
185     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.readonly);
186     if (bool != null) {
187       return bool;
188     }
189     return false;
190   }
191 
192   public void setReadonly(boolean readonly) {
193     getStateHelper().put(PropertyKeys.readonly, readonly);
194   }
195 
196   /**
197   Sets a CSS class in its parent, if the parent supports it.
198 
199    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
200 
201    <pre>
202    &lt;tc:in&gt;
203      &lt;tc:style customClass="my-emphasized"/&gt;
204    &lt;/tc:in&gt;
205    </pre>
206 
207    One capability is, to used external CSS libs.
208    <br>
209    This feature should not be used imprudent.
210    Because it might be unstable against changes in the renderered HTML code.
211 
212   */
213   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
214     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
215   }
216 
217   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
218     getStateHelper().put(PropertyKeys.customClass, customClass);
219   }
220 
221   /**
222   Flag indicating that this element is disabled.
223   <br>Default: <code>false</code>
224   */
225   public boolean isDisabled() {
226     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
227     if (bool != null) {
228       return bool;
229     }
230     return false;
231   }
232 
233   public void setDisabled(boolean disabled) {
234     getStateHelper().put(PropertyKeys.disabled, disabled);
235   }
236 
237   /**
238   Text value to display as tooltip.
239 
240   */
241   public java.lang.String getTip() {
242     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
243   }
244 
245   public void setTip(java.lang.String tip) {
246     getStateHelper().put(PropertyKeys.tip, tip);
247   }
248 
249   /**
250   For internal use. Used for rendering, if there is a child tag &lt;tc:style&gt;
251 
252   */
253   public org.apache.myfaces.tobago.renderkit.css.Style getStyle() {
254     return (org.apache.myfaces.tobago.renderkit.css.Style) getStateHelper().eval(PropertyKeys.style);
255   }
256 
257   public void setStyle(org.apache.myfaces.tobago.renderkit.css.Style style) {
258     getStateHelper().put(PropertyKeys.style, style);
259   }
260 
261   /**
262   <p>
263    Displays a short text in the input field, that describes the meaning of this field.
264    This is part of HTML 5, the theme should emulate the behaviour, when the browser doesn't support it.
265    </p>
266    <p>
267    The text will not be displayed, when the input field is readonly or disabled.
268    </p>
269 
270   */
271   public java.lang.String getPlaceholder() {
272     return (java.lang.String) getStateHelper().eval(PropertyKeys.placeholder);
273   }
274 
275   public void setPlaceholder(java.lang.String placeholder) {
276     getStateHelper().put(PropertyKeys.placeholder, placeholder);
277   }
278 
279 
280 }