1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
package javax.faces.component.html; |
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 HtmlMessage extends javax.faces.component.UIMessage |
31 | |
{ |
32 | |
|
33 | |
static public final String COMPONENT_FAMILY = |
34 | |
"javax.faces.Message"; |
35 | |
static public final String COMPONENT_TYPE = |
36 | |
"javax.faces.HtmlMessage"; |
37 | |
|
38 | |
|
39 | |
public HtmlMessage() |
40 | 0 | { |
41 | 0 | setRendererType("javax.faces.Message"); |
42 | 0 | } |
43 | |
|
44 | |
@Override |
45 | |
public String getFamily() |
46 | |
{ |
47 | 0 | return COMPONENT_FAMILY; |
48 | |
} |
49 | |
|
50 | |
|
51 | |
|
52 | |
private String _style; |
53 | |
|
54 | |
public String getStyle() |
55 | |
{ |
56 | 0 | if (_style != null) |
57 | |
{ |
58 | 0 | return _style; |
59 | |
} |
60 | 0 | ValueExpression vb = getValueExpression("style"); |
61 | 0 | if (vb != null) |
62 | |
{ |
63 | 0 | return (String) vb.getValue(getFacesContext().getELContext()); |
64 | |
} |
65 | 0 | return null; |
66 | |
} |
67 | |
|
68 | |
public void setStyle(String style) |
69 | |
{ |
70 | 0 | this._style = style; |
71 | 0 | } |
72 | |
|
73 | |
private String _styleClass; |
74 | |
|
75 | |
public String getStyleClass() |
76 | |
{ |
77 | 0 | if (_styleClass != null) |
78 | |
{ |
79 | 0 | return _styleClass; |
80 | |
} |
81 | 0 | ValueExpression vb = getValueExpression("styleClass"); |
82 | 0 | if (vb != null) |
83 | |
{ |
84 | 0 | return (String) vb.getValue(getFacesContext().getELContext()); |
85 | |
} |
86 | 0 | return null; |
87 | |
} |
88 | |
|
89 | |
public void setStyleClass(String styleClass) |
90 | |
{ |
91 | 0 | this._styleClass = styleClass; |
92 | 0 | } |
93 | |
|
94 | |
private String _errorClass; |
95 | |
|
96 | |
public String getErrorClass() |
97 | |
{ |
98 | 0 | if (_errorClass != null) |
99 | |
{ |
100 | 0 | return _errorClass; |
101 | |
} |
102 | 0 | ValueExpression vb = getValueExpression("errorClass"); |
103 | 0 | if (vb != null) |
104 | |
{ |
105 | 0 | return (String) vb.getValue(getFacesContext().getELContext()); |
106 | |
} |
107 | 0 | return null; |
108 | |
} |
109 | |
|
110 | |
public void setErrorClass(String errorClass) |
111 | |
{ |
112 | 0 | this._errorClass = errorClass; |
113 | 0 | } |
114 | |
|
115 | |
private String _errorStyle; |
116 | |
|
117 | |
public String getErrorStyle() |
118 | |
{ |
119 | 0 | if (_errorStyle != null) |
120 | |
{ |
121 | 0 | return _errorStyle; |
122 | |
} |
123 | 0 | ValueExpression vb = getValueExpression("errorStyle"); |
124 | 0 | if (vb != null) |
125 | |
{ |
126 | 0 | return (String) vb.getValue(getFacesContext().getELContext()); |
127 | |
} |
128 | 0 | return null; |
129 | |
} |
130 | |
|
131 | |
public void setErrorStyle(String errorStyle) |
132 | |
{ |
133 | 0 | this._errorStyle = errorStyle; |
134 | 0 | } |
135 | |
|
136 | |
private String _fatalClass; |
137 | |
|
138 | |
public String getFatalClass() |
139 | |
{ |
140 | 0 | if (_fatalClass != null) |
141 | |
{ |
142 | 0 | return _fatalClass; |
143 | |
} |
144 | 0 | ValueExpression vb = getValueExpression("fatalClass"); |
145 | 0 | if (vb != null) |
146 | |
{ |
147 | 0 | return (String) vb.getValue(getFacesContext().getELContext()); |
148 | |
} |
149 | 0 | return null; |
150 | |
} |
151 | |
|
152 | |
public void setFatalClass(String fatalClass) |
153 | |
{ |
154 | 0 | this._fatalClass = fatalClass; |
155 | 0 | } |
156 | |
|
157 | |
private String _fatalStyle; |
158 | |
|
159 | |
public String getFatalStyle() |
160 | |
{ |
161 | 0 | if (_fatalStyle != null) |
162 | |
{ |
163 | 0 | return _fatalStyle; |
164 | |
} |
165 | 0 | ValueExpression vb = getValueExpression("fatalStyle"); |
166 | 0 | if (vb != null) |
167 | |
{ |
168 | 0 | return (String) vb.getValue(getFacesContext().getELContext()); |
169 | |
} |
170 | 0 | return null; |
171 | |
} |
172 | |
|
173 | |
public void setFatalStyle(String fatalStyle) |
174 | |
{ |
175 | 0 | this._fatalStyle = fatalStyle; |
176 | 0 | } |
177 | |
|
178 | |
private String _infoClass; |
179 | |
|
180 | |
public String getInfoClass() |
181 | |
{ |
182 | 0 | if (_infoClass != null) |
183 | |
{ |
184 | 0 | return _infoClass; |
185 | |
} |
186 | 0 | ValueExpression vb = getValueExpression("infoClass"); |
187 | 0 | if (vb != null) |
188 | |
{ |
189 | 0 | return (String) vb.getValue(getFacesContext().getELContext()); |
190 | |
} |
191 | 0 | return null; |
192 | |
} |
193 | |
|
194 | |
public void setInfoClass(String infoClass) |
195 | |
{ |
196 | 0 | this._infoClass = infoClass; |
197 | 0 | } |
198 | |
|
199 | |
private String _infoStyle; |
200 | |
|
201 | |
public String getInfoStyle() |
202 | |
{ |
203 | 0 | if (_infoStyle != null) |
204 | |
{ |
205 | 0 | return _infoStyle; |
206 | |
} |
207 | 0 | ValueExpression vb = getValueExpression("infoStyle"); |
208 | 0 | if (vb != null) |
209 | |
{ |
210 | 0 | return (String) vb.getValue(getFacesContext().getELContext()); |
211 | |
} |
212 | 0 | return null; |
213 | |
} |
214 | |
|
215 | |
public void setInfoStyle(String infoStyle) |
216 | |
{ |
217 | 0 | this._infoStyle = infoStyle; |
218 | 0 | } |
219 | |
|
220 | |
private boolean _tooltip; |
221 | |
|
222 | |
private boolean _tooltipSet; |
223 | |
|
224 | |
public boolean isTooltip() |
225 | |
{ |
226 | 0 | if (_tooltipSet) |
227 | |
{ |
228 | 0 | return _tooltip; |
229 | |
} |
230 | 0 | ValueExpression vb = getValueExpression("tooltip"); |
231 | 0 | if (vb != null) |
232 | |
{ |
233 | 0 | return ((Boolean) vb.getValue(getFacesContext().getELContext())).booleanValue(); |
234 | |
} |
235 | 0 | return false; |
236 | |
} |
237 | |
|
238 | |
public void setTooltip(boolean tooltip) |
239 | |
{ |
240 | 0 | this._tooltip = tooltip; |
241 | 0 | this._tooltipSet = true; |
242 | 0 | } |
243 | |
|
244 | |
private String _warnClass; |
245 | |
|
246 | |
public String getWarnClass() |
247 | |
{ |
248 | 0 | if (_warnClass != null) |
249 | |
{ |
250 | 0 | return _warnClass; |
251 | |
} |
252 | 0 | ValueExpression vb = getValueExpression("warnClass"); |
253 | 0 | if (vb != null) |
254 | |
{ |
255 | 0 | return (String) vb.getValue(getFacesContext().getELContext()); |
256 | |
} |
257 | 0 | return null; |
258 | |
} |
259 | |
|
260 | |
public void setWarnClass(String warnClass) |
261 | |
{ |
262 | 0 | this._warnClass = warnClass; |
263 | 0 | } |
264 | |
|
265 | |
private String _warnStyle; |
266 | |
|
267 | |
public String getWarnStyle() |
268 | |
{ |
269 | 0 | if (_warnStyle != null) |
270 | |
{ |
271 | 0 | return _warnStyle; |
272 | |
} |
273 | 0 | ValueExpression vb = getValueExpression("warnStyle"); |
274 | 0 | if (vb != null) |
275 | |
{ |
276 | 0 | return (String) vb.getValue(getFacesContext().getELContext()); |
277 | |
} |
278 | 0 | return null; |
279 | |
} |
280 | |
|
281 | |
public void setWarnStyle(String warnStyle) |
282 | |
{ |
283 | 0 | this._warnStyle = warnStyle; |
284 | 0 | } |
285 | |
|
286 | |
private String _dir; |
287 | |
|
288 | |
public String getDir() |
289 | |
{ |
290 | 0 | if (_dir != null) |
291 | |
{ |
292 | 0 | return _dir; |
293 | |
} |
294 | 0 | ValueExpression vb = getValueExpression("dir"); |
295 | 0 | if (vb != null) |
296 | |
{ |
297 | 0 | return (String) vb.getValue(getFacesContext().getELContext()); |
298 | |
} |
299 | 0 | return null; |
300 | |
} |
301 | |
|
302 | |
public void setDir(String dir) |
303 | |
{ |
304 | 0 | this._dir = dir; |
305 | 0 | } |
306 | |
|
307 | |
private String _lang; |
308 | |
|
309 | |
public String getLang() |
310 | |
{ |
311 | 0 | if (_lang != null) |
312 | |
{ |
313 | 0 | return _lang; |
314 | |
} |
315 | 0 | ValueExpression vb = getValueExpression("lang"); |
316 | 0 | if (vb != null) |
317 | |
{ |
318 | 0 | return (String) vb.getValue(getFacesContext().getELContext()); |
319 | |
} |
320 | 0 | return null; |
321 | |
} |
322 | |
|
323 | |
public void setLang(String lang) |
324 | |
{ |
325 | 0 | this._lang = lang; |
326 | 0 | } |
327 | |
|
328 | |
private String _title; |
329 | |
|
330 | |
public String getTitle() |
331 | |
{ |
332 | 0 | if (_title != null) |
333 | |
{ |
334 | 0 | return _title; |
335 | |
} |
336 | 0 | ValueExpression vb = getValueExpression("title"); |
337 | 0 | if (vb != null) |
338 | |
{ |
339 | 0 | return (String) vb.getValue(getFacesContext().getELContext()); |
340 | |
} |
341 | 0 | return null; |
342 | |
} |
343 | |
|
344 | |
public void setTitle(String title) |
345 | |
{ |
346 | 0 | this._title = title; |
347 | 0 | } |
348 | |
|
349 | |
@Override |
350 | |
public Object saveState(FacesContext facesContext) |
351 | |
{ |
352 | 0 | Object[] values = new Object[16]; |
353 | 0 | values[0] = super.saveState(facesContext); |
354 | 0 | values[1] = _style; |
355 | 0 | values[2] = _styleClass; |
356 | 0 | values[3] = _errorClass; |
357 | 0 | values[4] = _errorStyle; |
358 | 0 | values[5] = _fatalClass; |
359 | 0 | values[6] = _fatalStyle; |
360 | 0 | values[7] = _infoClass; |
361 | 0 | values[8] = _infoStyle; |
362 | 0 | values[9] = Boolean.valueOf(_tooltip); |
363 | 0 | values[10] = Boolean.valueOf(_tooltipSet); |
364 | 0 | values[11] = _warnClass; |
365 | 0 | values[12] = _warnStyle; |
366 | 0 | values[13] = _dir; |
367 | 0 | values[14] = _lang; |
368 | 0 | values[15] = _title; |
369 | 0 | return values; |
370 | |
} |
371 | |
|
372 | |
@Override |
373 | |
public void restoreState(FacesContext facesContext, Object state) |
374 | |
{ |
375 | 0 | Object[] values = (Object[])state; |
376 | 0 | super.restoreState(facesContext,values[0]); |
377 | 0 | _style = (java.lang.String) values[1]; |
378 | 0 | _styleClass = (java.lang.String) values[2]; |
379 | 0 | _errorClass = (java.lang.String) values[3]; |
380 | 0 | _errorStyle = (java.lang.String) values[4]; |
381 | 0 | _fatalClass = (java.lang.String) values[5]; |
382 | 0 | _fatalStyle = (java.lang.String) values[6]; |
383 | 0 | _infoClass = (java.lang.String) values[7]; |
384 | 0 | _infoStyle = (java.lang.String) values[8]; |
385 | 0 | _tooltip = ((Boolean) values[9]).booleanValue(); |
386 | 0 | _tooltipSet = ((Boolean) values[10]).booleanValue(); |
387 | 0 | _warnClass = (java.lang.String) values[11]; |
388 | 0 | _warnStyle = (java.lang.String) values[12]; |
389 | 0 | _dir = (java.lang.String) values[13]; |
390 | 0 | _lang = (java.lang.String) values[14]; |
391 | 0 | _title = (java.lang.String) values[15]; |
392 | 0 | } |
393 | |
} |