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