KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > faces > component > html > HtmlPanelGroup


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package javax.faces.component.html;
17
18 import javax.faces.component.UIPanel;
19 import javax.faces.context.FacesContext;
20 import javax.faces.el.ValueBinding;
21
22 /**
23  * @author Thomas Spiegl (latest modification by $Author: mwessendorf $)
24  * @version $Revision: 1.2 $ $Date: 2004/07/01 22:01:16 $
25  */

26 public class HtmlPanelGroup extends UIPanel
27 {
28     //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
29

30     public static final String JavaDoc COMPONENT_TYPE = "javax.faces.HtmlPanelGroup";
31     private static final String JavaDoc DEFAULT_RENDERER_TYPE = "javax.faces.Group";
32
33     private String JavaDoc _style = null;
34     private String JavaDoc _styleClass = null;
35
36     public HtmlPanelGroup()
37     {
38         setRendererType(DEFAULT_RENDERER_TYPE);
39     }
40
41
42     public void setStyle(String JavaDoc style)
43     {
44         _style = style;
45     }
46
47     public String JavaDoc getStyle()
48     {
49         if (_style != null) return _style;
50         ValueBinding vb = getValueBinding("style");
51         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
52     }
53
54     public void setStyleClass(String JavaDoc styleClass)
55     {
56         _styleClass = styleClass;
57     }
58
59     public String JavaDoc getStyleClass()
60     {
61         if (_styleClass != null) return _styleClass;
62         ValueBinding vb = getValueBinding("styleClass");
63         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
64     }
65
66
67     public Object JavaDoc saveState(FacesContext context)
68     {
69         Object JavaDoc values[] = new Object JavaDoc[3];
70         values[0] = super.saveState(context);
71         values[1] = _style;
72         values[2] = _styleClass;
73         return ((Object JavaDoc) (values));
74     }
75
76     public void restoreState(FacesContext context, Object JavaDoc state)
77     {
78         Object JavaDoc values[] = (Object JavaDoc[])state;
79         super.restoreState(context, values[0]);
80         _style = (String JavaDoc)values[1];
81         _styleClass = (String JavaDoc)values[2];
82     }
83     //------------------ GENERATED CODE END ---------------------------------------
84
}
85
Popular Tags