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