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.component.behavior.ClientBehaviorHolder;
23  import javax.faces.context.FacesContext;
24  import org.apache.myfaces.tobago.context.Markup;
25  import org.apache.myfaces.tobago.internal.component.AbstractUIOut;
26  import org.apache.myfaces.tobago.renderkit.css.CustomClass;
27  import org.apache.myfaces.tobago.renderkit.css.Style;
28  import org.apache.myfaces.tobago.sanitizer.SanitizeMode;
29  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
30  import org.apache.myfaces.tobago.internal.util.StringUtils;
31  import org.apache.myfaces.tobago.internal.util.Deprecation;
32  import javax.el.ELException;
33  import javax.faces.FacesException;
34  import java.util.Arrays;
35  import java.util.ArrayList;
36  import java.util.Collection;
37  import java.util.List;
38  import javax.el.MethodExpression;
39  import javax.el.ValueExpression;
40  
41  /** 
42   Renders a text
43    * UIComponent class, generated from template {@code component.stg} with class
44    * {@link org.apache.myfaces.tobago.internal.taglib.component.OutTagDeclaration}.
45   */
46  public class UIOut
47      extends AbstractUIOut implements ClientBehaviorHolder, Visual {
48  
49    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Out";
50  
51    public static final String COMPONENT_FAMILY = "javax.faces.Output";
52  
53  
54    enum PropertyKeys {
55      markup,
56      labelLayout,
57      customClass,
58      tip,
59      style,
60      createSpan,
61      label,
62      escape,
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   Sets a CSS class in its parent, if the parent supports it.
102 
103    Which this feature it is possible to put a CSS class name into a component with the <tc:style> tag. Example:
104 
105    <pre>
106    &lt;tc:in&gt;
107      &lt;tc:style customClass="my-emphasized"/&gt;
108    &lt;/tc:in&gt;
109    </pre>
110 
111    One capability is, to used external CSS libs.
112    <br>
113    This feature should not be used imprudent.
114    Because it might be unstable against changes in the renderered HTML code.
115 
116   */
117   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
118     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
119   }
120 
121   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
122     getStateHelper().put(PropertyKeys.customClass, customClass);
123   }
124 
125   /**
126   Text value to display as tooltip.
127 
128   */
129   public java.lang.String getTip() {
130     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
131   }
132 
133   public void setTip(java.lang.String tip) {
134     getStateHelper().put(PropertyKeys.tip, tip);
135   }
136 
137   /**
138   For internal use. Used for rendering, if there is a child tag &lt;tc:style&gt;
139 
140   */
141   public org.apache.myfaces.tobago.renderkit.css.Style getStyle() {
142     return (org.apache.myfaces.tobago.renderkit.css.Style) getStateHelper().eval(PropertyKeys.style);
143   }
144 
145   public void setStyle(org.apache.myfaces.tobago.renderkit.css.Style style) {
146     getStateHelper().put(PropertyKeys.style, style);
147   }
148 
149   /**
150   Indicates that the renderer should create an element in the output language
151    (e. g. an span or div tag around the output text).
152    Use true, if you enable the possibility to apply styles to the output.
153    Use false, if you want to keep the code small (especially inside of sheets).
154   <br>Default: <code>true</code>
155   */
156   public boolean isCreateSpan() {
157     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.createSpan);
158     if (bool != null) {
159       return bool;
160     }
161     return true;
162   }
163 
164   public void setCreateSpan(boolean createSpan) {
165     getStateHelper().put(PropertyKeys.createSpan, createSpan);
166   }
167 
168   /**
169   A localized user presentable label for this component.
170 
171   */
172   public java.lang.String getLabel() {
173     return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
174   }
175 
176   public void setLabel(java.lang.String label) {
177     getStateHelper().put(PropertyKeys.label, label);
178   }
179 
180   /**
181   Flag indicating that characters that are
182    sensitive in HTML and XML markup must be escaped.
183   <br>Default: <code>true</code>
184   */
185   public boolean isEscape() {
186     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.escape);
187     if (bool != null) {
188       return bool;
189     }
190     return true;
191   }
192 
193   public void setEscape(boolean escape) {
194     getStateHelper().put(PropertyKeys.escape, escape);
195   }
196 
197   /**
198   Should HTML content sanitized?
199    The effect of sanitizing depends on the configuration.
200    The value "auto" means, that sanitizing take place for
201    <ul>
202      <li>tc:out when escape="false" or</li>
203      <li>tc:textarea when attribute data-html-editor is set,</li>
204    </ul>
205    because that are the critical parts.
206   <br>Default: <code>auto</code><br>Allowed Values: <code>auto,never</code>
207   */
208   public org.apache.myfaces.tobago.sanitizer.SanitizeMode getSanitize() {
209     org.apache.myfaces.tobago.sanitizer.SanitizeMode sanitize = (org.apache.myfaces.tobago.sanitizer.SanitizeMode) getStateHelper().eval(PropertyKeys.sanitize);
210     if (sanitize != null) {
211       return sanitize;
212     }
213     return org.apache.myfaces.tobago.sanitizer.SanitizeMode.auto;
214   }
215 
216   public void setSanitize(org.apache.myfaces.tobago.sanitizer.SanitizeMode sanitize) {
217     getStateHelper().put(PropertyKeys.sanitize, sanitize);
218   }
219 
220 
221 }