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.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 ClientBehaviorHolder, 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      compact,
56      labelLayout,
57      customClass,
58      tip,
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    Use true, if you enable the possibility to apply styles to the output.
84     Use false, if you want to keep the code small (especially inside of sheets).
85    <br>Default: <code>false</code>
86    */
87    public boolean isCompact() {
88      Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.compact);
89      if (bool != null) {
90        return bool;
91      }
92      return false;
93    }
94  
95    public void setCompact(boolean compact) {
96      getStateHelper().put(PropertyKeys.compact, compact);
97    }
98  
99    /**
100   Defines the position of the label relative to the field.
101    The default is flexLeft, if the label is set, or none, if the label isn't set.
102    Set to 'skip' to avoid surrounding label container.
103    Hint for tc:out: set also compact=true to render only text (without html tags).
104 
105   */
106   public org.apache.myfaces.tobago.component.LabelLayout getLabelLayout() {
107     org.apache.myfaces.tobago.component.LabelLayout labelLayout = (org.apache.myfaces.tobago.component.LabelLayout) getStateHelper().eval(PropertyKeys.labelLayout);
108     if (labelLayout != null) {
109       return labelLayout;
110     }
111     return getLabel() != null ? org.apache.myfaces.tobago.component.LabelLayout.flexLeft : org.apache.myfaces.tobago.component.LabelLayout.none;
112   }
113 
114   public void setLabelLayout(org.apache.myfaces.tobago.component.LabelLayout labelLayout) {
115     getStateHelper().put(PropertyKeys.labelLayout, labelLayout);
116   }
117 
118   /**
119   Sets a CSS class in its parent, if the parent supports it.
120 
121    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
122 
123    <pre>
124    &lt;tc:in&gt;
125      &lt;tc:style customClass="my-emphasized"/&gt;
126    &lt;/tc:in&gt;
127    </pre>
128 
129    One capability is, to used external CSS libs.
130    <br>
131    This feature should not be used imprudent.
132    Because it might be unstable against changes in the renderered HTML code.
133 
134   */
135   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
136     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
137   }
138 
139   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
140     getStateHelper().put(PropertyKeys.customClass, customClass);
141   }
142 
143   /**
144   Text value to display as tooltip.
145 
146   */
147   public java.lang.String getTip() {
148     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
149   }
150 
151   public void setTip(java.lang.String tip) {
152     getStateHelper().put(PropertyKeys.tip, tip);
153   }
154 
155   /**
156   Indicates that the renderer should create an element in the output language
157    (e. g. an span or div tag around the output text).
158    Use true, if you enable the possibility to apply styles to the output.
159    Use false, if you want to keep the code small (especially inside of sheets).
160   <br>Default: <code>true</code>
161   */
162   public boolean isCreateSpan() {
163     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.createSpan);
164     if (bool != null) {
165       return bool;
166     }
167     return true;
168   }
169 
170   public void setCreateSpan(boolean createSpan) {
171     getStateHelper().put(PropertyKeys.createSpan, createSpan);
172   }
173 
174   /**
175   A localized user presentable label for this component.
176 
177   */
178   public java.lang.String getLabel() {
179     return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
180   }
181 
182   public void setLabel(java.lang.String label) {
183     getStateHelper().put(PropertyKeys.label, label);
184   }
185 
186   /**
187   Flag indicating that characters that are
188    sensitive in HTML and XML markup must be escaped.
189   <br>Default: <code>true</code>
190   */
191   public boolean isEscape() {
192     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.escape);
193     if (bool != null) {
194       return bool;
195     }
196     return true;
197   }
198 
199   public void setEscape(boolean escape) {
200     getStateHelper().put(PropertyKeys.escape, escape);
201   }
202 
203   /**
204   Should HTML content sanitized?
205    The effect of sanitizing depends on the configuration.
206    The value "auto" means, that sanitizing take place for
207    <ul>
208      <li>tc:out when escape="false" or</li>
209      <li>tc:textarea when attribute data-html-editor is set,</li>
210    </ul>
211    because that are the critical parts.
212   <br>Default: <code>auto</code><br>Allowed Values: <code>auto,never</code>
213   */
214   public org.apache.myfaces.tobago.sanitizer.SanitizeMode getSanitize() {
215     org.apache.myfaces.tobago.sanitizer.SanitizeMode sanitize = (org.apache.myfaces.tobago.sanitizer.SanitizeMode) getStateHelper().eval(PropertyKeys.sanitize);
216     if (sanitize != null) {
217       return sanitize;
218     }
219     return org.apache.myfaces.tobago.sanitizer.SanitizeMode.auto;
220   }
221 
222   public void setSanitize(org.apache.myfaces.tobago.sanitizer.SanitizeMode sanitize) {
223     getStateHelper().put(PropertyKeys.sanitize, sanitize);
224   }
225 
226 
227 }