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:iconHyperlink</code>
052: * tag to display a clickable icon image from the current theme in the
053: * rendered HTML page. The <code>iconHyperlink</code>
054: * component is
055: * essentially a subclass of the <code>imageHyperlink</code>
056: * component.
057: * The <code>ui:iconHyperlink</code>
058: * tag allows you to use an
059: * icon (a small image) from the current theme. Currently the list of
060: * icons that you can use is not publicly supported, but the icon names
061: * are specified in the <code>/com/sun/rave/web/ui/suntheme/SunTheme.properties</code>
062: * file. The names are listed as resource keys of the format <code>image.ICON_NAME.</code>
063: * Use only the part of the key that follows <code>image.
064: * </code>For
065: * example, if the key is <code>image.ALARM_CRITICAL_SMALL</code>,
066: * you
067: * should use <code>ALARM_CRITICAL_SMALL
068: * </code>as the specified
069: * icon name in the <code>ui:iconHyperlink</code>
070: * tag. In the near future a
071: * supported list will be published. This tag is based on a <code>ui:hyperlink</code>
072: * tag and functions the same way. The main difference is this
073: * tag will format an image with a surrounding hyperlink. See
074: * the <code>ui:hyperlink</code>
075: * tag for more examples on using a hyperlink</span>
076: * <p style="color: rgb(0, 0, 0);">The
077: * iconHyperlink component
078: * can be also be used to submit forms. If the action attribute is used,
079: * the form is submitted. If the
080: * url attribute is used, the link is a normal hyperlink that sends the
081: * browser to a new location.</p>
082: * <h3 style="color: rgb(0, 0, 0);">HTML
083: * Elements and Layout<br>
084: * </h3>
085: * <p style="color: rgb(0, 0, 0);">The
086: * rendered HTML page displays....<br>
087: * </p>
088: * <h3 style="color: rgb(0, 0, 0);">Theme
089: * Identifiers</h3>
090: * <span style="color: rgb(0, 0, 0);">None.</span>
091: * <h3 style="color: rgb(0, 0, 0);">Client-side
092: * JavaScript functions<br>
093: * </h3>
094: * <p style="color: rgb(0, 0, 0);">
095: * None. <br>
096: * </p>
097: * <h3 style="color: rgb(0, 0, 0);">Examples</h3>
098: * <h4 style="color: rgb(0, 0, 0);">Example
099: * 1: Create an IconHyperlink using <span
100: * style="text-decoration: line-through;">showing</span>
101: * the required
102: * indicator <br>
103: * </h4>
104: * <span style="color: rgb(0, 0, 0);">
105: * </span><code
106: * style="color: rgb(0, 0, 0);"><ui:iconHyperlink
107: * id="iconhyperlinktest1" <br>
108: *
109: * icon="LABEL_REQUIRED_ICON"
110: * <br>
111: *
112: * action="#{HyperlinkBean.getRequiredHelp}" />
113: * <br>
114: * </code><code
115: * style="color: rgb(0, 0, 0);"><a>
116: * </a></code>
117: * <p>Auto-generated component class.
118: * Do <strong>NOT</strong> modify; all changes
119: * <strong>will</strong> be lost!</p>
120: */
121:
122: public abstract class IconHyperlinkBase extends
123: com.sun.rave.web.ui.component.ImageHyperlink {
124:
125: /**
126: * <p>Construct a new <code>IconHyperlinkBase</code>.</p>
127: */
128: public IconHyperlinkBase() {
129: super ();
130: setRendererType("com.sun.rave.web.ui.IconHyperlink");
131: }
132:
133: /**
134: * <p>Return the identifier of the component family to which this
135: * component belongs. This identifier, in conjunction with the value
136: * of the <code>rendererType</code> property, may be used to select
137: * the appropriate {@link Renderer} for this component instance.</p>
138: */
139: public String getFamily() {
140: return "com.sun.rave.web.ui.IconHyperlink";
141: }
142:
143: /**
144: * <p>Restore the state of this component.</p>
145: */
146: public void restoreState(FacesContext _context, Object _state) {
147: Object _values[] = (Object[]) _state;
148: super .restoreState(_context, _values[0]);
149: }
150:
151: /**
152: * <p>Save the state of this component.</p>
153: */
154: public Object saveState(FacesContext _context) {
155: Object _values[] = new Object[1];
156: _values[0] = super.saveState(_context);
157: return _values;
158: }
159:
160: }
|