KickJava   Java API By Example, From Geeks To Geeks.

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


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.UIOutput;
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:15 $
25  */

26 public class HtmlOutputFormat extends UIOutput
27 {
28     //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
29

30     public static final String JavaDoc COMPONENT_TYPE = "javax.faces.HtmlOutputFormat";
31     private static final String JavaDoc DEFAULT_RENDERER_TYPE = "javax.faces.Format";
32     private static final boolean DEFAULT_ESCAPE = true;
33
34     private Boolean JavaDoc _escape = null;
35     private String JavaDoc _style = null;
36     private String JavaDoc _styleClass = null;
37     private String JavaDoc _title = null;
38
39     public HtmlOutputFormat()
40     {
41         setRendererType(DEFAULT_RENDERER_TYPE);
42     }
43
44
45     public void setEscape(boolean escape)
46     {
47         _escape = Boolean.valueOf(escape);
48     }
49
50     public boolean isEscape()
51     {
52         if (_escape != null) return _escape.booleanValue();
53         ValueBinding vb = getValueBinding("escape");
54         Boolean JavaDoc v = vb != null ? (Boolean JavaDoc)vb.getValue(getFacesContext()) : null;
55         return v != null ? v.booleanValue() : DEFAULT_ESCAPE;
56     }
57
58     public void setStyle(String JavaDoc style)
59     {
60         _style = style;
61     }
62
63     public String JavaDoc getStyle()
64     {
65         if (_style != null) return _style;
66         ValueBinding vb = getValueBinding("style");
67         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
68     }
69
70     public void setStyleClass(String JavaDoc styleClass)
71     {
72         _styleClass = styleClass;
73     }
74
75     public String JavaDoc getStyleClass()
76     {
77         if (_styleClass != null) return _styleClass;
78         ValueBinding vb = getValueBinding("styleClass");
79         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
80     }
81
82     public void setTitle(String JavaDoc title)
83     {
84         _title = title;
85     }
86
87     public String JavaDoc getTitle()
88     {
89         if (_title != null) return _title;
90         ValueBinding vb = getValueBinding("title");
91         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
92     }
93
94
95     public Object JavaDoc saveState(FacesContext context)
96     {
97         Object JavaDoc values[] = new Object JavaDoc[5];
98         values[0] = super.saveState(context);
99         values[1] = _escape;
100         values[2] = _style;
101         values[3] = _styleClass;
102         values[4] = _title;
103         return ((Object JavaDoc) (values));
104     }
105
106     public void restoreState(FacesContext context, Object JavaDoc state)
107     {
108         Object JavaDoc values[] = (Object JavaDoc[])state;
109         super.restoreState(context, values[0]);
110         _escape = (Boolean JavaDoc)values[1];
111         _style = (String JavaDoc)values[2];
112         _styleClass = (String JavaDoc)values[3];
113         _title = (String JavaDoc)values[4];
114     }
115     //------------------ GENERATED CODE END ---------------------------------------
116
}
117
Popular Tags