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.AbstractUISelectOneRadio;
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   Render a set of radio buttons.
39    * UIComponent class, generated from template {@code component.stg} with class
40    * {@link org.apache.myfaces.tobago.internal.taglib.component.SelectOneRadioTagDeclaration}.
41   */
42  public class UISelectOneRadio
43      extends AbstractUISelectOneRadio implements Visual {
44  
45    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.SelectOneRadio";
46  
47    public static final String COMPONENT_FAMILY = "javax.faces.SelectOne";
48  
49  
50    enum PropertyKeys {
51      markup,
52      labelLayout,
53      focus,
54      tabIndex,
55      label,
56      readonly,
57      inline,
58      customClass,
59      style,
60      disabled,
61      tip,
62      renderRange,
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   Flag indicating this component should receive the focus.
101   <br>Default: <code>false</code>
102   */
103   public boolean isFocus() {
104     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.focus);
105     if (bool != null) {
106       return bool;
107     }
108     return false;
109   }
110 
111   public void setFocus(boolean focus) {
112     getStateHelper().put(PropertyKeys.focus, focus);
113   }
114 
115   /**
116   Controls the navigation of the focus through the
117    input controls on a page with the Tab-Key.
118    The navigation starts from the element with
119    the lowest tabIndex value to the element with the highest value.
120    Elements that have identical tabIndex values should be navigated
121    in the order they appear in the character stream
122    Elements that are disabled or with a negative tabIndex
123    do not participate in the tabbing order.
124 
125   */
126   public java.lang.Integer getTabIndex() {
127     Number value  = (Number) getStateHelper().eval(PropertyKeys.tabIndex);
128     if (value != null) {
129       return value.intValue();
130     }
131     return null;
132   }
133 
134   public void setTabIndex(java.lang.Integer tabIndex) {
135     getStateHelper().put(PropertyKeys.tabIndex, tabIndex);
136   }
137 
138   /**
139   A localized user presentable name for this component.
140 
141   */
142   public java.lang.String getLabel() {
143     return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
144   }
145 
146   public void setLabel(java.lang.String label) {
147     getStateHelper().put(PropertyKeys.label, label);
148   }
149 
150   /**
151   Flag indicating that this component will prohibit changes by the user.
152   <br>Default: <code>false</code>
153   */
154   public boolean isReadonly() {
155     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.readonly);
156     if (bool != null) {
157       return bool;
158     }
159     return false;
160   }
161 
162   public void setReadonly(boolean readonly) {
163     getStateHelper().put(PropertyKeys.readonly, readonly);
164   }
165 
166   /**
167   Flag indicating this component should rendered as an inline element.
168   <br>Default: <code>false</code>
169   */
170   public boolean isInline() {
171     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.inline);
172     if (bool != null) {
173       return bool;
174     }
175     return false;
176   }
177 
178   public void setInline(boolean inline) {
179     getStateHelper().put(PropertyKeys.inline, inline);
180   }
181 
182   /**
183   Sets a CSS class in its parent, if the parent supports it.
184 
185    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
186 
187    <pre>
188    &lt;tc:in&gt;
189      &lt;tc:style customClass="my-emphasized"/&gt;
190    &lt;/tc:in&gt;
191    </pre>
192 
193    One capability is, to used external CSS libs.
194    <br>
195    This feature should not be used imprudent.
196    Because it might be unstable against changes in the renderered HTML code.
197 
198   */
199   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
200     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
201   }
202 
203   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
204     getStateHelper().put(PropertyKeys.customClass, customClass);
205   }
206 
207   /**
208   For internal use. Used for rendering, if there is a child tag &lt;tc:style&gt;
209 
210   */
211   public org.apache.myfaces.tobago.renderkit.css.Style getStyle() {
212     return (org.apache.myfaces.tobago.renderkit.css.Style) getStateHelper().eval(PropertyKeys.style);
213   }
214 
215   public void setStyle(org.apache.myfaces.tobago.renderkit.css.Style style) {
216     getStateHelper().put(PropertyKeys.style, style);
217   }
218 
219   /**
220   Flag indicating that this element is disabled.
221   <br>Default: <code>false</code>
222   */
223   public boolean isDisabled() {
224     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
225     if (bool != null) {
226       return bool;
227     }
228     return false;
229   }
230 
231   public void setDisabled(boolean disabled) {
232     getStateHelper().put(PropertyKeys.disabled, disabled);
233   }
234 
235   /**
236   Text value to display as tooltip.
237 
238   */
239   public java.lang.String getTip() {
240     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
241   }
242 
243   public void setTip(java.lang.String tip) {
244     getStateHelper().put(PropertyKeys.tip, tip);
245   }
246 
247   /**
248   Range of items to render.
249 
250   */
251   public java.lang.String getRenderRange() {
252     return (java.lang.String) getStateHelper().eval(PropertyKeys.renderRange);
253   }
254 
255   public void setRenderRange(java.lang.String renderRange) {
256     getStateHelper().put(PropertyKeys.renderRange, renderRange);
257   }
258 
259 
260 }