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.AbstractUITextarea;
25  import org.apache.myfaces.tobago.renderkit.css.CustomClass;
26  import org.apache.myfaces.tobago.renderkit.css.Style;
27  import org.apache.myfaces.tobago.sanitizer.SanitizeMode;
28  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
29  import org.apache.myfaces.tobago.internal.util.StringUtils;
30  import org.apache.myfaces.tobago.internal.util.Deprecation;
31  import javax.el.ELException;
32  import javax.faces.FacesException;
33  import java.util.ArrayList;
34  import java.util.List;
35  import javax.el.MethodExpression;
36  import javax.el.ValueExpression;
37  
38  /** 
39   Renders a multi line text input control.
40    * UIComponent class, generated from template {@code component.stg} with class
41    * {@link org.apache.myfaces.tobago.internal.taglib.component.TextareaTagDeclaration}.
42   */
43  public class UITextarea
44      extends AbstractUITextarea implements Visual {
45  
46    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Textarea";
47  
48    public static final String COMPONENT_FAMILY = "javax.faces.Input";
49  
50  
51    enum PropertyKeys {
52      markup,
53      labelLayout,
54      focus,
55      tabIndex,
56      label,
57      rows,
58      readonly,
59      customClass,
60      disabled,
61      tip,
62      style,
63      sanitize,
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    /**
84    Defines the position of the label relative to the field.
85     The default is flexLeft, if the label is set, or none, if the label isn't set.
86  
87    */
88    public org.apache.myfaces.tobago.component.LabelLayout getLabelLayout() {
89      org.apache.myfaces.tobago.component.LabelLayout labelLayout = (org.apache.myfaces.tobago.component.LabelLayout) getStateHelper().eval(PropertyKeys.labelLayout);
90      if (labelLayout != null) {
91        return labelLayout;
92      }
93      return getLabel() != null ? org.apache.myfaces.tobago.component.LabelLayout.flexLeft : org.apache.myfaces.tobago.component.LabelLayout.none;
94    }
95  
96    public void setLabelLayout(org.apache.myfaces.tobago.component.LabelLayout labelLayout) {
97      getStateHelper().put(PropertyKeys.labelLayout, labelLayout);
98    }
99  
100   /**
101   Flag indicating this component should receive the focus.
102   <br>Default: <code>false</code>
103   */
104   public boolean isFocus() {
105     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.focus);
106     if (bool != null) {
107       return bool;
108     }
109     return false;
110   }
111 
112   public void setFocus(boolean focus) {
113     getStateHelper().put(PropertyKeys.focus, focus);
114   }
115 
116   /**
117   Controls the navigation of the focus through the
118    input controls on a page with the Tab-Key.
119    The navigation starts from the element with
120    the lowest tabIndex value to the element with the highest value.
121    Elements that have identical tabIndex values should be navigated
122    in the order they appear in the character stream
123    Elements that are disabled or with a negative tabIndex
124    do not participate in the tabbing order.
125 
126   */
127   public java.lang.Integer getTabIndex() {
128     Number value  = (Number) getStateHelper().eval(PropertyKeys.tabIndex);
129     if (value != null) {
130       return value.intValue();
131     }
132     return null;
133   }
134 
135   public void setTabIndex(java.lang.Integer tabIndex) {
136     getStateHelper().put(PropertyKeys.tabIndex, tabIndex);
137   }
138 
139   /**
140   Text value to display as label.
141    If text contains an underscore the next character is used as accesskey (if configured so and possible).
142 
143   */
144   public java.lang.String getLabel() {
145     return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
146   }
147 
148   public void setLabel(java.lang.String label) {
149     getStateHelper().put(PropertyKeys.label, label);
150   }
151 
152   /**
153   The row count for this component.
154 
155   */
156   public java.lang.Integer getRows() {
157     Number value  = (Number) getStateHelper().eval(PropertyKeys.rows);
158     if (value != null) {
159       return value.intValue();
160     }
161     return null;
162   }
163 
164   public void setRows(java.lang.Integer rows) {
165     getStateHelper().put(PropertyKeys.rows, rows);
166   }
167 
168   /**
169   Flag indicating that this component will prohibit changes by the user.
170   <br>Default: <code>false</code>
171   */
172   public boolean isReadonly() {
173     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.readonly);
174     if (bool != null) {
175       return bool;
176     }
177     return false;
178   }
179 
180   public void setReadonly(boolean readonly) {
181     getStateHelper().put(PropertyKeys.readonly, readonly);
182   }
183 
184   /**
185   Sets a CSS class in its parent, if the parent supports it.
186 
187    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
188 
189    <pre>
190    &lt;tc:in&gt;
191      &lt;tc:style customClass="my-emphasized"/&gt;
192    &lt;/tc:in&gt;
193    </pre>
194 
195    One capability is, to used external CSS libs.
196    <br>
197    This feature should not be used imprudent.
198    Because it might be unstable against changes in the renderered HTML code.
199 
200   */
201   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
202     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
203   }
204 
205   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
206     getStateHelper().put(PropertyKeys.customClass, customClass);
207   }
208 
209   /**
210   Flag indicating that this element is disabled.
211   <br>Default: <code>false</code>
212   */
213   public boolean isDisabled() {
214     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
215     if (bool != null) {
216       return bool;
217     }
218     return false;
219   }
220 
221   public void setDisabled(boolean disabled) {
222     getStateHelper().put(PropertyKeys.disabled, disabled);
223   }
224 
225   /**
226   Text value to display as tooltip.
227 
228   */
229   public java.lang.String getTip() {
230     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
231   }
232 
233   public void setTip(java.lang.String tip) {
234     getStateHelper().put(PropertyKeys.tip, tip);
235   }
236 
237   /**
238   For internal use. Used for rendering, if there is a child tag &lt;tc:style&gt;
239 
240   */
241   public org.apache.myfaces.tobago.renderkit.css.Style getStyle() {
242     return (org.apache.myfaces.tobago.renderkit.css.Style) getStateHelper().eval(PropertyKeys.style);
243   }
244 
245   public void setStyle(org.apache.myfaces.tobago.renderkit.css.Style style) {
246     getStateHelper().put(PropertyKeys.style, style);
247   }
248 
249   /**
250   Should HTML content sanitized?
251    The effect of sanitizing depends on the configuration.
252    The value "auto" means, that sanitizing take place for
253    <ul>
254      <li>tc:out when escape="false" or</li>
255      <li>tc:textarea when attribute data-html-editor is set,</li>
256    </ul>
257    because that are the critical parts.
258   <br>Default: <code>auto</code><br>Allowed Values: <code>auto,never</code>
259   */
260   public org.apache.myfaces.tobago.sanitizer.SanitizeMode getSanitize() {
261     org.apache.myfaces.tobago.sanitizer.SanitizeMode sanitize = (org.apache.myfaces.tobago.sanitizer.SanitizeMode) getStateHelper().eval(PropertyKeys.sanitize);
262     if (sanitize != null) {
263       return sanitize;
264     }
265     return org.apache.myfaces.tobago.sanitizer.SanitizeMode.auto;
266   }
267 
268   public void setSanitize(org.apache.myfaces.tobago.sanitizer.SanitizeMode sanitize) {
269     getStateHelper().put(PropertyKeys.sanitize, sanitize);
270   }
271 
272 
273 }