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.layout.Display;
26  import org.apache.myfaces.tobago.layout.Measure;
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 org.apache.myfaces.tobago.renderkit.MarginValues;
31  import org.apache.myfaces.tobago.renderkit.SpacingValues;
32  import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
33  import javax.el.ELException;
34  import javax.faces.FacesException;
35  import java.util.ArrayList;
36  import java.util.List;
37  import javax.el.MethodExpression;
38  import javax.el.ValueExpression;
39  
40  /** 
41    * UIComponent class, generated from template {@code component2.0.stg} with class
42    * {@link org.apache.myfaces.tobago.internal.taglib.component.SelectManyShuttleTagDeclaration}.
43   */
44  public class UISelectManyShuttle
45      extends AbstractUISelectManyShuttle implements SupportsMarkup {
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 org.apache.myfaces.tobago.context.Markup currentMarkup;
52  
53    enum PropertyKeys {
54      markup,
55      marginLeft,
56      tabIndex,
57      minimumHeight,
58      unselectedLabel,
59      tip,
60      height,
61      minimumWidth,
62      rowSpan,
63      left,
64      focus,
65      columnSpan,
66      selectedLabel,
67      top,
68      maximumHeight,
69      currentWidth,
70      marginTop,
71      width,
72      marginRight,
73      currentHeight,
74      preferredHeight,
75      display,
76      label,
77      maximumWidth,
78      onchange,
79      preferredWidth,
80      marginBottom,
81      verticalIndex,
82      horizontalIndex,
83      readonly,
84      disabled,
85    }
86  
87    public String getFamily() {
88      return COMPONENT_FAMILY;
89    }
90  
91  
92    public org.apache.myfaces.tobago.context.Markup getMarkup() {
93      Object object = getStateHelper().eval(PropertyKeys.markup);
94      if (object != null) {
95        return Markup.valueOf(object);
96      }
97      return null;
98    }
99  
100   public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
101     getStateHelper().put(PropertyKeys.markup, markup);
102   }
103 
104   public org.apache.myfaces.tobago.layout.Measure getMarginLeft() {
105     Object object = getStateHelper().eval(PropertyKeys.marginLeft);
106     if (object != null) {
107        return Measure.valueOf(object);
108     }
109     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginLeft(getFacesContext(), this) : Measure.ZERO;
110   }
111 
112   public void setMarginLeft(org.apache.myfaces.tobago.layout.Measure marginLeft) {
113     getStateHelper().put(PropertyKeys.marginLeft, marginLeft);
114   }
115 
116   /**
117   Controls the navigation of the focus through the
118    input controls on a page with the Tab-Key.
119    The navigation starts from the element with
120    the lowest tabIndex value to the element with the highest value.
121    Elements that have identical tabIndex values should be navigated
122    in the order they appear in the character stream
123    Elements that are disabled or with a negative tabIndex
124    do not participate in the tabbing order.
125 
126   */
127   public java.lang.Integer getTabIndex() {
128     Number value  = (Number) getStateHelper().eval(PropertyKeys.tabIndex);
129     if (value != null) {
130       return value.intValue();
131     }
132     return null;
133   }
134 
135   public void setTabIndex(java.lang.Integer tabIndex) {
136     getStateHelper().put(PropertyKeys.tabIndex, tabIndex);
137   }
138 
139   public org.apache.myfaces.tobago.layout.Measure getMinimumHeight() {
140     Object object = getStateHelper().eval(PropertyKeys.minimumHeight);
141     if (object != null) {
142        return Measure.valueOf(object);
143     }
144     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumHeight(getFacesContext(), this) : Measure.ZERO;
145   }
146 
147   public void setMinimumHeight(org.apache.myfaces.tobago.layout.Measure minimumHeight) {
148     getStateHelper().put(PropertyKeys.minimumHeight, minimumHeight);
149   }
150 
151   /**
152   A localized user presentable label for the left select box.
153 
154   */
155   public java.lang.String getUnselectedLabel() {
156     return (java.lang.String) getStateHelper().eval(PropertyKeys.unselectedLabel);
157   }
158 
159   public void setUnselectedLabel(java.lang.String unselectedLabel) {
160     getStateHelper().put(PropertyKeys.unselectedLabel, unselectedLabel);
161   }
162 
163   /**
164   Text value to display as tooltip.
165 
166   */
167   public java.lang.String getTip() {
168     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
169   }
170 
171   public void setTip(java.lang.String tip) {
172     getStateHelper().put(PropertyKeys.tip, tip);
173   }
174 
175   /**
176   This value will usually be set by the layout manager.
177 
178   */
179   public org.apache.myfaces.tobago.layout.Measure getHeight() {
180     Object object = getStateHelper().eval(PropertyKeys.height);
181     if (object != null) {
182        return Measure.valueOf(object);
183     }
184     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getHeight(getFacesContext(), this) : Measure.ZERO;
185   }
186 
187   public void setHeight(org.apache.myfaces.tobago.layout.Measure height) {
188     getStateHelper().put(PropertyKeys.height, height);
189   }
190 
191   public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() {
192     Object object = getStateHelper().eval(PropertyKeys.minimumWidth);
193     if (object != null) {
194        return Measure.valueOf(object);
195     }
196     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumWidth(getFacesContext(), this) : Measure.ZERO;
197   }
198 
199   public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) {
200     getStateHelper().put(PropertyKeys.minimumWidth, minimumWidth);
201   }
202 
203   public java.lang.Integer getRowSpan() {
204     Number value  = (Number) getStateHelper().eval(PropertyKeys.rowSpan);
205     if (value != null) {
206       return value.intValue();
207     }
208     return 1;
209   }
210 
211   public void setRowSpan(java.lang.Integer rowSpan) {
212     getStateHelper().put(PropertyKeys.rowSpan, rowSpan);
213   }
214 
215   /**
216   This value will usually be set by the layout manager.
217 
218   */
219   public org.apache.myfaces.tobago.layout.Measure getLeft() {
220     Object object = getStateHelper().eval(PropertyKeys.left);
221     if (object != null) {
222        return Measure.valueOf(object);
223     }
224     return null;
225   }
226 
227   public void setLeft(org.apache.myfaces.tobago.layout.Measure left) {
228     getStateHelper().put(PropertyKeys.left, left);
229   }
230 
231   /**
232   Flag indicating this component should receive the focus.
233   <br />Default: <code>false</code>
234   */
235   public boolean isFocus() {
236     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.focus);
237     if (bool != null) {
238       return bool;
239     }
240     return false;
241   }
242 
243   public void setFocus(boolean focus) {
244     getStateHelper().put(PropertyKeys.focus, focus);
245   }
246 
247   public java.lang.Integer getColumnSpan() {
248     Number value  = (Number) getStateHelper().eval(PropertyKeys.columnSpan);
249     if (value != null) {
250       return value.intValue();
251     }
252     return 1;
253   }
254 
255   public void setColumnSpan(java.lang.Integer columnSpan) {
256     getStateHelper().put(PropertyKeys.columnSpan, columnSpan);
257   }
258 
259   /**
260   A localized user presentable label for the right select box.
261 
262   */
263   public java.lang.String getSelectedLabel() {
264     return (java.lang.String) getStateHelper().eval(PropertyKeys.selectedLabel);
265   }
266 
267   public void setSelectedLabel(java.lang.String selectedLabel) {
268     getStateHelper().put(PropertyKeys.selectedLabel, selectedLabel);
269   }
270 
271   /**
272   This value will usually be set by the layout manager.
273 
274   */
275   public org.apache.myfaces.tobago.layout.Measure getTop() {
276     Object object = getStateHelper().eval(PropertyKeys.top);
277     if (object != null) {
278        return Measure.valueOf(object);
279     }
280     return null;
281   }
282 
283   public void setTop(org.apache.myfaces.tobago.layout.Measure top) {
284     getStateHelper().put(PropertyKeys.top, top);
285   }
286 
287   public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() {
288     Object object = getStateHelper().eval(PropertyKeys.maximumHeight);
289     if (object != null) {
290        return Measure.valueOf(object);
291     }
292     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this) : Measure.ZERO;
293   }
294 
295   public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) {
296     getStateHelper().put(PropertyKeys.maximumHeight, maximumHeight);
297   }
298 
299   /**
300   This value will usually be set by the layout manager. It holds the current width computed by the layout manager.
301 
302   */
303   public org.apache.myfaces.tobago.layout.Measure getCurrentWidth() {
304     Object object = getStateHelper().eval(PropertyKeys.currentWidth);
305     if (object != null) {
306        return Measure.valueOf(object);
307     }
308     return getWidth();
309   }
310 
311   public void setCurrentWidth(org.apache.myfaces.tobago.layout.Measure currentWidth) {
312     getStateHelper().put(PropertyKeys.currentWidth, currentWidth);
313   }
314 
315   public org.apache.myfaces.tobago.layout.Measure getMarginTop() {
316     Object object = getStateHelper().eval(PropertyKeys.marginTop);
317     if (object != null) {
318        return Measure.valueOf(object);
319     }
320     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this) : Measure.ZERO;
321   }
322 
323   public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) {
324     getStateHelper().put(PropertyKeys.marginTop, marginTop);
325   }
326 
327   /**
328   This value will usually be set by the layout manager.
329 
330   */
331   public org.apache.myfaces.tobago.layout.Measure getWidth() {
332     Object object = getStateHelper().eval(PropertyKeys.width);
333     if (object != null) {
334        return Measure.valueOf(object);
335     }
336     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getWidth(getFacesContext(), this) : Measure.ZERO;
337   }
338 
339   public void setWidth(org.apache.myfaces.tobago.layout.Measure width) {
340     getStateHelper().put(PropertyKeys.width, width);
341   }
342 
343   public org.apache.myfaces.tobago.layout.Measure getMarginRight() {
344     Object object = getStateHelper().eval(PropertyKeys.marginRight);
345     if (object != null) {
346        return Measure.valueOf(object);
347     }
348     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this) : Measure.ZERO;
349   }
350 
351   public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) {
352     getStateHelper().put(PropertyKeys.marginRight, marginRight);
353   }
354 
355   /**
356   This value will usually be set by the layout manager. It holds the current height computed by the layout manager.
357 
358   */
359   public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() {
360     Object object = getStateHelper().eval(PropertyKeys.currentHeight);
361     if (object != null) {
362        return Measure.valueOf(object);
363     }
364     return getHeight();
365   }
366 
367   public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) {
368     getStateHelper().put(PropertyKeys.currentHeight, currentHeight);
369   }
370 
371   public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() {
372     Object object = getStateHelper().eval(PropertyKeys.preferredHeight);
373     if (object != null) {
374        return Measure.valueOf(object);
375     }
376     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this) : Measure.ZERO;
377   }
378 
379   public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) {
380     getStateHelper().put(PropertyKeys.preferredHeight, preferredHeight);
381   }
382 
383   /**
384   This attribute is for internal use only.
385 
386   */
387   public org.apache.myfaces.tobago.layout.Display getDisplay() {
388     return (org.apache.myfaces.tobago.layout.Display) getStateHelper().eval(PropertyKeys.display);
389   }
390 
391   public void setDisplay(org.apache.myfaces.tobago.layout.Display display) {
392     getStateHelper().put(PropertyKeys.display, display);
393   }
394 
395   /**
396   A localized user presentable name for this component.
397 
398   */
399   public java.lang.String getLabel() {
400     return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
401   }
402 
403   public void setLabel(java.lang.String label) {
404     getStateHelper().put(PropertyKeys.label, label);
405   }
406 
407   public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() {
408     Object object = getStateHelper().eval(PropertyKeys.maximumWidth);
409     if (object != null) {
410        return Measure.valueOf(object);
411     }
412     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this) : Measure.ZERO;
413   }
414 
415   public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) {
416     getStateHelper().put(PropertyKeys.maximumWidth, maximumWidth);
417   }
418 
419   /**
420   Client side script function to add to this component's onchange handler.
421 
422   @deprecated*/
423   @Deprecated
424   public java.lang.String getOnchange() {
425     return (java.lang.String) getStateHelper().eval(PropertyKeys.onchange);
426   }
427 
428   @Deprecated
429   public void setOnchange(java.lang.String onchange) {
430       Deprecation.LOG.error("The attribute 'onchange' of 'UISelectManyShuttle' is deprecated. "
431           + "Please refer the documentation for further information.");
432     getStateHelper().put(PropertyKeys.onchange, onchange);
433   }
434 
435   public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() {
436     Object object = getStateHelper().eval(PropertyKeys.preferredWidth);
437     if (object != null) {
438        return Measure.valueOf(object);
439     }
440     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this) : Measure.ZERO;
441   }
442 
443   public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) {
444     getStateHelper().put(PropertyKeys.preferredWidth, preferredWidth);
445   }
446 
447   public org.apache.myfaces.tobago.layout.Measure getMarginBottom() {
448     Object object = getStateHelper().eval(PropertyKeys.marginBottom);
449     if (object != null) {
450        return Measure.valueOf(object);
451     }
452     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this) : Measure.ZERO;
453   }
454 
455   public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) {
456     getStateHelper().put(PropertyKeys.marginBottom, marginBottom);
457   }
458 
459   /**
460   This attribute is for internal use only.
461 
462   */
463   public java.lang.Integer getVerticalIndex() {
464     Number value  = (Number) getStateHelper().eval(PropertyKeys.verticalIndex);
465     if (value != null) {
466       return value.intValue();
467     }
468     return null;
469   }
470 
471   public void setVerticalIndex(java.lang.Integer verticalIndex) {
472     getStateHelper().put(PropertyKeys.verticalIndex, verticalIndex);
473   }
474 
475   public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
476     if (currentMarkup != null) {
477       return currentMarkup;
478     }
479     return null;
480   }
481 
482   public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
483     this.currentMarkup = currentMarkup;
484   }
485 
486   /**
487   This attribute is for internal use only.
488 
489   */
490   public java.lang.Integer getHorizontalIndex() {
491     Number value  = (Number) getStateHelper().eval(PropertyKeys.horizontalIndex);
492     if (value != null) {
493       return value.intValue();
494     }
495     return null;
496   }
497 
498   public void setHorizontalIndex(java.lang.Integer horizontalIndex) {
499     getStateHelper().put(PropertyKeys.horizontalIndex, horizontalIndex);
500   }
501 
502   /**
503   Flag indicating that this component will prohibit changes by the user.
504   <br />Default: <code>false</code>
505   */
506   public boolean isReadonly() {
507     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.readonly);
508     if (bool != null) {
509       return bool;
510     }
511     return false;
512   }
513 
514   public void setReadonly(boolean readonly) {
515     getStateHelper().put(PropertyKeys.readonly, readonly);
516   }
517 
518   /**
519   Flag indicating that this element is disabled.
520   <br />Default: <code>false</code>
521   */
522   public boolean isDisabled() {
523     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
524     if (bool != null) {
525       return bool;
526     }
527     return false;
528   }
529 
530   public void setDisabled(boolean disabled) {
531     getStateHelper().put(PropertyKeys.disabled, disabled);
532   }
533 
534   public Object saveState(FacesContext context) {
535     currentMarkup = null;
536     return super.saveState(context);
537   }
538 
539 }