KickJava   Java API By Example, From Geeks To Geeks.

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


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

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