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);">Use
051: * the <code>ui:frameSet</code>
052: * tag to define a new set of frames in the rendered HTML page. <br>
053: * When using <code>ui:frameSet</code>
054: * and <code>ui:frame</code>
055: * tags in
056: * your application, you must also set the <code>ui:page</code>
057: * tag's
058: * frame attribute to "true".<br>
059: * </span><br
060: * style="color: rgb(0, 0, 0);">
061: * <h3 style="color: rgb(0, 0, 0);">HTML
062: * Elements and Layout</h3>
063: * <span style="color: rgb(0, 0, 0);">The
064: * rendered HTML page contains
065: * an XHTML-compliant <code><frameset></code>
066: * element. </span><br
067: * style="color: rgb(0, 0, 0);">
068: * <br style="color: rgb(0, 0, 0);">
069: * <h3 style="color: rgb(0, 0, 0);">Theme
070: * Identifiers</h3>
071: * <span style="color: rgb(0, 0, 0);">What
072: * theme elements apply?</span><br
073: * style="color: rgb(0, 0, 0);">
074: * <br style="color: rgb(0, 0, 0);">
075: * <h3 style="color: rgb(0, 0, 0);">Client
076: * Side Javascript Functions</h3>
077: * <span style="color: rgb(0, 0, 0);">None.
078: * </span><br
079: * style="color: rgb(0, 0, 0);">
080: * <br style="color: rgb(0, 0, 0);">
081: * <h3 style="color: rgb(0, 0, 0);">Examples</h3>
082: * <p style="color: rgb(0, 0, 0);"></p>
083: * <h4 style="color: rgb(0, 0, 0);">Example
084: * 1: Creating a
085: * frameset of two rows and two columns<br>
086: * </h4>
087: * <code style="color: rgb(0, 0, 0);"><?xml
088: * version="1.0"
089: * encoding="UTF-8"?><br>
090: * <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core"
091: * xmlns:h="http://java.sun.com/jsf/html"
092: * xmlns:jsp="http://java.sun.com/JSP/Page"
093: * xmlns:ui="http://www.sun.com/web/ui"><br>
094: * <jsp:directive.page
095: * contentType="text/html;charset=ISO-8859-1"
096: * pageEncoding="UTF-8"/><f:view><br>
097: *
098: * <ui:page frame="true"><br>
099: *
100: * <ui:html><br>
101: *
102: * <ui:head title="blah" /><br>
103: *
104: * <ui:frameSet rows="10%,*" cols="10%,*" style="color:blue"
105: * styleClass="blue" toolTip="blah"><br>
106: *
107: * <ui:frame toolTip="blah" url="../faces/hyperlink/hyperlink.jsp"
108: * frameBorder="true" noResize="false"/><br>
109: *
110: * <ui:frame toolTip="blah1" url="../faces/hyperlink/nextpage.jsp"
111: * frameBorder="true" noResize="false"/><br>
112: *
113: * <br>
114: *
115: * <ui:frame toolTip="blah2" url="http://www.google.com"
116: * frameBorder="true" noResize="false"/><br>
117: *
118: * <ui:frame toolTip="blah3" url="http://www.yahoo.com"
119: * frameBorder="true" noResize="false"/><br>
120: *
121: * </ui:frameSet><br>
122: *
123: * </ui:html><br>
124: *
125: * </ui:page><br>
126: * </f:view><br>
127: * </jsp:root></code>
128: * <p>Auto-generated component class.
129: * Do <strong>NOT</strong> modify; all changes
130: * <strong>will</strong> be lost!</p>
131: */
132:
133: public abstract class FrameSetBase extends
134: javax.faces.component.UIComponentBase {
135:
136: /**
137: * <p>Construct a new <code>FrameSetBase</code>.</p>
138: */
139: public FrameSetBase() {
140: super ();
141: setRendererType("com.sun.rave.web.ui.FrameSet");
142: }
143:
144: /**
145: * <p>Return the identifier of the component family to which this
146: * component belongs. This identifier, in conjunction with the value
147: * of the <code>rendererType</code> property, may be used to select
148: * the appropriate {@link Renderer} for this component instance.</p>
149: */
150: public String getFamily() {
151: return "com.sun.rave.web.ui.FrameSet";
152: }
153:
154: // border
155: private int border = Integer.MIN_VALUE;
156: private boolean border_set = false;
157:
158: /**
159: * <p>The width, in pixels, of the space around frames. The frameSpacing
160: * attribute and the border attribute set the same property in different
161: * browsers. Set frameSpacing and border to the same value.</p>
162: */
163: public int getBorder() {
164: if (this .border_set) {
165: return this .border;
166: }
167: ValueBinding _vb = getValueBinding("border");
168: if (_vb != null) {
169: Object _result = _vb.getValue(getFacesContext());
170: if (_result == null) {
171: return Integer.MIN_VALUE;
172: } else {
173: return ((Integer) _result).intValue();
174: }
175: }
176: return Integer.MIN_VALUE;
177: }
178:
179: /**
180: * <p>The width, in pixels, of the space around frames. The frameSpacing
181: * attribute and the border attribute set the same property in different
182: * browsers. Set frameSpacing and border to the same value.</p>
183: * @see #getBorder()
184: */
185: public void setBorder(int border) {
186: this .border = border;
187: this .border_set = true;
188: }
189:
190: // borderColor
191: private String borderColor = null;
192:
193: /**
194: * <p>The bordercolor attribute allows you to set the color of the frame
195: * borders using a hex value or a color name.</p>
196: */
197: public String getBorderColor() {
198: if (this .borderColor != null) {
199: return this .borderColor;
200: }
201: ValueBinding _vb = getValueBinding("borderColor");
202: if (_vb != null) {
203: return (String) _vb.getValue(getFacesContext());
204: }
205: return null;
206: }
207:
208: /**
209: * <p>The bordercolor attribute allows you to set the color of the frame
210: * borders using a hex value or a color name.</p>
211: * @see #getBorderColor()
212: */
213: public void setBorderColor(String borderColor) {
214: this .borderColor = borderColor;
215: }
216:
217: // cols
218: private String cols = null;
219:
220: /**
221: * <p>Defines the number and size of columns in a frameset. The size can be
222: * specified in pixels, percentage of the page width, or with an
223: * asterisk (*). Specifying * causes the columns to use available space.
224: * See the HTML specification for the frameset element for more details.</p>
225: */
226: public String getCols() {
227: if (this .cols != null) {
228: return this .cols;
229: }
230: ValueBinding _vb = getValueBinding("cols");
231: if (_vb != null) {
232: return (String) _vb.getValue(getFacesContext());
233: }
234: return null;
235: }
236:
237: /**
238: * <p>Defines the number and size of columns in a frameset. The size can be
239: * specified in pixels, percentage of the page width, or with an
240: * asterisk (*). Specifying * causes the columns to use available space.
241: * See the HTML specification for the frameset element for more details.</p>
242: * @see #getCols()
243: */
244: public void setCols(String cols) {
245: this .cols = cols;
246: }
247:
248: // frameBorder
249: private boolean frameBorder = false;
250: private boolean frameBorder_set = false;
251:
252: /**
253: * <p>Flag indicating whether frames should have borders or not. If
254: * frameBorder is true, decorative borders are drawn. If frameBorder is
255: * false, a space between frames shows up as the background color of the
256: * page. To show no border or space between frames, you should set
257: * frameBorder to false, and set frameSpacing and border to 0.</p>
258: */
259: public boolean isFrameBorder() {
260: if (this .frameBorder_set) {
261: return this .frameBorder;
262: }
263: ValueBinding _vb = getValueBinding("frameBorder");
264: if (_vb != null) {
265: Object _result = _vb.getValue(getFacesContext());
266: if (_result == null) {
267: return false;
268: } else {
269: return ((Boolean) _result).booleanValue();
270: }
271: }
272: return false;
273: }
274:
275: /**
276: * <p>Flag indicating whether frames should have borders or not. If
277: * frameBorder is true, decorative borders are drawn. If frameBorder is
278: * false, a space between frames shows up as the background color of the
279: * page. To show no border or space between frames, you should set
280: * frameBorder to false, and set frameSpacing and border to 0.</p>
281: * @see #isFrameBorder()
282: */
283: public void setFrameBorder(boolean frameBorder) {
284: this .frameBorder = frameBorder;
285: this .frameBorder_set = true;
286: }
287:
288: // frameSpacing
289: private int frameSpacing = Integer.MIN_VALUE;
290: private boolean frameSpacing_set = false;
291:
292: /**
293: * <p>The width, in pixels, of the space around frames. The frameSpacing attribute
294: * and the border attribute set the same property in different browsers.
295: * Set frameSpacing and border to the same value.</p>
296: */
297: public int getFrameSpacing() {
298: if (this .frameSpacing_set) {
299: return this .frameSpacing;
300: }
301: ValueBinding _vb = getValueBinding("frameSpacing");
302: if (_vb != null) {
303: Object _result = _vb.getValue(getFacesContext());
304: if (_result == null) {
305: return Integer.MIN_VALUE;
306: } else {
307: return ((Integer) _result).intValue();
308: }
309: }
310: return Integer.MIN_VALUE;
311: }
312:
313: /**
314: * <p>The width, in pixels, of the space around frames. The frameSpacing attribute
315: * and the border attribute set the same property in different browsers.
316: * Set frameSpacing and border to the same value.</p>
317: * @see #getFrameSpacing()
318: */
319: public void setFrameSpacing(int frameSpacing) {
320: this .frameSpacing = frameSpacing;
321: this .frameSpacing_set = true;
322: }
323:
324: // rows
325: private String rows = null;
326:
327: /**
328: * <p>Defines the number and size of rows in a frameset. The size can be
329: * specified in pixels, percentage of the page length, or with an
330: * asterisk (*). Specifying * causes the rows to use available space.
331: * See the HTML specification for the frameset element for more details.</p>
332: */
333: public String getRows() {
334: if (this .rows != null) {
335: return this .rows;
336: }
337: ValueBinding _vb = getValueBinding("rows");
338: if (_vb != null) {
339: return (String) _vb.getValue(getFacesContext());
340: }
341: return null;
342: }
343:
344: /**
345: * <p>Defines the number and size of rows in a frameset. The size can be
346: * specified in pixels, percentage of the page length, or with an
347: * asterisk (*). Specifying * causes the rows to use available space.
348: * See the HTML specification for the frameset element for more details.</p>
349: * @see #getRows()
350: */
351: public void setRows(String rows) {
352: this .rows = rows;
353: }
354:
355: // style
356: private String style = null;
357:
358: /**
359: * <p>CSS style(s) to be applied when this component is rendered.</p>
360: */
361: public String getStyle() {
362: if (this .style != null) {
363: return this .style;
364: }
365: ValueBinding _vb = getValueBinding("style");
366: if (_vb != null) {
367: return (String) _vb.getValue(getFacesContext());
368: }
369: return null;
370: }
371:
372: /**
373: * <p>CSS style(s) to be applied when this component is rendered.</p>
374: * @see #getStyle()
375: */
376: public void setStyle(String style) {
377: this .style = style;
378: }
379:
380: // styleClass
381: private String styleClass = null;
382:
383: /**
384: * <p>CSS style class(es) to be applied when this component is rendered.</p>
385: */
386: public String getStyleClass() {
387: if (this .styleClass != null) {
388: return this .styleClass;
389: }
390: ValueBinding _vb = getValueBinding("styleClass");
391: if (_vb != null) {
392: return (String) _vb.getValue(getFacesContext());
393: }
394: return null;
395: }
396:
397: /**
398: * <p>CSS style class(es) to be applied when this component is rendered.</p>
399: * @see #getStyleClass()
400: */
401: public void setStyleClass(String styleClass) {
402: this .styleClass = styleClass;
403: }
404:
405: // toolTip
406: private String toolTip = null;
407:
408: /**
409: * <p>Display the text as a tooltip for this component</p>
410: */
411: public String getToolTip() {
412: if (this .toolTip != null) {
413: return this .toolTip;
414: }
415: ValueBinding _vb = getValueBinding("toolTip");
416: if (_vb != null) {
417: return (String) _vb.getValue(getFacesContext());
418: }
419: return null;
420: }
421:
422: /**
423: * <p>Display the text as a tooltip for this component</p>
424: * @see #getToolTip()
425: */
426: public void setToolTip(String toolTip) {
427: this .toolTip = toolTip;
428: }
429:
430: /**
431: * <p>Restore the state of this component.</p>
432: */
433: public void restoreState(FacesContext _context, Object _state) {
434: Object _values[] = (Object[]) _state;
435: super .restoreState(_context, _values[0]);
436: this .border = ((Integer) _values[1]).intValue();
437: this .border_set = ((Boolean) _values[2]).booleanValue();
438: this .borderColor = (String) _values[3];
439: this .cols = (String) _values[4];
440: this .frameBorder = ((Boolean) _values[5]).booleanValue();
441: this .frameBorder_set = ((Boolean) _values[6]).booleanValue();
442: this .frameSpacing = ((Integer) _values[7]).intValue();
443: this .frameSpacing_set = ((Boolean) _values[8]).booleanValue();
444: this .rows = (String) _values[9];
445: this .style = (String) _values[10];
446: this .styleClass = (String) _values[11];
447: this .toolTip = (String) _values[12];
448: }
449:
450: /**
451: * <p>Save the state of this component.</p>
452: */
453: public Object saveState(FacesContext _context) {
454: Object _values[] = new Object[13];
455: _values[0] = super .saveState(_context);
456: _values[1] = new Integer(this .border);
457: _values[2] = this .border_set ? Boolean.TRUE : Boolean.FALSE;
458: _values[3] = this .borderColor;
459: _values[4] = this .cols;
460: _values[5] = this .frameBorder ? Boolean.TRUE : Boolean.FALSE;
461: _values[6] = this .frameBorder_set ? Boolean.TRUE
462: : Boolean.FALSE;
463: _values[7] = new Integer(this .frameSpacing);
464: _values[8] = this .frameSpacing_set ? Boolean.TRUE
465: : Boolean.FALSE;
466: _values[9] = this .rows;
467: _values[10] = this .style;
468: _values[11] = this .styleClass;
469: _values[12] = this.toolTip;
470: return _values;
471: }
472:
473: }
|