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.AbstractUITab;
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 org.apache.myfaces.tobago.component.Tags;
30  import javax.annotation.Generated;
31  import javax.el.ELException;
32  import javax.faces.FacesException;
33  import java.util.Arrays;
34  import java.util.ArrayList;
35  import java.util.Collection;
36  import java.util.List;
37  import javax.el.MethodExpression;
38  import javax.el.ValueExpression;
39  
40  /**
41   Renders a tab within a tab group.
42    * UIComponent class, generated from template {@code component.stg} with class
43    * {@link org.apache.myfaces.tobago.internal.taglib.component.TabTagDeclaration}.
44   */
45  @Generated("component.stg")
46  public class UITab
47      extends AbstractUITab  {
48  
49    public static final String COMPONENT_TYPE = Tags.tab.componentType();
50  
51    public static final String COMPONENT_FAMILY = "javax.faces.Panel";
52  
53    private static final Collection<String> EVENT_NAMES = Arrays.asList("click");
54  
55    @Override
56    public Collection<String> getEventNames() {
57      return EVENT_NAMES;
58    }
59  
60    @Override
61    public String getDefaultEventName() {
62      return "click";
63    }
64  
65  
66    enum PropertyKeys {
67      image,
68      markup,
69      accessKey,
70      customClass,
71      tip,
72      disabled,
73      label,
74    }
75  
76    public String getFamily() {
77      return COMPONENT_FAMILY;
78    }
79  
80  
81    /**
82    Url to an image to display.
83  
84    */
85    public java.lang.String getImage() {
86      return (java.lang.String) getStateHelper().eval(PropertyKeys.image);
87    }
88  
89    public void setImage(java.lang.String image) {
90      getStateHelper().put(PropertyKeys.image, image);
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   /**
106   The access key of this control.
107 
108   */
109   public java.lang.Character getAccessKey() {
110     return (java.lang.Character) getStateHelper().eval(PropertyKeys.accessKey);
111   }
112 
113   public void setAccessKey(java.lang.Character accessKey) {
114     getStateHelper().put(PropertyKeys.accessKey, accessKey);
115   }
116 
117   /**
118   Sets a CSS class in its parent, if the parent supports it.
119 
120    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
121 
122    <pre>
123    &lt;tc:in&gt;
124      &lt;tc:style customClass="my-emphasized"/&gt;
125    &lt;/tc:in&gt;
126    </pre>
127 
128    One capability is, to used external CSS libs.
129    <br>
130    This feature should not be used imprudent.
131    Because it might be unstable against changes in the renderered HTML code.
132 
133   */
134   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
135     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
136   }
137 
138   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
139     getStateHelper().put(PropertyKeys.customClass, customClass);
140   }
141 
142   /**
143   Text value to display as tooltip.
144 
145   */
146   public java.lang.String getTip() {
147     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
148   }
149 
150   public void setTip(java.lang.String tip) {
151     getStateHelper().put(PropertyKeys.tip, tip);
152   }
153 
154   /**
155   Flag indicating that this element is disabled.
156   <br>Default: <code>false</code>
157   */
158   public boolean isDisabled() {
159     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
160     if (bool != null) {
161       return bool;
162     }
163     return false;
164   }
165 
166   public void setDisabled(boolean disabled) {
167     getStateHelper().put(PropertyKeys.disabled, disabled);
168   }
169 
170   /**
171   A localized user presentable label for this component.
172 
173   */
174   public java.lang.String getLabel() {
175     return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
176   }
177 
178   public void setLabel(java.lang.String label) {
179     getStateHelper().put(PropertyKeys.label, label);
180   }
181 
182 
183   @Override
184   public void restoreState(FacesContext context, Object state) {
185     // FIXME HACK for mojarra SystemEventListener state restoring bug
186     pushComponentToEL(context, this);
187     super.restoreState(context, state);
188     popComponentFromEL(context);
189   }
190 
191 }