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