1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
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 | |
|
24 | |
|
25 | |
|
26 | |
public class HtmlPanelGroup extends UIPanel { |
27 | |
|
28 | |
public static final String COMPONENT_TYPE = "javax.faces.HtmlPanelGroup"; |
29 | |
|
30 | |
private static final String DEFAULT_RENDERER_TYPE = "javax.faces.Group"; |
31 | |
|
32 | 108 | private String style = null; |
33 | |
|
34 | 108 | private String styleClass = null; |
35 | |
|
36 | 108 | public HtmlPanelGroup() { |
37 | 108 | setRendererType(DEFAULT_RENDERER_TYPE); |
38 | 108 | } |
39 | |
|
40 | |
public void setStyle(String style) { |
41 | 4 | this.style = style; |
42 | 4 | } |
43 | |
|
44 | |
public String getStyle() { |
45 | 45 | if (style != null) { |
46 | 6 | return style; |
47 | |
} |
48 | 39 | ValueBinding vb = getValueBinding("style"); |
49 | 39 | return vb != null ? (String) vb.getValue(getFacesContext()) : null; |
50 | |
} |
51 | |
|
52 | |
public void setStyleClass(String styleClass) { |
53 | 4 | this.styleClass = styleClass; |
54 | 4 | } |
55 | |
|
56 | |
public String getStyleClass() { |
57 | 49 | if (styleClass != null) { |
58 | 8 | return styleClass; |
59 | |
} |
60 | 41 | ValueBinding vb = getValueBinding("styleClass"); |
61 | 41 | return vb != null ? (String) vb.getValue(getFacesContext()) : null; |
62 | |
} |
63 | |
|
64 | |
public Object saveState(FacesContext context) { |
65 | 3 | Object values[] = new Object[3]; |
66 | 3 | values[0] = super.saveState(context); |
67 | 3 | values[1] = style; |
68 | 3 | values[2] = styleClass; |
69 | 3 | return ((Object) (values)); |
70 | |
} |
71 | |
|
72 | |
public void restoreState(FacesContext context, Object state) { |
73 | 2 | Object values[] = (Object[]) state; |
74 | 2 | super.restoreState(context, values[0]); |
75 | 2 | style = (String) values[1]; |
76 | 2 | styleClass = (String) values[2]; |
77 | 2 | } |
78 | |
} |