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="text-decoration: line-through;"></span><span
051: * style="text-decoration: line-through;"></span><span
052: * style="color: rgb(0, 0, 0);">Use the <code>ui:html</code>
053: * tag to create an <code><html></code>
054: * element in the rendered
055: * HTML page. The </span><code
056: * style="color: rgb(0, 0, 0);">ui:html</code><span
057: * style="color: rgb(0, 0, 0);"> tag must be used as a
058: * child of the <code>ui:page</code>
059: * tag, following </span><code
060: * style="color: rgb(0, 0, 0);"></code><span
061: * style="color: rgb(0, 0, 0);">immediately after the <code>ui:page</code>
062: * tag. This tag is required for pages that are not in a portal
063: * enviroment and not subviews.<br>
064: * </span><br
065: * style="color: rgb(0, 0, 0);">
066: * <span
067: * style="font-weight: bold; color: rgb(0, 0, 0);"></span>
068: * <h3 style="color: rgb(0, 0, 0);">HTML
069: * Elements and Layout</h3>
070: * <span
071: * style="text-decoration: line-through; color: rgb(0, 0, 0);"></span><span
072: * style="color: rgb(0, 0, 0);">The rendered HTML page
073: * includes an </span><code
074: * style="color: rgb(0, 0, 0);"><html></code><span
075: * style="color: rgb(0, 0, 0);">
076: * tag that uses attributes indicated by the attributes you specify with
077: * the </span><code
078: * style="color: rgb(0, 0, 0);">ui:html</code><span
079: * style="color: rgb(0, 0, 0);"> tag in the JSP page. </span><br
080: * style="color: rgb(0, 0, 0);">
081: * <br style="color: rgb(0, 0, 0);">
082: * <h3 style="color: rgb(0, 0, 0);">Theme
083: * Identifiers</h3>
084: * <span style="color: rgb(0, 0, 0);">None.</span><br
085: * style="color: rgb(0, 0, 0);">
086: * <h3 style="color: rgb(0, 0, 0);">Client
087: * Side Javascript Functions</h3>
088: * <span style="color: rgb(0, 0, 0);">None.
089: * </span>
090: * <h3 style="color: rgb(0, 0, 0);">Examples</h3>
091: * <h4 style="color: rgb(0, 0, 0);">Example
092: * 1: Using a <code>ui:html</code>
093: * tag<br>
094: * </h4>
095: * <code style="color: rgb(0, 0, 0);"><ui:page><br>
096: * <ui:html><br>
097: *
098: * <ui:head id="blah"
099: * title="hyperlink test page" /><br>
100: *
101: * <ui:body><br>
102: *
103: *
104: * <ui:form id="form1"><br>
105: *
106: * <ui:hyperlink
107: * id="hyperlinkSubmitsPage" <br>
108: *
109: * label="#{HyperlinkBean.label}" <br>
110: *
111: * action="#{HyperlinkBean.determineWhatToDoFunction}" /><br>
112: *
113: *
114: * </ui:form><br>
115: *
116: * </ui:body><br>
117: * </ui:html><br>
118: * </ui:page></code><br
119: * style="color: rgb(0, 0, 0);">
120: * <span style="color: rgb(0, 0, 0);"><br>
121: * </span><span
122: * style="color: rgb(0, 0, 0);"></span><code
123: * style="color: rgb(0, 0, 0);"><br>
124: * </code>
125: * <p>Auto-generated component class.
126: * Do <strong>NOT</strong> modify; all changes
127: * <strong>will</strong> be lost!</p>
128: */
129:
130: public abstract class HtmlBase extends
131: javax.faces.component.UIComponentBase {
132:
133: /**
134: * <p>Construct a new <code>HtmlBase</code>.</p>
135: */
136: public HtmlBase() {
137: super ();
138: setRendererType("com.sun.rave.web.ui.Html");
139: }
140:
141: /**
142: * <p>Return the identifier of the component family to which this
143: * component belongs. This identifier, in conjunction with the value
144: * of the <code>rendererType</code> property, may be used to select
145: * the appropriate {@link Renderer} for this component instance.</p>
146: */
147: public String getFamily() {
148: return "com.sun.rave.web.ui.Html";
149: }
150:
151: // lang
152: private String lang = null;
153:
154: /**
155: * <p>Sets the language code for this document</p>
156: */
157: public String getLang() {
158: if (this .lang != null) {
159: return this .lang;
160: }
161: ValueBinding _vb = getValueBinding("lang");
162: if (_vb != null) {
163: return (String) _vb.getValue(getFacesContext());
164: }
165: return null;
166: }
167:
168: /**
169: * <p>Sets the language code for this document</p>
170: * @see #getLang()
171: */
172: public void setLang(String lang) {
173: this .lang = lang;
174: }
175:
176: // xmlns
177: private String xmlns = null;
178:
179: /**
180: * <p>Defines the XML namespace attribute. Default value is:
181: * http://www.w3.org/1999/xhtml</p>
182: */
183: public String getXmlns() {
184: if (this .xmlns != null) {
185: return this .xmlns;
186: }
187: ValueBinding _vb = getValueBinding("xmlns");
188: if (_vb != null) {
189: return (String) _vb.getValue(getFacesContext());
190: }
191: return "http://www.w3.org/1999/xhtml";
192: }
193:
194: /**
195: * <p>Defines the XML namespace attribute. Default value is:
196: * http://www.w3.org/1999/xhtml</p>
197: * @see #getXmlns()
198: */
199: public void setXmlns(String xmlns) {
200: this .xmlns = xmlns;
201: }
202:
203: /**
204: * <p>Restore the state of this component.</p>
205: */
206: public void restoreState(FacesContext _context, Object _state) {
207: Object _values[] = (Object[]) _state;
208: super .restoreState(_context, _values[0]);
209: this .lang = (String) _values[1];
210: this .xmlns = (String) _values[2];
211: }
212:
213: /**
214: * <p>Save the state of this component.</p>
215: */
216: public Object saveState(FacesContext _context) {
217: Object _values[] = new Object[3];
218: _values[0] = super .saveState(_context);
219: _values[1] = this .lang;
220: _values[2] = this.xmlns;
221: return _values;
222: }
223:
224: }
|