KickJava   Java API By Example, From Geeks To Geeks.

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


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.UIMessages;
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 HtmlMessages extends UIMessages
27 {
28     //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
29

30     public static final String JavaDoc COMPONENT_TYPE = "javax.faces.HtmlMessages";
31     private static final String JavaDoc DEFAULT_RENDERER_TYPE = "javax.faces.Messages";
32     private static final String JavaDoc DEFAULT_LAYOUT = "list";
33     private static final boolean DEFAULT_TOOLTIP = false;
34
35     private String JavaDoc _errorClass = null;
36     private String JavaDoc _errorStyle = null;
37     private String JavaDoc _fatalClass = null;
38     private String JavaDoc _fatalStyle = null;
39     private String JavaDoc _infoClass = null;
40     private String JavaDoc _infoStyle = null;
41     private String JavaDoc _layout = null;
42     private String JavaDoc _style = null;
43     private String JavaDoc _styleClass = null;
44     private String JavaDoc _title = null;
45     private Boolean JavaDoc _tooltip = null;
46     private String JavaDoc _warnClass = null;
47     private String JavaDoc _warnStyle = null;
48
49     public HtmlMessages()
50     {
51         setRendererType(DEFAULT_RENDERER_TYPE);
52     }
53
54
55     public void setErrorClass(String JavaDoc errorClass)
56     {
57         _errorClass = errorClass;
58     }
59
60     public String JavaDoc getErrorClass()
61     {
62         if (_errorClass != null) return _errorClass;
63         ValueBinding vb = getValueBinding("errorClass");
64         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
65     }
66
67     public void setErrorStyle(String JavaDoc errorStyle)
68     {
69         _errorStyle = errorStyle;
70     }
71
72     public String JavaDoc getErrorStyle()
73     {
74         if (_errorStyle != null) return _errorStyle;
75         ValueBinding vb = getValueBinding("errorStyle");
76         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
77     }
78
79     public void setFatalClass(String JavaDoc fatalClass)
80     {
81         _fatalClass = fatalClass;
82     }
83
84     public String JavaDoc getFatalClass()
85     {
86         if (_fatalClass != null) return _fatalClass;
87         ValueBinding vb = getValueBinding("fatalClass");
88         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
89     }
90
91     public void setFatalStyle(String JavaDoc fatalStyle)
92     {
93         _fatalStyle = fatalStyle;
94     }
95
96     public String JavaDoc getFatalStyle()
97     {
98         if (_fatalStyle != null) return _fatalStyle;
99         ValueBinding vb = getValueBinding("fatalStyle");
100         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
101     }
102
103     public void setInfoClass(String JavaDoc infoClass)
104     {
105         _infoClass = infoClass;
106     }
107
108     public String JavaDoc getInfoClass()
109     {
110         if (_infoClass != null) return _infoClass;
111         ValueBinding vb = getValueBinding("infoClass");
112         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
113     }
114
115     public void setInfoStyle(String JavaDoc infoStyle)
116     {
117         _infoStyle = infoStyle;
118     }
119
120     public String JavaDoc getInfoStyle()
121     {
122         if (_infoStyle != null) return _infoStyle;
123         ValueBinding vb = getValueBinding("infoStyle");
124         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
125     }
126
127     public void setLayout(String JavaDoc layout)
128     {
129         _layout = layout;
130     }
131
132     public String JavaDoc getLayout()
133     {
134         if (_layout != null) return _layout;
135         ValueBinding vb = getValueBinding("layout");
136         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : DEFAULT_LAYOUT;
137     }
138
139     public void setStyle(String JavaDoc style)
140     {
141         _style = style;
142     }
143
144     public String JavaDoc getStyle()
145     {
146         if (_style != null) return _style;
147         ValueBinding vb = getValueBinding("style");
148         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
149     }
150
151     public void setStyleClass(String JavaDoc styleClass)
152     {
153         _styleClass = styleClass;
154     }
155
156     public String JavaDoc getStyleClass()
157     {
158         if (_styleClass != null) return _styleClass;
159         ValueBinding vb = getValueBinding("styleClass");
160         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
161     }
162
163     public void setTitle(String JavaDoc title)
164     {
165         _title = title;
166     }
167
168     public String JavaDoc getTitle()
169     {
170         if (_title != null) return _title;
171         ValueBinding vb = getValueBinding("title");
172         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
173     }
174
175     public void setTooltip(boolean tooltip)
176     {
177         _tooltip = Boolean.valueOf(tooltip);
178     }
179
180     public boolean isTooltip()
181     {
182         if (_tooltip != null) return _tooltip.booleanValue();
183         ValueBinding vb = getValueBinding("tooltip");
184         Boolean JavaDoc v = vb != null ? (Boolean JavaDoc)vb.getValue(getFacesContext()) : null;
185         return v != null ? v.booleanValue() : DEFAULT_TOOLTIP;
186     }
187
188     public void setWarnClass(String JavaDoc warnClass)
189     {
190         _warnClass = warnClass;
191     }
192
193     public String JavaDoc getWarnClass()
194     {
195         if (_warnClass != null) return _warnClass;
196         ValueBinding vb = getValueBinding("warnClass");
197         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
198     }
199
200     public void setWarnStyle(String JavaDoc warnStyle)
201     {
202         _warnStyle = warnStyle;
203     }
204
205     public String JavaDoc getWarnStyle()
206     {
207         if (_warnStyle != null) return _warnStyle;
208         ValueBinding vb = getValueBinding("warnStyle");
209         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
210     }
211
212
213     public Object JavaDoc saveState(FacesContext context)
214     {
215         Object JavaDoc values[] = new Object JavaDoc[14];
216         values[0] = super.saveState(context);
217         values[1] = _errorClass;
218         values[2] = _errorStyle;
219         values[3] = _fatalClass;
220         values[4] = _fatalStyle;
221         values[5] = _infoClass;
222         values[6] = _infoStyle;
223         values[7] = _layout;
224         values[8] = _style;
225         values[9] = _styleClass;
226         values[10] = _title;
227         values[11] = _tooltip;
228         values[12] = _warnClass;
229         values[13] = _warnStyle;
230         return ((Object JavaDoc) (values));
231     }
232
233     public void restoreState(FacesContext context, Object JavaDoc state)
234     {
235         Object JavaDoc values[] = (Object JavaDoc[])state;
236         super.restoreState(context, values[0]);
237         _errorClass = (String JavaDoc)values[1];
238         _errorStyle = (String JavaDoc)values[2];
239         _fatalClass = (String JavaDoc)values[3];
240         _fatalStyle = (String JavaDoc)values[4];
241         _infoClass = (String JavaDoc)values[5];
242         _infoStyle = (String JavaDoc)values[6];
243         _layout = (String JavaDoc)values[7];
244         _style = (String JavaDoc)values[8];
245         _styleClass = (String JavaDoc)values[9];
246         _title = (String JavaDoc)values[10];
247         _tooltip = (Boolean JavaDoc)values[11];
248         _warnClass = (String JavaDoc)values[12];
249         _warnStyle = (String JavaDoc)values[13];
250     }
251     //------------------ GENERATED CODE END ---------------------------------------
252
}
253
Popular Tags