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