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.AbstractUISelectBooleanCheckbox;
25  import org.apache.myfaces.tobago.renderkit.css.CustomClass;
26  import org.apache.myfaces.tobago.renderkit.css.Style;
27  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
28  import org.apache.myfaces.tobago.internal.util.StringUtils;
29  import org.apache.myfaces.tobago.internal.util.Deprecation;
30  import javax.el.ELException;
31  import javax.faces.FacesException;
32  import java.util.ArrayList;
33  import java.util.List;
34  import javax.el.MethodExpression;
35  import javax.el.ValueExpression;
36  
37  /** 
38   Renders a checkbox.
39    * UIComponent class, generated from template {@code component.stg} with class
40    * {@link org.apache.myfaces.tobago.internal.taglib.component.SelectBooleanCheckboxTagDeclaration}.
41   */
42  public class UISelectBooleanCheckbox
43      extends AbstractUISelectBooleanCheckbox implements SupportsAccessKey, Visual {
44  
45    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.SelectBooleanCheckbox";
46  
47    public static final String COMPONENT_FAMILY = "javax.faces.SelectBoolean";
48  
49  
50    enum PropertyKeys {
51      markup,
52      focus,
53      tabIndex,
54      label,
55      itemLabel,
56      readonly,
57      accessKey,
58      customClass,
59      disabled,
60      tip,
61      style,
62    }
63  
64    public String getFamily() {
65      return COMPONENT_FAMILY;
66    }
67  
68  
69    public org.apache.myfaces.tobago.context.Markup getMarkup() {
70      Object object = getStateHelper().eval(PropertyKeys.markup);
71      if (object != null) {
72        return Markup.valueOf(object);
73      }
74      return null;
75    }
76  
77    public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
78      getStateHelper().put(PropertyKeys.markup, markup);
79    }
80  
81    /**
82    Flag indicating this component should receive the focus.
83    <br>Default: <code>false</code>
84    */
85    public boolean isFocus() {
86      Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.focus);
87      if (bool != null) {
88        return bool;
89      }
90      return false;
91    }
92  
93    public void setFocus(boolean focus) {
94      getStateHelper().put(PropertyKeys.focus, focus);
95    }
96  
97    /**
98    Controls the navigation of the focus through the
99     input controls on a page with the Tab-Key.
100    The navigation starts from the element with
101    the lowest tabIndex value to the element with the highest value.
102    Elements that have identical tabIndex values should be navigated
103    in the order they appear in the character stream
104    Elements that are disabled or with a negative tabIndex
105    do not participate in the tabbing order.
106 
107   */
108   public java.lang.Integer getTabIndex() {
109     Number value  = (Number) getStateHelper().eval(PropertyKeys.tabIndex);
110     if (value != null) {
111       return value.intValue();
112     }
113     return null;
114   }
115 
116   public void setTabIndex(java.lang.Integer tabIndex) {
117     getStateHelper().put(PropertyKeys.tabIndex, tabIndex);
118   }
119 
120   /**
121   Text value to display as label.
122    If text contains an underscore the next character is used as accesskey (if configured so and possible).
123 
124   */
125   public java.lang.String getLabel() {
126     return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
127   }
128 
129   public void setLabel(java.lang.String label) {
130     getStateHelper().put(PropertyKeys.label, label);
131   }
132 
133   /**
134   Label to be displayed to the user for this option.
135 
136   */
137   public java.lang.String getItemLabel() {
138     return (java.lang.String) getStateHelper().eval(PropertyKeys.itemLabel);
139   }
140 
141   public void setItemLabel(java.lang.String itemLabel) {
142     getStateHelper().put(PropertyKeys.itemLabel, itemLabel);
143   }
144 
145   /**
146   Flag indicating that this component will prohibit changes by the user.
147   <br>Default: <code>false</code>
148   */
149   public boolean isReadonly() {
150     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.readonly);
151     if (bool != null) {
152       return bool;
153     }
154     return false;
155   }
156 
157   public void setReadonly(boolean readonly) {
158     getStateHelper().put(PropertyKeys.readonly, readonly);
159   }
160 
161   /**
162   The access key of this control.
163 
164   */
165   public java.lang.Character getAccessKey() {
166     return (java.lang.Character) getStateHelper().eval(PropertyKeys.accessKey);
167   }
168 
169   public void setAccessKey(java.lang.Character accessKey) {
170     getStateHelper().put(PropertyKeys.accessKey, accessKey);
171   }
172 
173   /**
174   Sets a CSS class in its parent, if the parent supports it.
175 
176    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
177 
178    <pre>
179    &lt;tc:in&gt;
180      &lt;tc:style customClass="my-emphasized"/&gt;
181    &lt;/tc:in&gt;
182    </pre>
183 
184    One capability is, to used external CSS libs.
185    <br>
186    This feature should not be used imprudent.
187    Because it might be unstable against changes in the renderered HTML code.
188 
189   */
190   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
191     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
192   }
193 
194   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
195     getStateHelper().put(PropertyKeys.customClass, customClass);
196   }
197 
198   /**
199   Flag indicating that this element is disabled.
200   <br>Default: <code>false</code>
201   */
202   public boolean isDisabled() {
203     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
204     if (bool != null) {
205       return bool;
206     }
207     return false;
208   }
209 
210   public void setDisabled(boolean disabled) {
211     getStateHelper().put(PropertyKeys.disabled, disabled);
212   }
213 
214   /**
215   Text value to display as tooltip.
216 
217   */
218   public java.lang.String getTip() {
219     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
220   }
221 
222   public void setTip(java.lang.String tip) {
223     getStateHelper().put(PropertyKeys.tip, tip);
224   }
225 
226   /**
227   For internal use. Used for rendering, if there is a child tag &lt;tc:style&gt;
228 
229   */
230   public org.apache.myfaces.tobago.renderkit.css.Style getStyle() {
231     return (org.apache.myfaces.tobago.renderkit.css.Style) getStateHelper().eval(PropertyKeys.style);
232   }
233 
234   public void setStyle(org.apache.myfaces.tobago.renderkit.css.Style style) {
235     getStateHelper().put(PropertyKeys.style, style);
236   }
237 
238 
239 }