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.internal.component.AbstractUISelectItems;
24  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
25  import org.apache.myfaces.tobago.internal.util.StringUtils;
26  import org.apache.myfaces.tobago.internal.util.Deprecation;
27  import javax.annotation.Generated;
28  import javax.el.ELException;
29  import javax.faces.FacesException;
30  import java.util.Arrays;
31  import java.util.ArrayList;
32  import java.util.Collection;
33  import java.util.List;
34  import javax.el.MethodExpression;
35  import javax.el.ValueExpression;
36  
37  /** 
38   Add a child UISelectItems component to the UIComponent
39    associated with the closed parent UIComponent custom
40    action.
41    * UIComponent class, generated from template {@code component.stg} with class
42    * {@link org.apache.myfaces.tobago.internal.taglib.component.SelectItemsTagDeclaration}.
43   */
44  @Generated("component.stg")
45  public class UISelectItems
46      extends AbstractUISelectItems  {
47  
48    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.SelectItems";
49  
50    public static final String COMPONENT_FAMILY = "";
51  
52  
53    enum PropertyKeys {
54      itemDisabled,
55      var,
56      itemValue,
57      tip,
58      itemLabel,
59      itemImage,
60    }
61  
62    public String getFamily() {
63      return COMPONENT_FAMILY;
64    }
65  
66  
67    /**
68    Flag indicating whether the option created
69     by this component is disabled.
70    <br>Default: <code>false</code>
71    */
72    public boolean isItemDisabled() {
73      Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.itemDisabled);
74      if (bool != null) {
75        return bool;
76      }
77      return false;
78    }
79  
80    public void setItemDisabled(boolean itemDisabled) {
81      getStateHelper().put(PropertyKeys.itemDisabled, itemDisabled);
82    }
83  
84    /**
85    Name of a variable under which the iterated data will be exposed.
86     It may be referred to in EL of other attributes.
87  
88    */
89    public java.lang.String getVar() {
90      return (java.lang.String) getStateHelper().eval(PropertyKeys.var);
91    }
92  
93    public void setVar(java.lang.String var) {
94      getStateHelper().put(PropertyKeys.var, var);
95    }
96  
97    /**
98    Value to be returned to the server if this option is selected by the user.
99  
100   */
101   public java.lang.Object getItemValue() {
102     return getStateHelper().eval(PropertyKeys.itemValue);
103   }
104 
105   public void setItemValue(java.lang.Object itemValue) {
106     getStateHelper().put(PropertyKeys.itemValue, itemValue);
107   }
108 
109   /**
110   Text value to display as tooltip.
111 
112   */
113   public java.lang.String getTip() {
114     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
115   }
116 
117   public void setTip(java.lang.String tip) {
118     getStateHelper().put(PropertyKeys.tip, tip);
119   }
120 
121   /**
122   Label to be displayed to the user for this option.
123 
124   */
125   public java.lang.String getItemLabel() {
126     return (java.lang.String) getStateHelper().eval(PropertyKeys.itemLabel);
127   }
128 
129   public void setItemLabel(java.lang.String itemLabel) {
130     getStateHelper().put(PropertyKeys.itemLabel, itemLabel);
131   }
132 
133   /**
134   Image to be displayed to the user for this option.
135 
136   */
137   public java.lang.String getItemImage() {
138     return (java.lang.String) getStateHelper().eval(PropertyKeys.itemImage);
139   }
140 
141   public void setItemImage(java.lang.String itemImage) {
142     getStateHelper().put(PropertyKeys.itemImage, itemImage);
143   }
144 
145 
146   @Override
147   public void restoreState(FacesContext context, Object state) {
148     // FIXME HACK for mojarra SystemEventListener state restoring bug
149     pushComponentToEL(context, this);
150     super.restoreState(context, state);
151     popComponentFromEL(context);
152   }
153 
154 }