1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
package javax.faces.component; |
20 | |
|
21 | |
import javax.el.ValueExpression; |
22 | |
import javax.faces.context.FacesContext; |
23 | |
import javax.faces.component.UIComponent; |
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
public class UIMessages extends javax.faces.component.UIComponentBase |
31 | |
{ |
32 | |
|
33 | |
static public final String COMPONENT_FAMILY = |
34 | |
"javax.faces.Messages"; |
35 | |
static public final String COMPONENT_TYPE = |
36 | |
"javax.faces.Messages"; |
37 | |
|
38 | |
|
39 | |
public UIMessages() |
40 | 0 | { |
41 | 0 | setRendererType("javax.faces.Messages"); |
42 | 0 | } |
43 | |
|
44 | |
@Override |
45 | |
public String getFamily() |
46 | |
{ |
47 | 0 | return COMPONENT_FAMILY; |
48 | |
} |
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | |
public boolean isGlobalOnly() |
56 | |
{ |
57 | 0 | return (Boolean) getStateHelper().eval(PropertyKeys.globalOnly, false); |
58 | |
} |
59 | |
|
60 | |
public void setGlobalOnly(boolean globalOnly) |
61 | |
{ |
62 | 0 | getStateHelper().put(PropertyKeys.globalOnly, globalOnly ); |
63 | 0 | } |
64 | |
|
65 | |
|
66 | |
public boolean isShowDetail() |
67 | |
{ |
68 | 0 | return (Boolean) getStateHelper().eval(PropertyKeys.showDetail, false); |
69 | |
} |
70 | |
|
71 | |
public void setShowDetail(boolean showDetail) |
72 | |
{ |
73 | 0 | getStateHelper().put(PropertyKeys.showDetail, showDetail ); |
74 | 0 | } |
75 | |
|
76 | |
|
77 | |
public boolean isShowSummary() |
78 | |
{ |
79 | 0 | return (Boolean) getStateHelper().eval(PropertyKeys.showSummary, true); |
80 | |
} |
81 | |
|
82 | |
public void setShowSummary(boolean showSummary) |
83 | |
{ |
84 | 0 | getStateHelper().put(PropertyKeys.showSummary, showSummary ); |
85 | 0 | } |
86 | |
|
87 | |
|
88 | |
public boolean isRedisplay() |
89 | |
{ |
90 | 0 | return (Boolean) getStateHelper().eval(PropertyKeys.redisplay, true); |
91 | |
} |
92 | |
|
93 | |
public void setRedisplay(boolean redisplay) |
94 | |
{ |
95 | 0 | getStateHelper().put(PropertyKeys.redisplay, redisplay ); |
96 | 0 | } |
97 | |
|
98 | |
|
99 | |
public String getFor() |
100 | |
{ |
101 | 0 | return (String) getStateHelper().eval(PropertyKeys.forVal); |
102 | |
} |
103 | |
|
104 | |
public void setFor(String forParam) |
105 | |
{ |
106 | 0 | getStateHelper().put(PropertyKeys.forVal, forParam ); |
107 | 0 | } |
108 | |
|
109 | 0 | enum PropertyKeys |
110 | |
{ |
111 | 0 | globalOnly |
112 | 0 | , showDetail |
113 | 0 | , showSummary |
114 | 0 | , redisplay |
115 | 0 | , forVal("for") |
116 | |
; |
117 | |
String c; |
118 | |
|
119 | |
PropertyKeys() |
120 | 0 | { |
121 | 0 | } |
122 | |
|
123 | |
|
124 | |
PropertyKeys(String c) |
125 | 0 | { |
126 | 0 | this.c = c; |
127 | 0 | } |
128 | |
|
129 | |
public String toString() |
130 | |
{ |
131 | 0 | return ((this.c != null) ? this.c : super.toString()); |
132 | |
} |
133 | |
} |
134 | |
|
135 | |
} |