001: /*
002: * Version: MPL 1.1/GPL 2.0/LGPL 2.1
003: *
004: * "The contents of this file are subject to the Mozilla Public License
005: * Version 1.1 (the "License"); you may not use this file except in
006: * compliance with the License. You may obtain a copy of the License at
007: * http://www.mozilla.org/MPL/
008: *
009: * Software distributed under the License is distributed on an "AS IS"
010: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
011: * License for the specific language governing rights and limitations under
012: * the License.
013: *
014: * The Original Code is ICEfaces 1.5 open source software code, released
015: * November 5, 2006. The Initial Developer of the Original Code is ICEsoft
016: * Technologies Canada, Corp. Portions created by ICEsoft are Copyright (C)
017: * 2004-2006 ICEsoft Technologies Canada, Corp. All Rights Reserved.
018: *
019: * Contributor(s): _____________________.
020: *
021: * Alternatively, the contents of this file may be used under the terms of
022: * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"
023: * License), in which case the provisions of the LGPL License are
024: * applicable instead of those above. If you wish to allow use of your
025: * version of this file only under the terms of the LGPL License and not to
026: * allow others to use your version of this file under the MPL, indicate
027: * your decision by deleting the provisions above and replace them with
028: * the notice and other provisions required by the LGPL License. If you do
029: * not delete the provisions above, a recipient may use your version of
030: * this file under either the MPL or the LGPL License."
031: *
032: */
033:
034: package com.icesoft.faces.component.outputdeclaration;
035:
036: import javax.faces.context.FacesContext;
037: import javax.faces.el.ValueBinding;
038:
039: /**
040: * This is an extension of javax.faces.component.UIOutput, which provides
041: * design-time support for SunStudioCreator 2
042: */
043: public class OutputDeclaration extends javax.faces.component.UIOutput {
044:
045: public static final String COMPONENT_TYPE = "com.icesoft.faces.OutputDeclaration";
046: public static final String COMPONENT_FAMILY = "javax.faces.Output";
047: public static final String RENDERER_TYPE = "com.icesoft.faces.OutputDeclaration";
048:
049: public OutputDeclaration() {
050: super ();
051: setRendererType(RENDERER_TYPE);
052: }
053:
054: public String getRendererType() {
055: return RENDERER_TYPE;
056: }
057:
058: public String getFamily() {
059: return COMPONENT_FAMILY;
060: }
061:
062: // doctypePublic
063: private String doctypePublic = null;
064:
065: /**
066: * <p>An identifier for the DTD without giving a specific location.</p>
067: */
068: public String getDoctypePublic() {
069: if (this .doctypePublic != null) {
070: return this .doctypePublic;
071: }
072: ValueBinding _vb = getValueBinding("doctypePublic");
073: if (_vb != null) {
074: return (String) _vb.getValue(getFacesContext());
075: }
076: return null;
077: }
078:
079: /**
080: * <p>An identifier for the DTD without giving a specific location.</p>
081: *
082: * @see #getDoctypePublic()
083: */
084: public void setDoctypePublic(String doctypePublic) {
085: this .doctypePublic = doctypePublic;
086: }
087:
088: // doctypeRoot
089: private String doctypeRoot = null;
090:
091: /**
092: * <p>Indicates the root element of the XML document.</p>
093: */
094: public String getDoctypeRoot() {
095: if (this .doctypeRoot != null) {
096: return this .doctypeRoot;
097: }
098: ValueBinding _vb = getValueBinding("doctypeRoot");
099: if (_vb != null) {
100: return (String) _vb.getValue(getFacesContext());
101: }
102: return null;
103: }
104:
105: /**
106: * <p>Indicates the root element of the XML document.</p>
107: *
108: * @see #getDoctypeRoot()
109: */
110: public void setDoctypeRoot(String doctypeRoot) {
111: this .doctypeRoot = doctypeRoot;
112: }
113:
114: // doctypeSystem
115: private String doctypeSystem = null;
116:
117: /**
118: * <p>Indicates the URI reference to the DTD.</p>
119: */
120: public String getDoctypeSystem() {
121: if (this .doctypeSystem != null) {
122: return this .doctypeSystem;
123: }
124: ValueBinding _vb = getValueBinding("doctypeSystem");
125: if (_vb != null) {
126: return (String) _vb.getValue(getFacesContext());
127: }
128: return null;
129: }
130:
131: /**
132: * <p>Indicates the URI reference to the DTD.</p>
133: *
134: * @see #getDoctypeSystem()
135: */
136: public void setDoctypeSystem(String doctypeSystem) {
137: this .doctypeSystem = doctypeSystem;
138: }
139:
140: /**
141: * <p>Restore the state of this component.</p>
142: */
143: public void restoreState(FacesContext _context, Object _state) {
144: Object _values[] = (Object[]) _state;
145: super .restoreState(_context, _values[0]);
146: this .doctypePublic = (String) _values[1];
147: this .doctypeRoot = (String) _values[2];
148: this .doctypeSystem = (String) _values[3];
149: }
150:
151: /**
152: * <p>Save the state of this component.</p>
153: */
154: public Object saveState(FacesContext _context) {
155: Object _values[] = new Object[4];
156: _values[0] = super .saveState(_context);
157: _values[1] = this .doctypePublic;
158: _values[2] = this .doctypeRoot;
159: _values[3] = this.doctypeSystem;
160: return _values;
161: }
162: }
|