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