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.component.NamingContainer;
23  import javax.faces.context.FacesContext;
24  import org.apache.myfaces.tobago.context.Markup;
25  import org.apache.myfaces.tobago.internal.component.AbstractUITab;
26  import org.apache.myfaces.tobago.renderkit.css.CustomClass;
27  import org.apache.myfaces.tobago.renderkit.css.Style;
28  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
29  import org.apache.myfaces.tobago.internal.util.StringUtils;
30  import org.apache.myfaces.tobago.internal.util.Deprecation;
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  public class UITab
46      extends AbstractUITab implements NamingContainer, SupportsAccessKey, Visual {
47  
48    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Tab";
49  
50    public static final String COMPONENT_FAMILY = "javax.faces.Panel";
51  
52    private static final Collection<String> EVENT_NAMES = Arrays.asList("click");
53  
54    @Override
55    public Collection<String> getEventNames() {
56      return EVENT_NAMES;
57    }
58  
59    @Override
60    public String getDefaultEventName() {
61      return "click";
62    }
63  
64  
65    enum PropertyKeys {
66      image,
67      markup,
68      accessKey,
69      customClass,
70      style,
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   For internal use. Used for rendering, if there is a child tag &lt;tc:style&gt;
144 
145   */
146   public org.apache.myfaces.tobago.renderkit.css.Style getStyle() {
147     return (org.apache.myfaces.tobago.renderkit.css.Style) getStateHelper().eval(PropertyKeys.style);
148   }
149 
150   public void setStyle(org.apache.myfaces.tobago.renderkit.css.Style style) {
151     getStateHelper().put(PropertyKeys.style, style);
152   }
153 
154   /**
155   Text value to display as tooltip.
156 
157   */
158   public java.lang.String getTip() {
159     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
160   }
161 
162   public void setTip(java.lang.String tip) {
163     getStateHelper().put(PropertyKeys.tip, tip);
164   }
165 
166   /**
167   Flag indicating that this element is disabled.
168   <br>Default: <code>false</code>
169   */
170   public boolean isDisabled() {
171     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
172     if (bool != null) {
173       return bool;
174     }
175     return false;
176   }
177 
178   public void setDisabled(boolean disabled) {
179     getStateHelper().put(PropertyKeys.disabled, disabled);
180   }
181 
182   /**
183   A localized user presentable label for this component.
184 
185   */
186   public java.lang.String getLabel() {
187     return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
188   }
189 
190   public void setLabel(java.lang.String label) {
191     getStateHelper().put(PropertyKeys.label, label);
192   }
193 
194 
195 }