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.internal.taglib;
21  
22  import javax.faces.application.Application;
23  import javax.faces.component.UIComponent;
24  import javax.faces.context.FacesContext;
25  import org.apache.myfaces.tobago.component.UITab;
26  import org.apache.myfaces.tobago.internal.util.StringUtils;
27  import org.slf4j.Logger;
28  import org.slf4j.LoggerFactory;
29  
30  /** 
31   * JSP Tag class, generated from template {@code tag1.2.stg} with class 
32   * {@link org.apache.myfaces.tobago.internal.taglib.component.TabTagDeclaration}.
33   */
34  public final class TabTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(TabTag.class);
36    private javax.el.ValueExpression  markup;
37    private javax.el.ValueExpression  accessKey;
38    private javax.el.ValueExpression  tip;
39    private javax.el.ValueExpression  image;
40    private javax.el.ValueExpression  label;
41    private javax.el.ValueExpression  disabled;
42  
43    @Override
44    public String getComponentType() {
45      return UITab.COMPONENT_TYPE;
46    }
47    @Override
48    public String getRendererType() {
49      return "Tab";
50    }
51  
52    @Override
53    protected void setProperties(final UIComponent uiComponent) {
54      super.setProperties(uiComponent);
55      final UITab component = (UITab) uiComponent;
56      final FacesContext context = FacesContext.getCurrentInstance();
57      final Application application = context.getApplication();
58      if (markup != null) {
59        if (!markup.isLiteralText()) {
60          component.setValueExpression("markup", markup);
61        } else {
62          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
63        }
64      }
65      if (accessKey != null) {
66        if (!accessKey.isLiteralText()) {
67          component.setValueExpression("accessKey", accessKey);
68        } else {
69          component.setAccessKey(accessKey.getExpressionString().charAt(0));
70        }
71      }
72      if (tip != null) {
73        component.setValueExpression("tip", tip);
74      }
75  
76      if (image != null) {
77        component.setValueExpression("image", image);
78      }
79  
80      if (label != null) {
81        component.setValueExpression("label", label);
82      }
83  
84      if (disabled != null) {
85        if (!disabled.isLiteralText()) {
86          component.setValueExpression("disabled", disabled);
87        } else {
88          component.setDisabled(Boolean.parseBoolean(disabled.getExpressionString()));
89        }
90      }
91    }
92  
93    public javax.el.ValueExpression getMarkup() {
94      return markup;
95    }
96  
97    public void setMarkup(final javax.el.ValueExpression markup) {
98      this.markup = markup;
99    }
100 
101   public javax.el.ValueExpression getAccessKey() {
102     return accessKey;
103   }
104 
105   public void setAccessKey(final javax.el.ValueExpression accessKey) {
106     this.accessKey = accessKey;
107   }
108 
109   public javax.el.ValueExpression getTip() {
110     return tip;
111   }
112 
113   public void setTip(final javax.el.ValueExpression tip) {
114     this.tip = tip;
115   }
116 
117   public javax.el.ValueExpression getImage() {
118     return image;
119   }
120 
121   public void setImage(final javax.el.ValueExpression image) {
122     this.image = image;
123   }
124 
125   public javax.el.ValueExpression getLabel() {
126     return label;
127   }
128 
129   public void setLabel(final javax.el.ValueExpression label) {
130     this.label = label;
131   }
132 
133   public javax.el.ValueExpression getDisabled() {
134     return disabled;
135   }
136 
137   public void setDisabled(final javax.el.ValueExpression disabled) {
138     this.disabled = disabled;
139   }
140 
141 
142 
143   @Override
144   public void release() {
145     super.release();
146     markup = null;
147     accessKey = null;
148     tip = null;
149     image = null;
150     label = null;
151     disabled = null;
152   }
153 }