KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > icesoft > faces > component > outputdeclaration > OutputDeclaration


1 /*
2  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3  *
4  * "The contents of this file are subject to the Mozilla Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License at
7  * http://www.mozilla.org/MPL/
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
11  * License for the specific language governing rights and limitations under
12  * the License.
13  *
14  * The Original Code is ICEfaces 1.5 open source software code, released
15  * November 5, 2006. The Initial Developer of the Original Code is ICEsoft
16  * Technologies Canada, Corp. Portions created by ICEsoft are Copyright (C)
17  * 2004-2006 ICEsoft Technologies Canada, Corp. All Rights Reserved.
18  *
19  * Contributor(s): _____________________.
20  *
21  * Alternatively, the contents of this file may be used under the terms of
22  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"
23  * License), in which case the provisions of the LGPL License are
24  * applicable instead of those above. If you wish to allow use of your
25  * version of this file only under the terms of the LGPL License and not to
26  * allow others to use your version of this file under the MPL, indicate
27  * your decision by deleting the provisions above and replace them with
28  * the notice and other provisions required by the LGPL License. If you do
29  * not delete the provisions above, a recipient may use your version of
30  * this file under either the MPL or the LGPL License."
31  *
32  */

33
34 package com.icesoft.faces.component.outputdeclaration;
35
36 import javax.faces.context.FacesContext;
37 import javax.faces.el.ValueBinding;
38
39 /**
40  * This is an extension of javax.faces.component.UIOutput, which provides
41  * design-time support for SunStudioCreator 2
42  */

43 public class OutputDeclaration
44         extends javax.faces.component.UIOutput {
45
46     public static final String JavaDoc COMPONENT_TYPE =
47             "com.icesoft.faces.OutputDeclaration";
48     public static final String JavaDoc COMPONENT_FAMILY = "javax.faces.Output";
49     public static final String JavaDoc RENDERER_TYPE =
50             "com.icesoft.faces.OutputDeclaration";
51
52     public OutputDeclaration() {
53         super();
54         setRendererType(RENDERER_TYPE);
55     }
56
57     public String JavaDoc getRendererType() {
58         return RENDERER_TYPE;
59     }
60
61     public String JavaDoc getFamily() {
62         return COMPONENT_FAMILY;
63     }
64
65
66     // doctypePublic
67
private String JavaDoc doctypePublic = null;
68
69     /**
70      * <p>An identifier for the DTD without giving a specific location.</p>
71      */

72     public String JavaDoc getDoctypePublic() {
73         if (this.doctypePublic != null) {
74             return this.doctypePublic;
75         }
76         ValueBinding _vb = getValueBinding("doctypePublic");
77         if (_vb != null) {
78             return (String JavaDoc) _vb.getValue(getFacesContext());
79         }
80         return null;
81     }
82
83     /**
84      * <p>An identifier for the DTD without giving a specific location.</p>
85      *
86      * @see #getDoctypePublic()
87      */

88     public void setDoctypePublic(String JavaDoc doctypePublic) {
89         this.doctypePublic = doctypePublic;
90     }
91
92     // doctypeRoot
93
private String JavaDoc doctypeRoot = null;
94
95     /**
96      * <p>Indicates the root element of the XML document.</p>
97      */

98     public String JavaDoc getDoctypeRoot() {
99         if (this.doctypeRoot != null) {
100             return this.doctypeRoot;
101         }
102         ValueBinding _vb = getValueBinding("doctypeRoot");
103         if (_vb != null) {
104             return (String JavaDoc) _vb.getValue(getFacesContext());
105         }
106         return null;
107     }
108
109     /**
110      * <p>Indicates the root element of the XML document.</p>
111      *
112      * @see #getDoctypeRoot()
113      */

114     public void setDoctypeRoot(String JavaDoc doctypeRoot) {
115         this.doctypeRoot = doctypeRoot;
116     }
117
118     // doctypeSystem
119
private String JavaDoc doctypeSystem = null;
120
121     /**
122      * <p>Indicates the URI reference to the DTD.</p>
123      */

124     public String JavaDoc getDoctypeSystem() {
125         if (this.doctypeSystem != null) {
126             return this.doctypeSystem;
127         }
128         ValueBinding _vb = getValueBinding("doctypeSystem");
129         if (_vb != null) {
130             return (String JavaDoc) _vb.getValue(getFacesContext());
131         }
132         return null;
133     }
134
135     /**
136      * <p>Indicates the URI reference to the DTD.</p>
137      *
138      * @see #getDoctypeSystem()
139      */

140     public void setDoctypeSystem(String JavaDoc doctypeSystem) {
141         this.doctypeSystem = doctypeSystem;
142     }
143
144     /**
145      * <p>Restore the state of this component.</p>
146      */

147     public void restoreState(FacesContext _context, Object JavaDoc _state) {
148         Object JavaDoc _values[] = (Object JavaDoc[]) _state;
149         super.restoreState(_context, _values[0]);
150         this.doctypePublic = (String JavaDoc) _values[1];
151         this.doctypeRoot = (String JavaDoc) _values[2];
152         this.doctypeSystem = (String JavaDoc) _values[3];
153     }
154
155     /**
156      * <p>Save the state of this component.</p>
157      */

158     public Object JavaDoc saveState(FacesContext _context) {
159         Object JavaDoc _values[] = new Object JavaDoc[4];
160         _values[0] = super.saveState(_context);
161         _values[1] = this.doctypePublic;
162         _values[2] = this.doctypeRoot;
163         _values[3] = this.doctypeSystem;
164         return _values;
165     }
166 }
167
Popular Tags