Source Code Cross Referenced for PageBase.java in  » IDE-Netbeans » visualweb.api.designer » com » sun » rave » web » ui » component » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » visualweb.api.designer » com.sun.rave.web.ui.component 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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 the ui:page tag to indicate the
051:         * beginning of the part of the JSP page that is used by the Sun Java Web
052:         * UI Components. All the JSF components used in the page must be nested
053:         * within the ui:page tag. You must use the ui:html and ui:head tags
054:         * first, after the opening of the ui:page tag.&nbsp;&nbsp;Then you must use either
055:         * the ui:body tag or the ui:frameset tag.&nbsp;&nbsp;The ui:page tag takes care of 
056:         * generating the preamble for the HTML page.</span><br>
057:         * <h3 style="color: rgb(0, 0, 0);">HTML Elements and Layout</h3>
058:         * 
059:         * <p style="color: rgb(0, 0, 0);">If the application is used in
060:         * a servlet environment, the rendered HTML will include <code>&lt;?xml&gt;</code>
061:         * and <code>&lt;!DOCTYPE&gt;</code> headers. The content of the headers
062:         * is determined by the <code>ui:page</code>
063:         * attributes that you
064:         * specify.&nbsp; Use the frameset and xhtml attributes to create the <code>&lt;!DOCTYPE&gt;</code>
065:         * header that you want.&nbsp; For example, if you set frameset and xhtml
066:         * attributes to true, the rendered <code>&lt;!DOCTYPE&gt;</code> header
067:         * will indicate XHTML Frameset, as in the following example:<br>
068:         * </p>
069:         * <pre style="color: rgb(0, 0, 0);">&lt;!DOCTYPE HTML <br> PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"<br> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"&gt;<br><br></pre>
070:         * <span style="color: rgb(0, 0, 0);">If you set both attributes to
071:         * false,&nbsp; the rendered <code>&lt;!DOCTYPE&gt;</code>
072:         * header will indicate HTML Transitional,&nbsp; as in the following
073:         * example:<br>
074:         * </span>
075:         * <pre style="color: rgb(0, 0, 0);" wrap="">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;</pre>
076:         * <p style="color: rgb(0, 0, 0);">You can also use the frameset and xhtml
077:         * attributes
078:         * to specify&nbsp; XHTML
079:         * Transitional and HTML Frameset.<br>
080:         * </p>
081:         * <h3 style="color: rgb(0, 0, 0);">Client Side Javascript Functions</h3>
082:         * <span style="color: rgb(0, 0, 0);">None.
083:         * </span><br style="color: rgb(0, 0, 0);">
084:         * <h3 style="color: rgb(0, 0, 0);">Example</h3>
085:         * <b style="color: rgb(0, 0, 0);">Example 1: Using the page tag
086:         * appropriately in a JSP page:<br>
087:         * <br>
088:         * </b><code style="color: rgb(0, 0, 0);">&lt;?xml version="1.0"
089:         * encoding="UTF-8"?&gt;<br>
090:         * &lt;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"&gt;<br>
094:         * &lt;jsp:directive.page contentType="text/html;charset=ISO-8859-1"
095:         * pageEncoding="UTF-8"/&gt;<br>
096:         * &lt;f:view&gt;<br>
097:         * &nbsp; <span style="font-weight: bold;">&lt;ui:page&gt;</span><br>
098:         * &nbsp;&nbsp;&nbsp; &lt;ui:html&gt;<br>
099:         * &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <span style="font-weight: bold;">......<br>
100:         * &nbsp;&nbsp;&nbsp; &lt;</span>/ui:html&gt;<br>
101:         * &nbsp; &lt;/ui:page&gt;<br>
102:         * &lt;/f:view&gt;<br>
103:         * </code><b style="color: rgb(0, 0, 0);"><span
104:         * style="font-family: monospace;"></span></b>
105:         * <p>Auto-generated component class.
106:         * Do <strong>NOT</strong> modify; all changes
107:         * <strong>will</strong> be lost!</p>
108:         */
109:
110:        public abstract class PageBase extends
111:                javax.faces.component.UIComponentBase {
112:
113:            /**
114:             * <p>Construct a new <code>PageBase</code>.</p>
115:             */
116:            public PageBase() {
117:                super ();
118:                setRendererType("com.sun.rave.web.ui.Page");
119:            }
120:
121:            /**
122:             * <p>Return the identifier of the component family to which this
123:             * component belongs.  This identifier, in conjunction with the value
124:             * of the <code>rendererType</code> property, may be used to select
125:             * the appropriate {@link Renderer} for this component instance.</p>
126:             */
127:            public String getFamily() {
128:                return "com.sun.rave.web.ui.Page";
129:            }
130:
131:            // frame
132:            private boolean frame = false;
133:            private boolean frame_set = false;
134:
135:            /**
136:             * <p>Use the frame attribute to
137:             * indicate whether the page should render frames. If this attribute is
138:             * true, the rendered HTML page includes a </span><code
139:             * style="color: rgb(0, 0, 0);">&lt;frameset&gt;</code><span
140:             * style="color: rgb(0, 0, 0);"> element. If false, the rendered page
141:             * uses a </span><code style="color: rgb(0, 0, 0);">&lt;body&gt;</code><span
142:             * style="color: rgb(0, 0, 0);"> tag.&nbsp; This attribute also
143:             * influences the rendering of the <code>&lt;!DOCTYPE&gt;</code>
144:             * declaration. If frameset is true, the <code>&lt;!DOCTYPE&gt;</code> will
145:             * be one of the following,
146:             * depending on the setting of xhtml attribute.<br><pre style="color: rgb(0, 0, 0);">&lt;!DOCTYPE html <br> PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"<br> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"&gt;<br><br>&lt;!DOCTYPE html <br> PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"<br> "http://www.w3.org/TR/html4/DTD/frameset.dtd"&gt;<br></pre></p>
147:             */
148:            public boolean isFrame() {
149:                if (this .frame_set) {
150:                    return this .frame;
151:                }
152:                ValueBinding _vb = getValueBinding("frame");
153:                if (_vb != null) {
154:                    Object _result = _vb.getValue(getFacesContext());
155:                    if (_result == null) {
156:                        return false;
157:                    } else {
158:                        return ((Boolean) _result).booleanValue();
159:                    }
160:                }
161:                return false;
162:            }
163:
164:            /**
165:             * <p>Use the frame attribute to
166:             * indicate whether the page should render frames. If this attribute is
167:             * true, the rendered HTML page includes a </span><code
168:             * style="color: rgb(0, 0, 0);">&lt;frameset&gt;</code><span
169:             * style="color: rgb(0, 0, 0);"> element. If false, the rendered page
170:             * uses a </span><code style="color: rgb(0, 0, 0);">&lt;body&gt;</code><span
171:             * style="color: rgb(0, 0, 0);"> tag.&nbsp; This attribute also
172:             * influences the rendering of the <code>&lt;!DOCTYPE&gt;</code>
173:             * declaration. If frameset is true, the <code>&lt;!DOCTYPE&gt;</code> will
174:             * be one of the following,
175:             * depending on the setting of xhtml attribute.<br><pre style="color: rgb(0, 0, 0);">&lt;!DOCTYPE html <br> PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"<br> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"&gt;<br><br>&lt;!DOCTYPE html <br> PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"<br> "http://www.w3.org/TR/html4/DTD/frameset.dtd"&gt;<br></pre></p>
176:             * @see #isFrame()
177:             */
178:            public void setFrame(boolean frame) {
179:                this .frame = frame;
180:                this .frame_set = true;
181:            }
182:
183:            // xhtml
184:            private boolean xhtml = false;
185:            private boolean xhtml_set = false;
186:
187:            /**
188:             * <p>XHTML transitional page or HTML transitional page. This attribute influences
189:             *         the rendering of the <code>&lt;!DOCTYPE&gt;</code> declaration. If xhtml
190:             *         is true, the <code>&lt;!DOCTYPE&gt;</code> will be one of the following,
191:             *         depending on the setting of frameset attribute.<br><pre style="color: rgb(0, 0, 0);">&lt;!DOCTYPE html <br> PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"<br> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"</pre><pre style="color: rgb(0, 0, 0);">&lt;!DOCTYPE html <br> PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"<br> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;</pre></p>
192:             */
193:            public boolean isXhtml() {
194:                if (this .xhtml_set) {
195:                    return this .xhtml;
196:                }
197:                ValueBinding _vb = getValueBinding("xhtml");
198:                if (_vb != null) {
199:                    Object _result = _vb.getValue(getFacesContext());
200:                    if (_result == null) {
201:                        return false;
202:                    } else {
203:                        return ((Boolean) _result).booleanValue();
204:                    }
205:                }
206:                return true;
207:            }
208:
209:            /**
210:             * <p>XHTML transitional page or HTML transitional page. This attribute influences
211:             *         the rendering of the <code>&lt;!DOCTYPE&gt;</code> declaration. If xhtml
212:             *         is true, the <code>&lt;!DOCTYPE&gt;</code> will be one of the following,
213:             *         depending on the setting of frameset attribute.<br><pre style="color: rgb(0, 0, 0);">&lt;!DOCTYPE html <br> PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"<br> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"</pre><pre style="color: rgb(0, 0, 0);">&lt;!DOCTYPE html <br> PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"<br> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;</pre></p>
214:             * @see #isXhtml()
215:             */
216:            public void setXhtml(boolean xhtml) {
217:                this .xhtml = xhtml;
218:                this .xhtml_set = true;
219:            }
220:
221:            /**
222:             * <p>Restore the state of this component.</p>
223:             */
224:            public void restoreState(FacesContext _context, Object _state) {
225:                Object _values[] = (Object[]) _state;
226:                super .restoreState(_context, _values[0]);
227:                this .frame = ((Boolean) _values[1]).booleanValue();
228:                this .frame_set = ((Boolean) _values[2]).booleanValue();
229:                this .xhtml = ((Boolean) _values[3]).booleanValue();
230:                this .xhtml_set = ((Boolean) _values[4]).booleanValue();
231:            }
232:
233:            /**
234:             * <p>Save the state of this component.</p>
235:             */
236:            public Object saveState(FacesContext _context) {
237:                Object _values[] = new Object[5];
238:                _values[0] = super .saveState(_context);
239:                _values[1] = this .frame ? Boolean.TRUE : Boolean.FALSE;
240:                _values[2] = this .frame_set ? Boolean.TRUE : Boolean.FALSE;
241:                _values[3] = this .xhtml ? Boolean.TRUE : Boolean.FALSE;
242:                _values[4] = this.xhtml_set ? Boolean.TRUE : Boolean.FALSE;
243:                return _values;
244:            }
245:
246:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.