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: * <span style="color: rgb(0, 0, 0);"><span
051: * style="text-decoration: line-through;"></span>Use
052: * the <code>ui:pageSeparator</code>
053: * tag to create a horizontal line that separates items on the
054: * page. The
055: * tag can be used as a standalone tag to
056: * insert a new horizontal line in a page,
057: * or used within the facet of another tag to override a default page
058: * separator. For example, the <code>ui:pageSeparator</code>
059: * tag
060: * can be used in the <a
061: * href="http://smpt.east/%7Esmorgan/lockhart/tlddoc/ui/pageAlert.html"><code>ui:pageAlert</code></a>
062: * tag's <code>pageAlertSeparator</code>
063: * facet. </span><br
064: * style="color: rgb(0, 0, 0);">
065: * <span style="color: rgb(0, 0, 0);"><br>
066: * </span>
067: * <h3 style="color: rgb(0, 0, 0);">HTML
068: * Elements and Layout</h3>
069: * <span style="color: rgb(0, 0, 0);">This
070: * tag renders a horizontal
071: * line inside</span><span
072: * style="text-decoration: line-through; font-weight: bold; color: rgb(0, 0, 0);"></span><span
073: * style="color: rgb(0, 0, 0);"> an
074: * HTML table that will
075: * size according to the size of the page.</span><br
076: * style="color: rgb(0, 0, 0);">
077: * <h3 style="color: rgb(0, 0, 0);">Theme
078: * Identifiers</h3>
079: * <span style="color: rgb(0, 0, 0);">TBD</span><br
080: * style="color: rgb(0, 0, 0);">
081: * <h3 style="color: rgb(0, 0, 0);">Client
082: * Side Javascript Functions</h3>
083: * <span style="color: rgb(0, 0, 0);">None.
084: * </span><br
085: * style="color: rgb(0, 0, 0);">
086: * <h3 style="color: rgb(0, 0, 0);">Example</h3>
087: * <span style="color: rgb(0, 0, 0);"></span><b
088: * style="color: rgb(0, 0, 0);">Example
089: * 1: Using <span
090: * style="text-decoration: line-through;"></span>
091: * a standalone
092: * ui:pageSeparator tag<span
093: * style="text-decoration: line-through;"></span><br>
094: * <br>
095: * </b><code
096: * style="color: rgb(0, 0, 0);"><?xml
097: * version="1.0"
098: * encoding="UTF-8"?><br>
099: * <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core"
100: * xmlns:h="http://java.sun.com/jsf/html"
101: * xmlns:jsp="http://java.sun.com/JSP/Page"
102: * xmlns:ui="http://www.sun.com/web/ui"><br>
103: * <jsp:directive.page
104: * contentType="text/html;charset=ISO-8859-1"
105: * pageEncoding="UTF-8"/><f:view><br>
106: *
107: * <ui:page frame="true"><br>
108: *
109: * <ui:html><br>
110: *
111: * <ui:head title="blah" /><br>
112: *
113: * <ui:body><br>
114: *
115: *
116: * <ui:pageSeparator id="mypageseparator"
117: * /><br>
118: *
119: *
120: * </ui:body><br>
121: *
122: * </ui:html><br>
123: *
124: * </ui:page><br>
125: * </f:view><br>
126: * </jsp:root><br>
127: * <br>
128: * <br>
129: * </code><b
130: * style="color: rgb(0, 0, 0);"></b>
131: * <p>Auto-generated component class.
132: * Do <strong>NOT</strong> modify; all changes
133: * <strong>will</strong> be lost!</p>
134: */
135:
136: public abstract class PageSeparatorBase extends
137: javax.faces.component.UIComponentBase {
138:
139: /**
140: * <p>Construct a new <code>PageSeparatorBase</code>.</p>
141: */
142: public PageSeparatorBase() {
143: super ();
144: setRendererType("com.sun.rave.web.ui.PageSeparator");
145: }
146:
147: /**
148: * <p>Return the identifier of the component family to which this
149: * component belongs. This identifier, in conjunction with the value
150: * of the <code>rendererType</code> property, may be used to select
151: * the appropriate {@link Renderer} for this component instance.</p>
152: */
153: public String getFamily() {
154: return "com.sun.rave.web.ui.PageSeparator";
155: }
156:
157: // style
158: private String style = null;
159:
160: /**
161: * <p>CSS style(s) to be applied when this component is rendered.</p>
162: */
163: public String getStyle() {
164: if (this .style != null) {
165: return this .style;
166: }
167: ValueBinding _vb = getValueBinding("style");
168: if (_vb != null) {
169: return (String) _vb.getValue(getFacesContext());
170: }
171: return null;
172: }
173:
174: /**
175: * <p>CSS style(s) to be applied when this component is rendered.</p>
176: * @see #getStyle()
177: */
178: public void setStyle(String style) {
179: this .style = style;
180: }
181:
182: // styleClass
183: private String styleClass = null;
184:
185: /**
186: * <p>CSS style class(es) to be applied when this component is rendered.</p>
187: */
188: public String getStyleClass() {
189: if (this .styleClass != null) {
190: return this .styleClass;
191: }
192: ValueBinding _vb = getValueBinding("styleClass");
193: if (_vb != null) {
194: return (String) _vb.getValue(getFacesContext());
195: }
196: return null;
197: }
198:
199: /**
200: * <p>CSS style class(es) to be applied when this component is rendered.</p>
201: * @see #getStyleClass()
202: */
203: public void setStyleClass(String styleClass) {
204: this .styleClass = styleClass;
205: }
206:
207: // value
208: private Object value = null;
209:
210: public Object getValue() {
211: if (this .value != null) {
212: return this .value;
213: }
214: ValueBinding _vb = getValueBinding("value");
215: if (_vb != null) {
216: return (Object) _vb.getValue(getFacesContext());
217: }
218: return null;
219: }
220:
221: public void setValue(Object value) {
222: this .value = value;
223: }
224:
225: // visible
226: private boolean visible = false;
227: private boolean visible_set = false;
228:
229: /**
230: * <p>Use the visible attribute to indicate whether the component should be
231: * viewable by the user in the rendered HTML page. If set to false, the
232: * HTML code for the component is present in the page, but the component
233: * is hidden with style attributes. By default, visible is set to true, so
234: * HTML for the component HTML is included and visible to the user. If the
235: * component is not visible, it can still be processed on subsequent form
236: * submissions because the HTML is present.</p>
237: */
238: public boolean isVisible() {
239: if (this .visible_set) {
240: return this .visible;
241: }
242: ValueBinding _vb = getValueBinding("visible");
243: if (_vb != null) {
244: Object _result = _vb.getValue(getFacesContext());
245: if (_result == null) {
246: return false;
247: } else {
248: return ((Boolean) _result).booleanValue();
249: }
250: }
251: return true;
252: }
253:
254: /**
255: * <p>Use the visible attribute to indicate whether the component should be
256: * viewable by the user in the rendered HTML page. If set to false, the
257: * HTML code for the component is present in the page, but the component
258: * is hidden with style attributes. By default, visible is set to true, so
259: * HTML for the component HTML is included and visible to the user. If the
260: * component is not visible, it can still be processed on subsequent form
261: * submissions because the HTML is present.</p>
262: * @see #isVisible()
263: */
264: public void setVisible(boolean visible) {
265: this .visible = visible;
266: this .visible_set = true;
267: }
268:
269: /**
270: * <p>Restore the state of this component.</p>
271: */
272: public void restoreState(FacesContext _context, Object _state) {
273: Object _values[] = (Object[]) _state;
274: super .restoreState(_context, _values[0]);
275: this .style = (String) _values[1];
276: this .styleClass = (String) _values[2];
277: this .value = (Object) _values[3];
278: this .visible = ((Boolean) _values[4]).booleanValue();
279: this .visible_set = ((Boolean) _values[5]).booleanValue();
280: }
281:
282: /**
283: * <p>Save the state of this component.</p>
284: */
285: public Object saveState(FacesContext _context) {
286: Object _values[] = new Object[6];
287: _values[0] = super .saveState(_context);
288: _values[1] = this .style;
289: _values[2] = this .styleClass;
290: _values[3] = this .value;
291: _values[4] = this .visible ? Boolean.TRUE : Boolean.FALSE;
292: _values[5] = this.visible_set ? Boolean.TRUE : Boolean.FALSE;
293: return _values;
294: }
295:
296: }
|