001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041: package com.sun.rave.web.ui.component;
042:
043: import java.io.IOException;
044: import javax.faces.component.UIComponent;
045: import javax.faces.context.FacesContext;
046: import javax.faces.el.MethodBinding;
047: import javax.faces.el.ValueBinding;
048:
049: /**
050: * Placeholder.
051: * <p>Auto-generated component class.
052: * Do <strong>NOT</strong> modify; all changes
053: * <strong>will</strong> be lost!</p>
054: */
055:
056: public abstract class TemplateComponentBaseBase extends
057: javax.faces.component.UIComponentBase {
058:
059: /**
060: * <p>Construct a new <code>TemplateComponentBaseBase</code>.</p>
061: */
062: public TemplateComponentBaseBase() {
063: super ();
064: setRendererType("com.sun.rave.web.ui.Template");
065: }
066:
067: /**
068: * <p>Return the identifier of the component family to which this
069: * component belongs. This identifier, in conjunction with the value
070: * of the <code>rendererType</code> property, may be used to select
071: * the appropriate {@link Renderer} for this component instance.</p>
072: */
073: public String getFamily() {
074: return "com.sun.rave.web.ui.Template";
075: }
076:
077: // style
078: private String style = null;
079:
080: /**
081: * <p>CSS style(s) to be applied when this component is rendered.</p>
082: */
083: public String getStyle() {
084: if (this .style != null) {
085: return this .style;
086: }
087: ValueBinding _vb = getValueBinding("style");
088: if (_vb != null) {
089: return (String) _vb.getValue(getFacesContext());
090: }
091: return null;
092: }
093:
094: /**
095: * <p>CSS style(s) to be applied when this component is rendered.</p>
096: * @see #getStyle()
097: */
098: public void setStyle(String style) {
099: this .style = style;
100: }
101:
102: // styleClass
103: private String styleClass = null;
104:
105: /**
106: * <p>CSS style class(es) to be applied when this component is rendered.</p>
107: */
108: public String getStyleClass() {
109: if (this .styleClass != null) {
110: return this .styleClass;
111: }
112: ValueBinding _vb = getValueBinding("styleClass");
113: if (_vb != null) {
114: return (String) _vb.getValue(getFacesContext());
115: }
116: return null;
117: }
118:
119: /**
120: * <p>CSS style class(es) to be applied when this component is rendered.</p>
121: * @see #getStyleClass()
122: */
123: public void setStyleClass(String styleClass) {
124: this .styleClass = styleClass;
125: }
126:
127: // visible
128: private boolean visible = false;
129: private boolean visible_set = false;
130:
131: /**
132: * <p>Use the visible attribute to indicate whether the component should be
133: * viewable by the user in the rendered HTML page. If set to false, the
134: * HTML code for the component is present in the page, but the component
135: * is hidden with style attributes. By default, visible is set to true, so
136: * HTML for the component HTML is included and visible to the user. If the
137: * component is not visible, it can still be processed on subsequent form
138: * submissions because the HTML is present.</p>
139: */
140: public boolean isVisible() {
141: if (this .visible_set) {
142: return this .visible;
143: }
144: ValueBinding _vb = getValueBinding("visible");
145: if (_vb != null) {
146: Object _result = _vb.getValue(getFacesContext());
147: if (_result == null) {
148: return false;
149: } else {
150: return ((Boolean) _result).booleanValue();
151: }
152: }
153: return true;
154: }
155:
156: /**
157: * <p>Use the visible attribute to indicate whether the component should be
158: * viewable by the user in the rendered HTML page. If set to false, the
159: * HTML code for the component is present in the page, but the component
160: * is hidden with style attributes. By default, visible is set to true, so
161: * HTML for the component HTML is included and visible to the user. If the
162: * component is not visible, it can still be processed on subsequent form
163: * submissions because the HTML is present.</p>
164: * @see #isVisible()
165: */
166: public void setVisible(boolean visible) {
167: this .visible = visible;
168: this .visible_set = true;
169: }
170:
171: /**
172: * <p>Restore the state of this component.</p>
173: */
174: public void restoreState(FacesContext _context, Object _state) {
175: Object _values[] = (Object[]) _state;
176: super .restoreState(_context, _values[0]);
177: this .style = (String) _values[1];
178: this .styleClass = (String) _values[2];
179: this .visible = ((Boolean) _values[3]).booleanValue();
180: this .visible_set = ((Boolean) _values[4]).booleanValue();
181: }
182:
183: /**
184: * <p>Save the state of this component.</p>
185: */
186: public Object saveState(FacesContext _context) {
187: Object _values[] = new Object[5];
188: _values[0] = super .saveState(_context);
189: _values[1] = this .style;
190: _values[2] = this .styleClass;
191: _values[3] = this .visible ? Boolean.TRUE : Boolean.FALSE;
192: _values[4] = this.visible_set ? Boolean.TRUE : Boolean.FALSE;
193: return _values;
194: }
195:
196: }
|