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.AbstractUISelectManyShuttle;
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.Arrays;
33  import java.util.ArrayList;
34  import java.util.Collection;
35  import java.util.List;
36  import javax.el.MethodExpression;
37  import javax.el.ValueExpression;
38  
39  /** 
40    * UIComponent class, generated from template {@code component.stg} with class
41    * {@link org.apache.myfaces.tobago.internal.taglib.component.SelectManyShuttleTagDeclaration}.
42   */
43  public class UISelectManyShuttle
44      extends AbstractUISelectManyShuttle implements Visual {
45  
46    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.SelectManyShuttle";
47  
48    public static final String COMPONENT_FAMILY = "javax.faces.SelectMany";
49  
50    private static final Collection<String> EVENT_NAMES = Arrays.asList("change", "click", "dblclick", "focus", "blur");
51  
52    @Override
53    public Collection<String> getEventNames() {
54      return EVENT_NAMES;
55    }
56  
57    @Override
58    public String getDefaultEventName() {
59      return "change";
60    }
61  
62  
63    enum PropertyKeys {
64      markup,
65      selectedLabel,
66      labelLayout,
67      focus,
68      tabIndex,
69      label,
70      unselectedLabel,
71      readonly,
72      size,
73      customClass,
74      disabled,
75      tip,
76      style,
77    }
78  
79    public String getFamily() {
80      return COMPONENT_FAMILY;
81    }
82  
83  
84    public org.apache.myfaces.tobago.context.Markup getMarkup() {
85      Object object = getStateHelper().eval(PropertyKeys.markup);
86      if (object != null) {
87        return Markup.valueOf(object);
88      }
89      return null;
90    }
91  
92    public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
93      getStateHelper().put(PropertyKeys.markup, markup);
94    }
95  
96    /**
97    A localized user presentable label for the right select box.
98  
99    */
100   public java.lang.String getSelectedLabel() {
101     return (java.lang.String) getStateHelper().eval(PropertyKeys.selectedLabel);
102   }
103 
104   public void setSelectedLabel(java.lang.String selectedLabel) {
105     getStateHelper().put(PropertyKeys.selectedLabel, selectedLabel);
106   }
107 
108   /**
109   Defines the position of the label relative to the field.
110    The default is flexLeft, if the label is set, or none, if the label isn't set.
111 
112   */
113   public org.apache.myfaces.tobago.component.LabelLayout getLabelLayout() {
114     org.apache.myfaces.tobago.component.LabelLayout labelLayout = (org.apache.myfaces.tobago.component.LabelLayout) getStateHelper().eval(PropertyKeys.labelLayout);
115     if (labelLayout != null) {
116       return labelLayout;
117     }
118     return getLabel() != null ? org.apache.myfaces.tobago.component.LabelLayout.flexLeft : org.apache.myfaces.tobago.component.LabelLayout.none;
119   }
120 
121   public void setLabelLayout(org.apache.myfaces.tobago.component.LabelLayout labelLayout) {
122     getStateHelper().put(PropertyKeys.labelLayout, labelLayout);
123   }
124 
125   /**
126   Flag indicating this component should receive the focus.
127   <br>Default: <code>false</code>
128   */
129   public boolean isFocus() {
130     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.focus);
131     if (bool != null) {
132       return bool;
133     }
134     return false;
135   }
136 
137   public void setFocus(boolean focus) {
138     getStateHelper().put(PropertyKeys.focus, focus);
139   }
140 
141   /**
142   Controls the navigation of the focus through the
143    input controls on a page with the Tab-Key.
144    The navigation starts from the element with
145    the lowest tabIndex value to the element with the highest value.
146    Elements that have identical tabIndex values should be navigated
147    in the order they appear in the character stream
148    Elements that are disabled or with a negative tabIndex
149    do not participate in the tabbing order.
150 
151   */
152   public java.lang.Integer getTabIndex() {
153     Number value  = (Number) getStateHelper().eval(PropertyKeys.tabIndex);
154     if (value != null) {
155       return value.intValue();
156     }
157     return null;
158   }
159 
160   public void setTabIndex(java.lang.Integer tabIndex) {
161     getStateHelper().put(PropertyKeys.tabIndex, tabIndex);
162   }
163 
164   /**
165   A localized user presentable label for this component.
166 
167   */
168   public java.lang.String getLabel() {
169     return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
170   }
171 
172   public void setLabel(java.lang.String label) {
173     getStateHelper().put(PropertyKeys.label, label);
174   }
175 
176   /**
177   A localized user presentable label for the left select box.
178 
179   */
180   public java.lang.String getUnselectedLabel() {
181     return (java.lang.String) getStateHelper().eval(PropertyKeys.unselectedLabel);
182   }
183 
184   public void setUnselectedLabel(java.lang.String unselectedLabel) {
185     getStateHelper().put(PropertyKeys.unselectedLabel, unselectedLabel);
186   }
187 
188   /**
189   Flag indicating that this component will prohibit changes by the user.
190   <br>Default: <code>false</code>
191   */
192   public boolean isReadonly() {
193     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.readonly);
194     if (bool != null) {
195       return bool;
196     }
197     return false;
198   }
199 
200   public void setReadonly(boolean readonly) {
201     getStateHelper().put(PropertyKeys.readonly, readonly);
202   }
203 
204   /**
205   The number of the shown rows in the element. E. g. the size attribute of the select element in HTML.
206 
207   */
208   public java.lang.Integer getSize() {
209     Number value  = (Number) getStateHelper().eval(PropertyKeys.size);
210     if (value != null) {
211       return value.intValue();
212     }
213     return null;
214   }
215 
216   public void setSize(java.lang.Integer size) {
217     getStateHelper().put(PropertyKeys.size, size);
218   }
219 
220   /**
221   Sets a CSS class in its parent, if the parent supports it.
222 
223    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
224 
225    <pre>
226    &lt;tc:in&gt;
227      &lt;tc:style customClass="my-emphasized"/&gt;
228    &lt;/tc:in&gt;
229    </pre>
230 
231    One capability is, to used external CSS libs.
232    <br>
233    This feature should not be used imprudent.
234    Because it might be unstable against changes in the renderered HTML code.
235 
236   */
237   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
238     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
239   }
240 
241   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
242     getStateHelper().put(PropertyKeys.customClass, customClass);
243   }
244 
245   /**
246   Flag indicating that this element is disabled.
247   <br>Default: <code>false</code>
248   */
249   public boolean isDisabled() {
250     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
251     if (bool != null) {
252       return bool;
253     }
254     return false;
255   }
256 
257   public void setDisabled(boolean disabled) {
258     getStateHelper().put(PropertyKeys.disabled, disabled);
259   }
260 
261   /**
262   Text value to display as tooltip.
263 
264   */
265   public java.lang.String getTip() {
266     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
267   }
268 
269   public void setTip(java.lang.String tip) {
270     getStateHelper().put(PropertyKeys.tip, tip);
271   }
272 
273   /**
274   For internal use. Used for rendering, if there is a child tag &lt;tc:style&gt;
275 
276   */
277   public org.apache.myfaces.tobago.renderkit.css.Style getStyle() {
278     return (org.apache.myfaces.tobago.renderkit.css.Style) getStateHelper().eval(PropertyKeys.style);
279   }
280 
281   public void setStyle(org.apache.myfaces.tobago.renderkit.css.Style style) {
282     getStateHelper().put(PropertyKeys.style, style);
283   }
284 
285 
286 }