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