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.AbstractUIPanel;
25  import org.apache.myfaces.tobago.model.CollapseMode;
26  import org.apache.myfaces.tobago.renderkit.css.CustomClass;
27  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
28  import org.apache.myfaces.tobago.internal.util.StringUtils;
29  import org.apache.myfaces.tobago.internal.util.Deprecation;
30  import org.apache.myfaces.tobago.component.Tags;
31  import javax.annotation.Generated;
32  import javax.el.ELException;
33  import javax.faces.FacesException;
34  import java.util.Arrays;
35  import java.util.ArrayList;
36  import java.util.Collection;
37  import java.util.List;
38  import javax.el.MethodExpression;
39  import javax.el.ValueExpression;
40  
41  /**
42   Intended for use in situations when only one UIComponent child can be
43    nested, such as in the case of facets.
44    * UIComponent class, generated from template {@code component.stg} with class
45    * {@link org.apache.myfaces.tobago.internal.taglib.component.PanelTagDeclaration}.
46   */
47  @Generated("component.stg")
48  public class UIPanel
49      extends AbstractUIPanel  {
50  
51    public static final String COMPONENT_TYPE = Tags.panel.componentType();
52  
53    public static final String COMPONENT_FAMILY = "javax.faces.Panel";
54  
55    private static final Collection<String> EVENT_NAMES = Arrays.asList("click", "dblclick", "mouseover", "mouseout");
56  
57    @Override
58    public Collection<String> getEventNames() {
59      return EVENT_NAMES;
60    }
61  
62    @Override
63    public String getDefaultEventName() {
64      return "click";
65    }
66  
67  
68    enum PropertyKeys {
69      markup,
70      collapsed,
71      customClass,
72      tip,
73      collapsedMode,
74    }
75  
76    public String getFamily() {
77      return COMPONENT_FAMILY;
78    }
79  
80  
81    public org.apache.myfaces.tobago.context.Markup getMarkup() {
82      Object object = getStateHelper().eval(PropertyKeys.markup);
83      if (object != null) {
84        return Markup.valueOf(object);
85      }
86      return null;
87    }
88  
89    public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
90      getStateHelper().put(PropertyKeys.markup, markup);
91    }
92  
93    /**
94    Indicating the collapsed state of this component.
95    <br>Default: <code>false</code>
96    */
97    public boolean isCollapsed() {
98      Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.collapsed);
99      if (bool != null) {
100       return bool;
101     }
102     return false;
103   }
104 
105   public void setCollapsed(boolean collapsed) {
106     getStateHelper().put(PropertyKeys.collapsed, collapsed);
107   }
108 
109   /**
110   Sets a CSS class in its parent, if the parent supports it.
111 
112    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
113 
114    <pre>
115    &lt;tc:in&gt;
116      &lt;tc:style customClass="my-emphasized"/&gt;
117    &lt;/tc:in&gt;
118    </pre>
119 
120    One capability is, to used external CSS libs.
121    <br>
122    This feature should not be used imprudent.
123    Because it might be unstable against changes in the renderered HTML code.
124 
125   */
126   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
127     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
128   }
129 
130   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
131     getStateHelper().put(PropertyKeys.customClass, customClass);
132   }
133 
134   /**
135   Text value to display as tooltip.
136 
137   */
138   public java.lang.String getTip() {
139     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
140   }
141 
142   public void setTip(java.lang.String tip) {
143     getStateHelper().put(PropertyKeys.tip, tip);
144   }
145 
146   /**
147   Enum indicating the mode of the collapsed state of this component.
148   <br>Default: <code>none</code>
149   */
150   public org.apache.myfaces.tobago.model.CollapseMode getCollapsedMode() {
151     org.apache.myfaces.tobago.model.CollapseMode collapsedMode = (org.apache.myfaces.tobago.model.CollapseMode) getStateHelper().eval(PropertyKeys.collapsedMode);
152     if (collapsedMode != null) {
153       return collapsedMode;
154     }
155     return org.apache.myfaces.tobago.model.CollapseMode.none;
156   }
157 
158   public void setCollapsedMode(org.apache.myfaces.tobago.model.CollapseMode collapsedMode) {
159     getStateHelper().put(PropertyKeys.collapsedMode, collapsedMode);
160   }
161 
162 
163   @Override
164   public void restoreState(FacesContext context, Object state) {
165     // FIXME HACK for mojarra SystemEventListener state restoring bug
166     pushComponentToEL(context, this);
167     super.restoreState(context, state);
168     popComponentFromEL(context);
169   }
170 
171 }