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: * Use the ui:hyperlink tag to display a HTML hyperlink to a URL, or a
051: * link that submits a form. If the action attribute is used, the form is
052: * submitted. If the url attribute is used, the link is a normal hyperlink
053: * that sends the browser to a new location.
054: * <br>
055: * <p style="color: rgb(0, 0, 0);">The
056: * <span style="color: rgb(51, 51, 255);"><code
057: * style="color: rgb(0, 0, 0);">ui:imageHyperlink</code><span
058: * style="color: rgb(0, 0, 0);"></span></span>
059: * component
060: * can be also be used to submit forms. If the action attribute is used,
061: * the form is submitted. If the
062: * url attribute is used, the link is a normal hyperlink that sends the
063: * browser to a new location.</p>
064: *
065: * <br>
066: * <h3>HTML Elements and Layout</h3>
067: * The rendered HTML page displays an XHTML <a>
068: * element. If the link submits the
069: * form the onclick will have some additional behavior that the user
070: * should be
071: * aware of. See the onclick attribute below.
072: * <br>
073: * </a>
074: * <h3><a>Client
075: * Side Javascript Functions</a></h3>
076: * <a>None.
077: * <br>
078: * </a>
079: * <h3><a>Examples</a></h3>
080: * <h4><a>Example
081: * 1: Create a hyperlink that submits the form:</a></h4>
082: * <code><a><ui:hyperlink
083: * id="hyperlinktest1"
084: * text="#{HyperlinkBean.text}" action="#{HyperlinkBean.success}"
085: * />
086: * <br>
087: * <br>
088: * </a></code><a>Note:
089: * id can be used as a unique identifier if the hyperlink is
090: * programatically
091: * addressed<br>
092: * </a>
093: * <h4><a>Example
094: * 2: Create a hyperlink that goes to another page:</a></h4>
095: * <code><a><ui:hyperlink
096: * id="hyperlinktest2"
097: * text="#{HyperlinkBean.text}" url="http://www.google.com" />
098: * <br>
099: * <br>
100: * </a></code><a>Note:
101: * url property being set signifies that this *will not*
102: * submit to the server and will be a straight hyperlink
103: * <i><br>
104: * </i>
105: * </a>
106: * <h4><a>Example
107: * 3: Using the body of a hyperlink to render text:</a></h4>
108: * <code><a><ui:hyperlink
109: * id="hyperlinktest3" url="http://www.sun.com"
110: * > <ui:image url="myyahoo.gif"
111: * /><ui:staticText text="more
112: * text" />
113: * </ui:hyperlink>
114: * </a></code>
115: * <h4><a>Example
116: * 4: Using f:params to add additional request parameters when the
117: * hyperlink action is invoked:</a></h4>
118: * <code><a><ui:hyperlink
119: * id="hyperlinktest1" text="#{HyperlinkBean.label}"
120: * action="#{HyperlinkBean.success}" ><br>
121: * <f:param name="testingParam1"
122: * value="success!"/><br>
123: * <f:param name="testingParam2"
124: * value="failure!"/><br>
125: * </ui:hyperlink><br>
126: * <br>
127: * </a></code><a>Note:
128: * After clicking on this hyperlink, the page will be submitted and the
129: * request parameter map will have 2 additional items in it: testingParam1
130: * and testingParam2 with their associtated values<br>
131: * </a><code><a></a></code>
132: * <p>Auto-generated component class.
133: * Do <strong>NOT</strong> modify; all changes
134: * <strong>will</strong> be lost!</p>
135: */
136:
137: public abstract class HyperlinkBase extends
138: javax.faces.component.UICommand {
139:
140: /**
141: * <p>Construct a new <code>HyperlinkBase</code>.</p>
142: */
143: public HyperlinkBase() {
144: super ();
145: setRendererType("com.sun.rave.web.ui.Hyperlink");
146: }
147:
148: /**
149: * <p>Return the identifier of the component family to which this
150: * component belongs. This identifier, in conjunction with the value
151: * of the <code>rendererType</code> property, may be used to select
152: * the appropriate {@link Renderer} for this component instance.</p>
153: */
154: public String getFamily() {
155: return "com.sun.rave.web.ui.Hyperlink";
156: }
157:
158: /**
159: * <p>Return the <code>ValueBinding</code> stored for the
160: * specified name (if any), respecting any property aliases.</p>
161: *
162: * @param name Name of value binding to retrieve
163: */
164: public ValueBinding getValueBinding(String name) {
165: if (name.equals("text")) {
166: return super .getValueBinding("value");
167: }
168: return super .getValueBinding(name);
169: }
170:
171: /**
172: * <p>Set the <code>ValueBinding</code> stored for the
173: * specified name (if any), respecting any property
174: * aliases.</p>
175: *
176: * @param name Name of value binding to set
177: * @param binding ValueBinding to set, or null to remove
178: */
179: public void setValueBinding(String name, ValueBinding binding) {
180: if (name.equals("text")) {
181: super .setValueBinding("value", binding);
182: return;
183: }
184: super .setValueBinding(name, binding);
185: }
186:
187: // action
188: private javax.faces.el.MethodBinding action = null;
189:
190: /**
191: * <p>Method binding representing a method that processes
192: * application actions from this component.</p>
193: */
194: public javax.faces.el.MethodBinding getAction() {
195: if (this .action != null) {
196: return this .action;
197: }
198: ValueBinding _vb = getValueBinding("action");
199: if (_vb != null) {
200: return (javax.faces.el.MethodBinding) _vb
201: .getValue(getFacesContext());
202: }
203: return null;
204: }
205:
206: /**
207: * <p>Method binding representing a method that processes
208: * application actions from this component.</p>
209: * @see #getAction()
210: */
211: public void setAction(javax.faces.el.MethodBinding action) {
212: this .action = action;
213: }
214:
215: // actionListener
216: private javax.faces.el.MethodBinding actionListener = null;
217:
218: /**
219: * <p>Method binding representing a method that receives action from this, and possibly other, components.</p>
220: */
221: public javax.faces.el.MethodBinding getActionListener() {
222: if (this .actionListener != null) {
223: return this .actionListener;
224: }
225: ValueBinding _vb = getValueBinding("actionListener");
226: if (_vb != null) {
227: return (javax.faces.el.MethodBinding) _vb
228: .getValue(getFacesContext());
229: }
230: return null;
231: }
232:
233: /**
234: * <p>Method binding representing a method that receives action from this, and possibly other, components.</p>
235: * @see #getActionListener()
236: */
237: public void setActionListener(
238: javax.faces.el.MethodBinding actionListener) {
239: this .actionListener = actionListener;
240: }
241:
242: // disabled
243: private boolean disabled = false;
244: private boolean disabled_set = false;
245:
246: /**
247: * <p>Flag indicating that the user is not permitted to activate this
248: * component, and that the component's value will not be submitted with the
249: * form.</p>
250: */
251: public boolean isDisabled() {
252: if (this .disabled_set) {
253: return this .disabled;
254: }
255: ValueBinding _vb = getValueBinding("disabled");
256: if (_vb != null) {
257: Object _result = _vb.getValue(getFacesContext());
258: if (_result == null) {
259: return false;
260: } else {
261: return ((Boolean) _result).booleanValue();
262: }
263: }
264: return false;
265: }
266:
267: /**
268: * <p>Flag indicating that the user is not permitted to activate this
269: * component, and that the component's value will not be submitted with the
270: * form.</p>
271: * @see #isDisabled()
272: */
273: public void setDisabled(boolean disabled) {
274: this .disabled = disabled;
275: this .disabled_set = true;
276: }
277:
278: // onBlur
279: private String onBlur = null;
280:
281: /**
282: * <p>Scripting code executed when this element loses focus.</p>
283: */
284: public String getOnBlur() {
285: if (this .onBlur != null) {
286: return this .onBlur;
287: }
288: ValueBinding _vb = getValueBinding("onBlur");
289: if (_vb != null) {
290: return (String) _vb.getValue(getFacesContext());
291: }
292: return null;
293: }
294:
295: /**
296: * <p>Scripting code executed when this element loses focus.</p>
297: * @see #getOnBlur()
298: */
299: public void setOnBlur(String onBlur) {
300: this .onBlur = onBlur;
301: }
302:
303: // onClick
304: private String onClick = null;
305:
306: /**
307: * <p>Scripting code executed when a mouse click occurs over this component.
308: * If the component submits the form, the script should not
309: * return from this function. The return will be handled by the script
310: * that is appended to the onclick. It is ok to return from this script
311: * to abort the submit process if necessary.</p>
312: */
313: public String getOnClick() {
314: if (this .onClick != null) {
315: return this .onClick;
316: }
317: ValueBinding _vb = getValueBinding("onClick");
318: if (_vb != null) {
319: return (String) _vb.getValue(getFacesContext());
320: }
321: return null;
322: }
323:
324: /**
325: * <p>Scripting code executed when a mouse click occurs over this component.
326: * If the component submits the form, the script should not
327: * return from this function. The return will be handled by the script
328: * that is appended to the onclick. It is ok to return from this script
329: * to abort the submit process if necessary.</p>
330: * @see #getOnClick()
331: */
332: public void setOnClick(String onClick) {
333: this .onClick = onClick;
334: }
335:
336: // onDblClick
337: private String onDblClick = null;
338:
339: /**
340: * <p>Scripting code executed when a mouse double click
341: * occurs over this component.</p>
342: */
343: public String getOnDblClick() {
344: if (this .onDblClick != null) {
345: return this .onDblClick;
346: }
347: ValueBinding _vb = getValueBinding("onDblClick");
348: if (_vb != null) {
349: return (String) _vb.getValue(getFacesContext());
350: }
351: return null;
352: }
353:
354: /**
355: * <p>Scripting code executed when a mouse double click
356: * occurs over this component.</p>
357: * @see #getOnDblClick()
358: */
359: public void setOnDblClick(String onDblClick) {
360: this .onDblClick = onDblClick;
361: }
362:
363: // onFocus
364: private String onFocus = null;
365:
366: /**
367: * <p>Scripting code executed when this component receives focus. An
368: * element receives focus when the user selects the element by pressing
369: * the tab key or clicking the mouse.</p>
370: */
371: public String getOnFocus() {
372: if (this .onFocus != null) {
373: return this .onFocus;
374: }
375: ValueBinding _vb = getValueBinding("onFocus");
376: if (_vb != null) {
377: return (String) _vb.getValue(getFacesContext());
378: }
379: return null;
380: }
381:
382: /**
383: * <p>Scripting code executed when this component receives focus. An
384: * element receives focus when the user selects the element by pressing
385: * the tab key or clicking the mouse.</p>
386: * @see #getOnFocus()
387: */
388: public void setOnFocus(String onFocus) {
389: this .onFocus = onFocus;
390: }
391:
392: // onKeyDown
393: private String onKeyDown = null;
394:
395: /**
396: * <p>Scripting code executed when the user presses down on a key while the
397: * component has focus.</p>
398: */
399: public String getOnKeyDown() {
400: if (this .onKeyDown != null) {
401: return this .onKeyDown;
402: }
403: ValueBinding _vb = getValueBinding("onKeyDown");
404: if (_vb != null) {
405: return (String) _vb.getValue(getFacesContext());
406: }
407: return null;
408: }
409:
410: /**
411: * <p>Scripting code executed when the user presses down on a key while the
412: * component has focus.</p>
413: * @see #getOnKeyDown()
414: */
415: public void setOnKeyDown(String onKeyDown) {
416: this .onKeyDown = onKeyDown;
417: }
418:
419: // onKeyPress
420: private String onKeyPress = null;
421:
422: /**
423: * <p>Scripting code executed when the user presses and releases a key while
424: * the component has focus.</p>
425: */
426: public String getOnKeyPress() {
427: if (this .onKeyPress != null) {
428: return this .onKeyPress;
429: }
430: ValueBinding _vb = getValueBinding("onKeyPress");
431: if (_vb != null) {
432: return (String) _vb.getValue(getFacesContext());
433: }
434: return null;
435: }
436:
437: /**
438: * <p>Scripting code executed when the user presses and releases a key while
439: * the component has focus.</p>
440: * @see #getOnKeyPress()
441: */
442: public void setOnKeyPress(String onKeyPress) {
443: this .onKeyPress = onKeyPress;
444: }
445:
446: // onKeyUp
447: private String onKeyUp = null;
448:
449: /**
450: * <p>Scripting code executed when the user releases a key while the
451: * component has focus.</p>
452: */
453: public String getOnKeyUp() {
454: if (this .onKeyUp != null) {
455: return this .onKeyUp;
456: }
457: ValueBinding _vb = getValueBinding("onKeyUp");
458: if (_vb != null) {
459: return (String) _vb.getValue(getFacesContext());
460: }
461: return null;
462: }
463:
464: /**
465: * <p>Scripting code executed when the user releases a key while the
466: * component has focus.</p>
467: * @see #getOnKeyUp()
468: */
469: public void setOnKeyUp(String onKeyUp) {
470: this .onKeyUp = onKeyUp;
471: }
472:
473: // onMouseDown
474: private String onMouseDown = null;
475:
476: /**
477: * <p>Scripting code executed when the user presses a mouse button while the
478: * mouse pointer is on the component.</p>
479: */
480: public String getOnMouseDown() {
481: if (this .onMouseDown != null) {
482: return this .onMouseDown;
483: }
484: ValueBinding _vb = getValueBinding("onMouseDown");
485: if (_vb != null) {
486: return (String) _vb.getValue(getFacesContext());
487: }
488: return null;
489: }
490:
491: /**
492: * <p>Scripting code executed when the user presses a mouse button while the
493: * mouse pointer is on the component.</p>
494: * @see #getOnMouseDown()
495: */
496: public void setOnMouseDown(String onMouseDown) {
497: this .onMouseDown = onMouseDown;
498: }
499:
500: // onMouseMove
501: private String onMouseMove = null;
502:
503: /**
504: * <p>Scripting code executed when the user moves the mouse pointer while
505: * over the component.</p>
506: */
507: public String getOnMouseMove() {
508: if (this .onMouseMove != null) {
509: return this .onMouseMove;
510: }
511: ValueBinding _vb = getValueBinding("onMouseMove");
512: if (_vb != null) {
513: return (String) _vb.getValue(getFacesContext());
514: }
515: return null;
516: }
517:
518: /**
519: * <p>Scripting code executed when the user moves the mouse pointer while
520: * over the component.</p>
521: * @see #getOnMouseMove()
522: */
523: public void setOnMouseMove(String onMouseMove) {
524: this .onMouseMove = onMouseMove;
525: }
526:
527: // onMouseOut
528: private String onMouseOut = null;
529:
530: /**
531: * <p>Scripting code executed when a mouse out movement
532: * occurs over this component.</p>
533: */
534: public String getOnMouseOut() {
535: if (this .onMouseOut != null) {
536: return this .onMouseOut;
537: }
538: ValueBinding _vb = getValueBinding("onMouseOut");
539: if (_vb != null) {
540: return (String) _vb.getValue(getFacesContext());
541: }
542: return null;
543: }
544:
545: /**
546: * <p>Scripting code executed when a mouse out movement
547: * occurs over this component.</p>
548: * @see #getOnMouseOut()
549: */
550: public void setOnMouseOut(String onMouseOut) {
551: this .onMouseOut = onMouseOut;
552: }
553:
554: // onMouseOver
555: private String onMouseOver = null;
556:
557: /**
558: * <p>Scripting code executed when the user moves the mouse pointer into
559: * the boundary of this component.</p>
560: */
561: public String getOnMouseOver() {
562: if (this .onMouseOver != null) {
563: return this .onMouseOver;
564: }
565: ValueBinding _vb = getValueBinding("onMouseOver");
566: if (_vb != null) {
567: return (String) _vb.getValue(getFacesContext());
568: }
569: return null;
570: }
571:
572: /**
573: * <p>Scripting code executed when the user moves the mouse pointer into
574: * the boundary of this component.</p>
575: * @see #getOnMouseOver()
576: */
577: public void setOnMouseOver(String onMouseOver) {
578: this .onMouseOver = onMouseOver;
579: }
580:
581: // onMouseUp
582: private String onMouseUp = null;
583:
584: /**
585: * <p>Scripting code executed when the user releases a mouse button while
586: * the mouse pointer is on the component.</p>
587: */
588: public String getOnMouseUp() {
589: if (this .onMouseUp != null) {
590: return this .onMouseUp;
591: }
592: ValueBinding _vb = getValueBinding("onMouseUp");
593: if (_vb != null) {
594: return (String) _vb.getValue(getFacesContext());
595: }
596: return null;
597: }
598:
599: /**
600: * <p>Scripting code executed when the user releases a mouse button while
601: * the mouse pointer is on the component.</p>
602: * @see #getOnMouseUp()
603: */
604: public void setOnMouseUp(String onMouseUp) {
605: this .onMouseUp = onMouseUp;
606: }
607:
608: // shape
609: private String shape = null;
610:
611: /**
612: * <p>The shape of the hot spot on the screen (for use in client-side image
613: * maps). Valid values are: default (entire region); rect (rectangular
614: * region); circle (circular region); and poly (polygonal region).</p>
615: */
616: public String getShape() {
617: if (this .shape != null) {
618: return this .shape;
619: }
620: ValueBinding _vb = getValueBinding("shape");
621: if (_vb != null) {
622: return (String) _vb.getValue(getFacesContext());
623: }
624: return null;
625: }
626:
627: /**
628: * <p>The shape of the hot spot on the screen (for use in client-side image
629: * maps). Valid values are: default (entire region); rect (rectangular
630: * region); circle (circular region); and poly (polygonal region).</p>
631: * @see #getShape()
632: */
633: public void setShape(String shape) {
634: this .shape = shape;
635: }
636:
637: // style
638: private String style = null;
639:
640: /**
641: * <p>CSS style(s) to be applied when this component is rendered.</p>
642: */
643: public String getStyle() {
644: if (this .style != null) {
645: return this .style;
646: }
647: ValueBinding _vb = getValueBinding("style");
648: if (_vb != null) {
649: return (String) _vb.getValue(getFacesContext());
650: }
651: return null;
652: }
653:
654: /**
655: * <p>CSS style(s) to be applied when this component is rendered.</p>
656: * @see #getStyle()
657: */
658: public void setStyle(String style) {
659: this .style = style;
660: }
661:
662: // styleClass
663: private String styleClass = null;
664:
665: /**
666: * <p>CSS style class(es) to be applied when this component is rendered.</p>
667: */
668: public String getStyleClass() {
669: if (this .styleClass != null) {
670: return this .styleClass;
671: }
672: ValueBinding _vb = getValueBinding("styleClass");
673: if (_vb != null) {
674: return (String) _vb.getValue(getFacesContext());
675: }
676: return null;
677: }
678:
679: /**
680: * <p>CSS style class(es) to be applied when this component is rendered.</p>
681: * @see #getStyleClass()
682: */
683: public void setStyleClass(String styleClass) {
684: this .styleClass = styleClass;
685: }
686:
687: // tabIndex
688: private int tabIndex = Integer.MIN_VALUE;
689: private boolean tabIndex_set = false;
690:
691: /**
692: * <p>The position of this component in the tabbing order sequence</p>
693: */
694: public int getTabIndex() {
695: if (this .tabIndex_set) {
696: return this .tabIndex;
697: }
698: ValueBinding _vb = getValueBinding("tabIndex");
699: if (_vb != null) {
700: Object _result = _vb.getValue(getFacesContext());
701: if (_result == null) {
702: return Integer.MIN_VALUE;
703: } else {
704: return ((Integer) _result).intValue();
705: }
706: }
707: return Integer.MIN_VALUE;
708: }
709:
710: /**
711: * <p>The position of this component in the tabbing order sequence</p>
712: * @see #getTabIndex()
713: */
714: public void setTabIndex(int tabIndex) {
715: this .tabIndex = tabIndex;
716: this .tabIndex_set = true;
717: }
718:
719: // target
720: private String target = null;
721:
722: /**
723: * <p>The resource at the specified URL is displayed in the frame that is
724: * specified with the target attribute. Values such as "_blank" that are
725: * valid for the target attribute of a HTML anchor element are also valid
726: * for this attribute in this component</p>
727: */
728: public String getTarget() {
729: if (this .target != null) {
730: return this .target;
731: }
732: ValueBinding _vb = getValueBinding("target");
733: if (_vb != null) {
734: return (String) _vb.getValue(getFacesContext());
735: }
736: return null;
737: }
738:
739: /**
740: * <p>The resource at the specified URL is displayed in the frame that is
741: * specified with the target attribute. Values such as "_blank" that are
742: * valid for the target attribute of a HTML anchor element are also valid
743: * for this attribute in this component</p>
744: * @see #getTarget()
745: */
746: public void setTarget(String target) {
747: this .target = target;
748: }
749:
750: // text
751: /**
752: * <p>The text description of the hyperlink</p>
753: */
754: public Object getText() {
755: return getValue();
756: }
757:
758: /**
759: * <p>The text description of the hyperlink</p>
760: * @see #getText()
761: */
762: public void setText(Object text) {
763: setValue(text);
764: }
765:
766: // toolTip
767: private String toolTip = null;
768:
769: /**
770: * <p>Display the text as a tooltip for this component</p>
771: */
772: public String getToolTip() {
773: if (this .toolTip != null) {
774: return this .toolTip;
775: }
776: ValueBinding _vb = getValueBinding("toolTip");
777: if (_vb != null) {
778: return (String) _vb.getValue(getFacesContext());
779: }
780: return null;
781: }
782:
783: /**
784: * <p>Display the text as a tooltip for this component</p>
785: * @see #getToolTip()
786: */
787: public void setToolTip(String toolTip) {
788: this .toolTip = toolTip;
789: }
790:
791: // type
792: private String type = null;
793:
794: /**
795: * <p>The MIME content type of the resource specified by this component.</p>
796: */
797: public String getType() {
798: if (this .type != null) {
799: return this .type;
800: }
801: ValueBinding _vb = getValueBinding("type");
802: if (_vb != null) {
803: return (String) _vb.getValue(getFacesContext());
804: }
805: return null;
806: }
807:
808: /**
809: * <p>The MIME content type of the resource specified by this component.</p>
810: * @see #getType()
811: */
812: public void setType(String type) {
813: this .type = type;
814: }
815:
816: // url
817: private String url = null;
818:
819: /**
820: * <p>Absolute, relative, or context relative (starting with "/") URL to the
821: * resource selected by this hyperlink. If not specified, clicking this
822: * hyperlink will submit the surrounding form.</p>
823: */
824: public String getUrl() {
825: if (this .url != null) {
826: return this .url;
827: }
828: ValueBinding _vb = getValueBinding("url");
829: if (_vb != null) {
830: return (String) _vb.getValue(getFacesContext());
831: }
832: return null;
833: }
834:
835: /**
836: * <p>Absolute, relative, or context relative (starting with "/") URL to the
837: * resource selected by this hyperlink. If not specified, clicking this
838: * hyperlink will submit the surrounding form.</p>
839: * @see #getUrl()
840: */
841: public void setUrl(String url) {
842: this .url = url;
843: }
844:
845: // urlLang
846: private String urlLang = null;
847:
848: /**
849: * <p>The language code of the resource designated by this hyperlink.</p>
850: */
851: public String getUrlLang() {
852: if (this .urlLang != null) {
853: return this .urlLang;
854: }
855: ValueBinding _vb = getValueBinding("urlLang");
856: if (_vb != null) {
857: return (String) _vb.getValue(getFacesContext());
858: }
859: return null;
860: }
861:
862: /**
863: * <p>The language code of the resource designated by this hyperlink.</p>
864: * @see #getUrlLang()
865: */
866: public void setUrlLang(String urlLang) {
867: this .urlLang = urlLang;
868: }
869:
870: // visible
871: private boolean visible = false;
872: private boolean visible_set = false;
873:
874: /**
875: * <p>Use the visible attribute to indicate whether the component should be
876: * viewable by the user in the rendered HTML page. If set to false, the
877: * HTML code for the component is present in the page, but the component
878: * is hidden with style attributes. By default, visible is set to true, so
879: * HTML for the component HTML is included and visible to the user. If the
880: * component is not visible, it can still be processed on subsequent form
881: * submissions because the HTML is present.</p>
882: */
883: public boolean isVisible() {
884: if (this .visible_set) {
885: return this .visible;
886: }
887: ValueBinding _vb = getValueBinding("visible");
888: if (_vb != null) {
889: Object _result = _vb.getValue(getFacesContext());
890: if (_result == null) {
891: return false;
892: } else {
893: return ((Boolean) _result).booleanValue();
894: }
895: }
896: return true;
897: }
898:
899: /**
900: * <p>Use the visible attribute to indicate whether the component should be
901: * viewable by the user in the rendered HTML page. If set to false, the
902: * HTML code for the component is present in the page, but the component
903: * is hidden with style attributes. By default, visible is set to true, so
904: * HTML for the component HTML is included and visible to the user. If the
905: * component is not visible, it can still be processed on subsequent form
906: * submissions because the HTML is present.</p>
907: * @see #isVisible()
908: */
909: public void setVisible(boolean visible) {
910: this .visible = visible;
911: this .visible_set = true;
912: }
913:
914: /**
915: * <p>Restore the state of this component.</p>
916: */
917: public void restoreState(FacesContext _context, Object _state) {
918: Object _values[] = (Object[]) _state;
919: super .restoreState(_context, _values[0]);
920: this .action = (javax.faces.el.MethodBinding) restoreAttachedState(
921: _context, _values[1]);
922: this .actionListener = (javax.faces.el.MethodBinding) restoreAttachedState(
923: _context, _values[2]);
924: this .disabled = ((Boolean) _values[3]).booleanValue();
925: this .disabled_set = ((Boolean) _values[4]).booleanValue();
926: this .onBlur = (String) _values[5];
927: this .onClick = (String) _values[6];
928: this .onDblClick = (String) _values[7];
929: this .onFocus = (String) _values[8];
930: this .onKeyDown = (String) _values[9];
931: this .onKeyPress = (String) _values[10];
932: this .onKeyUp = (String) _values[11];
933: this .onMouseDown = (String) _values[12];
934: this .onMouseMove = (String) _values[13];
935: this .onMouseOut = (String) _values[14];
936: this .onMouseOver = (String) _values[15];
937: this .onMouseUp = (String) _values[16];
938: this .shape = (String) _values[17];
939: this .style = (String) _values[18];
940: this .styleClass = (String) _values[19];
941: this .tabIndex = ((Integer) _values[20]).intValue();
942: this .tabIndex_set = ((Boolean) _values[21]).booleanValue();
943: this .target = (String) _values[22];
944: this .toolTip = (String) _values[23];
945: this .type = (String) _values[24];
946: this .url = (String) _values[25];
947: this .urlLang = (String) _values[26];
948: this .visible = ((Boolean) _values[27]).booleanValue();
949: this .visible_set = ((Boolean) _values[28]).booleanValue();
950: }
951:
952: /**
953: * <p>Save the state of this component.</p>
954: */
955: public Object saveState(FacesContext _context) {
956: Object _values[] = new Object[29];
957: _values[0] = super .saveState(_context);
958: _values[1] = saveAttachedState(_context, action);
959: _values[2] = saveAttachedState(_context, actionListener);
960: _values[3] = this .disabled ? Boolean.TRUE : Boolean.FALSE;
961: _values[4] = this .disabled_set ? Boolean.TRUE : Boolean.FALSE;
962: _values[5] = this .onBlur;
963: _values[6] = this .onClick;
964: _values[7] = this .onDblClick;
965: _values[8] = this .onFocus;
966: _values[9] = this .onKeyDown;
967: _values[10] = this .onKeyPress;
968: _values[11] = this .onKeyUp;
969: _values[12] = this .onMouseDown;
970: _values[13] = this .onMouseMove;
971: _values[14] = this .onMouseOut;
972: _values[15] = this .onMouseOver;
973: _values[16] = this .onMouseUp;
974: _values[17] = this .shape;
975: _values[18] = this .style;
976: _values[19] = this .styleClass;
977: _values[20] = new Integer(this .tabIndex);
978: _values[21] = this .tabIndex_set ? Boolean.TRUE : Boolean.FALSE;
979: _values[22] = this .target;
980: _values[23] = this .toolTip;
981: _values[24] = this .type;
982: _values[25] = this .url;
983: _values[26] = this .urlLang;
984: _values[27] = this .visible ? Boolean.TRUE : Boolean.FALSE;
985: _values[28] = this.visible_set ? Boolean.TRUE : Boolean.FALSE;
986: return _values;
987: }
988:
989: }
|