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