Source code: javax/faces/component/html/HtmlOutputFormat.java
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: 166994 $ $Date: 2004-07-01 18:12:40 -0400 (Thu, 01 Jul 2004) $
25 */
26 public class HtmlOutputFormat extends UIOutput
27 {
28 //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
29
30 public static final String COMPONENT_TYPE = "javax.faces.HtmlOutputFormat";
31 private static final String DEFAULT_RENDERER_TYPE = "javax.faces.Format";
32 private static final boolean DEFAULT_ESCAPE = true;
33
34 private Boolean _escape = null;
35 private String _style = null;
36 private String _styleClass = null;
37 private String _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 v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
55 return v != null ? v.booleanValue() : DEFAULT_ESCAPE;
56 }
57
58 public void setStyle(String style)
59 {
60 _style = style;
61 }
62
63 public String getStyle()
64 {
65 if (_style != null) return _style;
66 ValueBinding vb = getValueBinding("style");
67 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
68 }
69
70 public void setStyleClass(String styleClass)
71 {
72 _styleClass = styleClass;
73 }
74
75 public String getStyleClass()
76 {
77 if (_styleClass != null) return _styleClass;
78 ValueBinding vb = getValueBinding("styleClass");
79 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
80 }
81
82 public void setTitle(String title)
83 {
84 _title = title;
85 }
86
87 public String getTitle()
88 {
89 if (_title != null) return _title;
90 ValueBinding vb = getValueBinding("title");
91 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
92 }
93
94
95 public Object saveState(FacesContext context)
96 {
97 Object values[] = new Object[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) (values));
104 }
105
106 public void restoreState(FacesContext context, Object state)
107 {
108 Object values[] = (Object[])state;
109 super.restoreState(context, values[0]);
110 _escape = (Boolean)values[1];
111 _style = (String)values[2];
112 _styleClass = (String)values[3];
113 _title = (String)values[4];
114 }
115 //------------------ GENERATED CODE END ---------------------------------------
116 }