001: // WARNING: This file was automatically generated. Do not edit it directly,
002: // or you will lose your changes.
003:
004: /*
005: * Licensed to the Apache Software Foundation (ASF) under one
006: * or more contributor license agreements. See the NOTICE file
007: * distributed with this work for additional information
008: * regarding copyright ownership. The ASF licenses this file
009: * to you under the Apache License, Version 2.0 (the
010: * "License"); you may not use this file except in compliance
011: * with the License. You may obtain a copy of the License at
012: *
013: * http://www.apache.org/licenses/LICENSE-2.0
014: *
015: * Unless required by applicable law or agreed to in writing,
016: * software distributed under the License is distributed on an
017: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
018: * KIND, either express or implied. See the License for the
019: * specific language governing permissions and limitations
020: * under the License.
021: */
022: package javax.faces.component.html;
023:
024: import javax.el.ValueExpression;
025: import javax.faces.component.UICommand;
026: import javax.faces.context.FacesContext;
027:
028: /**
029: *
030: * <h4>Events:</h4>
031: * <table border="1" width="100%" cellpadding="3" summary="">
032: * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
033: * <th align="left">Type</th>
034: * <th align="left">Phases</th>
035: * <th align="left">Description</th>
036: * </tr>
037: * <tr class="TableRowColor">
038: * <td valign="top"><code>javax.faces.event.ActionEvent</code></td>
039: * <td valign="top" nowrap>Apply Request Values</td>
040: * <td valign="top">Event delivered when the "action" of the component has been
041: invoked; for example, by clicking on a button. The action may result
042: in page navigation.</td>
043: * </tr>
044: * </table>
045: */
046: public class HtmlCommandButton extends UICommand {
047:
048: static public final String COMPONENT_FAMILY = "javax.faces.Command";
049: static public final String COMPONENT_TYPE = "javax.faces.HtmlCommandButton";
050:
051: /**
052: * Construct an instance of the HtmlCommandButton.
053: */
054: public HtmlCommandButton() {
055: setRendererType("javax.faces.Button");
056: }
057:
058: // Property: style
059: private String _style;
060:
061: /**
062: * Gets CSS styling instructions.
063: *
064: * @return the new style value
065: */
066: public String getStyle() {
067: if (_style != null) {
068: return _style;
069: }
070: ValueExpression expression = getValueExpression("style");
071: if (expression != null) {
072: return (String) expression.getValue(getFacesContext()
073: .getELContext());
074: }
075: return null;
076: }
077:
078: /**
079: * Sets CSS styling instructions.
080: *
081: * @param style the new style value
082: */
083: public void setStyle(String style) {
084: this ._style = style;
085: }
086:
087: // Property: styleClass
088: private String _styleClass;
089:
090: /**
091: * Gets The CSS class for this element. Corresponds to the HTML 'class' attribute.
092: *
093: * @return the new styleClass value
094: */
095: public String getStyleClass() {
096: if (_styleClass != null) {
097: return _styleClass;
098: }
099: ValueExpression expression = getValueExpression("styleClass");
100: if (expression != null) {
101: return (String) expression.getValue(getFacesContext()
102: .getELContext());
103: }
104: return null;
105: }
106:
107: /**
108: * Sets The CSS class for this element. Corresponds to the HTML 'class' attribute.
109: *
110: * @param styleClass the new styleClass value
111: */
112: public void setStyleClass(String styleClass) {
113: this ._styleClass = styleClass;
114: }
115:
116: // Property: dir
117: private String _dir;
118:
119: /**
120: * Gets The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).
121: *
122: * @return the new dir value
123: */
124: public String getDir() {
125: if (_dir != null) {
126: return _dir;
127: }
128: ValueExpression expression = getValueExpression("dir");
129: if (expression != null) {
130: return (String) expression.getValue(getFacesContext()
131: .getELContext());
132: }
133: return null;
134: }
135:
136: /**
137: * Sets The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).
138: *
139: * @param dir the new dir value
140: */
141: public void setDir(String dir) {
142: this ._dir = dir;
143: }
144:
145: // Property: lang
146: private String _lang;
147:
148: /**
149: * Gets The base language of this document.
150: *
151: * @return the new lang value
152: */
153: public String getLang() {
154: if (_lang != null) {
155: return _lang;
156: }
157: ValueExpression expression = getValueExpression("lang");
158: if (expression != null) {
159: return (String) expression.getValue(getFacesContext()
160: .getELContext());
161: }
162: return null;
163: }
164:
165: /**
166: * Sets The base language of this document.
167: *
168: * @param lang the new lang value
169: */
170: public void setLang(String lang) {
171: this ._lang = lang;
172: }
173:
174: // Property: title
175: private String _title;
176:
177: /**
178: * Gets An advisory title for this element. Often used by the user agent as a tooltip.
179: *
180: * @return the new title value
181: */
182: public String getTitle() {
183: if (_title != null) {
184: return _title;
185: }
186: ValueExpression expression = getValueExpression("title");
187: if (expression != null) {
188: return (String) expression.getValue(getFacesContext()
189: .getELContext());
190: }
191: return null;
192: }
193:
194: /**
195: * Sets An advisory title for this element. Often used by the user agent as a tooltip.
196: *
197: * @param title the new title value
198: */
199: public void setTitle(String title) {
200: this ._title = title;
201: }
202:
203: // Property: onclick
204: private String _onclick;
205:
206: /**
207: * Gets Script to be invoked when the element is clicked.
208: *
209: * @return the new onclick value
210: */
211: public String getOnclick() {
212: if (_onclick != null) {
213: return _onclick;
214: }
215: ValueExpression expression = getValueExpression("onclick");
216: if (expression != null) {
217: return (String) expression.getValue(getFacesContext()
218: .getELContext());
219: }
220: return null;
221: }
222:
223: /**
224: * Sets Script to be invoked when the element is clicked.
225: *
226: * @param onclick the new onclick value
227: */
228: public void setOnclick(String onclick) {
229: this ._onclick = onclick;
230: }
231:
232: // Property: ondblclick
233: private String _ondblclick;
234:
235: /**
236: * Gets Script to be invoked when the element is double-clicked.
237: *
238: * @return the new ondblclick value
239: */
240: public String getOndblclick() {
241: if (_ondblclick != null) {
242: return _ondblclick;
243: }
244: ValueExpression expression = getValueExpression("ondblclick");
245: if (expression != null) {
246: return (String) expression.getValue(getFacesContext()
247: .getELContext());
248: }
249: return null;
250: }
251:
252: /**
253: * Sets Script to be invoked when the element is double-clicked.
254: *
255: * @param ondblclick the new ondblclick value
256: */
257: public void setOndblclick(String ondblclick) {
258: this ._ondblclick = ondblclick;
259: }
260:
261: // Property: onmousedown
262: private String _onmousedown;
263:
264: /**
265: * Gets Script to be invoked when the pointing device is pressed over this element.
266: *
267: * @return the new onmousedown value
268: */
269: public String getOnmousedown() {
270: if (_onmousedown != null) {
271: return _onmousedown;
272: }
273: ValueExpression expression = getValueExpression("onmousedown");
274: if (expression != null) {
275: return (String) expression.getValue(getFacesContext()
276: .getELContext());
277: }
278: return null;
279: }
280:
281: /**
282: * Sets Script to be invoked when the pointing device is pressed over this element.
283: *
284: * @param onmousedown the new onmousedown value
285: */
286: public void setOnmousedown(String onmousedown) {
287: this ._onmousedown = onmousedown;
288: }
289:
290: // Property: onmouseup
291: private String _onmouseup;
292:
293: /**
294: * Gets Script to be invoked when the pointing device is released over this element.
295: *
296: * @return the new onmouseup value
297: */
298: public String getOnmouseup() {
299: if (_onmouseup != null) {
300: return _onmouseup;
301: }
302: ValueExpression expression = getValueExpression("onmouseup");
303: if (expression != null) {
304: return (String) expression.getValue(getFacesContext()
305: .getELContext());
306: }
307: return null;
308: }
309:
310: /**
311: * Sets Script to be invoked when the pointing device is released over this element.
312: *
313: * @param onmouseup the new onmouseup value
314: */
315: public void setOnmouseup(String onmouseup) {
316: this ._onmouseup = onmouseup;
317: }
318:
319: // Property: onmouseover
320: private String _onmouseover;
321:
322: /**
323: * Gets Script to be invoked when the pointing device is moved into this element.
324: *
325: * @return the new onmouseover value
326: */
327: public String getOnmouseover() {
328: if (_onmouseover != null) {
329: return _onmouseover;
330: }
331: ValueExpression expression = getValueExpression("onmouseover");
332: if (expression != null) {
333: return (String) expression.getValue(getFacesContext()
334: .getELContext());
335: }
336: return null;
337: }
338:
339: /**
340: * Sets Script to be invoked when the pointing device is moved into this element.
341: *
342: * @param onmouseover the new onmouseover value
343: */
344: public void setOnmouseover(String onmouseover) {
345: this ._onmouseover = onmouseover;
346: }
347:
348: // Property: onmousemove
349: private String _onmousemove;
350:
351: /**
352: * Gets Script to be invoked when the pointing device is moved while it is in this element.
353: *
354: * @return the new onmousemove value
355: */
356: public String getOnmousemove() {
357: if (_onmousemove != null) {
358: return _onmousemove;
359: }
360: ValueExpression expression = getValueExpression("onmousemove");
361: if (expression != null) {
362: return (String) expression.getValue(getFacesContext()
363: .getELContext());
364: }
365: return null;
366: }
367:
368: /**
369: * Sets Script to be invoked when the pointing device is moved while it is in this element.
370: *
371: * @param onmousemove the new onmousemove value
372: */
373: public void setOnmousemove(String onmousemove) {
374: this ._onmousemove = onmousemove;
375: }
376:
377: // Property: onmouseout
378: private String _onmouseout;
379:
380: /**
381: * Gets Script to be invoked when the pointing device is moves out of this element.
382: *
383: * @return the new onmouseout value
384: */
385: public String getOnmouseout() {
386: if (_onmouseout != null) {
387: return _onmouseout;
388: }
389: ValueExpression expression = getValueExpression("onmouseout");
390: if (expression != null) {
391: return (String) expression.getValue(getFacesContext()
392: .getELContext());
393: }
394: return null;
395: }
396:
397: /**
398: * Sets Script to be invoked when the pointing device is moves out of this element.
399: *
400: * @param onmouseout the new onmouseout value
401: */
402: public void setOnmouseout(String onmouseout) {
403: this ._onmouseout = onmouseout;
404: }
405:
406: // Property: onkeypress
407: private String _onkeypress;
408:
409: /**
410: * Gets Script to be invoked when a key is pressed over this element.
411: *
412: * @return the new onkeypress value
413: */
414: public String getOnkeypress() {
415: if (_onkeypress != null) {
416: return _onkeypress;
417: }
418: ValueExpression expression = getValueExpression("onkeypress");
419: if (expression != null) {
420: return (String) expression.getValue(getFacesContext()
421: .getELContext());
422: }
423: return null;
424: }
425:
426: /**
427: * Sets Script to be invoked when a key is pressed over this element.
428: *
429: * @param onkeypress the new onkeypress value
430: */
431: public void setOnkeypress(String onkeypress) {
432: this ._onkeypress = onkeypress;
433: }
434:
435: // Property: onkeydown
436: private String _onkeydown;
437:
438: /**
439: * Gets Script to be invoked when a key is pressed down over this element.
440: *
441: * @return the new onkeydown value
442: */
443: public String getOnkeydown() {
444: if (_onkeydown != null) {
445: return _onkeydown;
446: }
447: ValueExpression expression = getValueExpression("onkeydown");
448: if (expression != null) {
449: return (String) expression.getValue(getFacesContext()
450: .getELContext());
451: }
452: return null;
453: }
454:
455: /**
456: * Sets Script to be invoked when a key is pressed down over this element.
457: *
458: * @param onkeydown the new onkeydown value
459: */
460: public void setOnkeydown(String onkeydown) {
461: this ._onkeydown = onkeydown;
462: }
463:
464: // Property: onkeyup
465: private String _onkeyup;
466:
467: /**
468: * Gets Script to be invoked when a key is released over this element.
469: *
470: * @return the new onkeyup value
471: */
472: public String getOnkeyup() {
473: if (_onkeyup != null) {
474: return _onkeyup;
475: }
476: ValueExpression expression = getValueExpression("onkeyup");
477: if (expression != null) {
478: return (String) expression.getValue(getFacesContext()
479: .getELContext());
480: }
481: return null;
482: }
483:
484: /**
485: * Sets Script to be invoked when a key is released over this element.
486: *
487: * @param onkeyup the new onkeyup value
488: */
489: public void setOnkeyup(String onkeyup) {
490: this ._onkeyup = onkeyup;
491: }
492:
493: // Property: onblur
494: private String _onblur;
495:
496: /**
497: * Gets Specifies a script to be invoked when the element loses focus.
498: *
499: * @return the new onblur value
500: */
501: public String getOnblur() {
502: if (_onblur != null) {
503: return _onblur;
504: }
505: ValueExpression expression = getValueExpression("onblur");
506: if (expression != null) {
507: return (String) expression.getValue(getFacesContext()
508: .getELContext());
509: }
510: return null;
511: }
512:
513: /**
514: * Sets Specifies a script to be invoked when the element loses focus.
515: *
516: * @param onblur the new onblur value
517: */
518: public void setOnblur(String onblur) {
519: this ._onblur = onblur;
520: }
521:
522: // Property: onfocus
523: private String _onfocus;
524:
525: /**
526: * Gets Specifies a script to be invoked when the element receives focus.
527: *
528: * @return the new onfocus value
529: */
530: public String getOnfocus() {
531: if (_onfocus != null) {
532: return _onfocus;
533: }
534: ValueExpression expression = getValueExpression("onfocus");
535: if (expression != null) {
536: return (String) expression.getValue(getFacesContext()
537: .getELContext());
538: }
539: return null;
540: }
541:
542: /**
543: * Sets Specifies a script to be invoked when the element receives focus.
544: *
545: * @param onfocus the new onfocus value
546: */
547: public void setOnfocus(String onfocus) {
548: this ._onfocus = onfocus;
549: }
550:
551: // Property: onchange
552: private String _onchange;
553:
554: /**
555: * Gets Specifies a script to be invoked when the element is modified.
556: *
557: * @return the new onchange value
558: */
559: public String getOnchange() {
560: if (_onchange != null) {
561: return _onchange;
562: }
563: ValueExpression expression = getValueExpression("onchange");
564: if (expression != null) {
565: return (String) expression.getValue(getFacesContext()
566: .getELContext());
567: }
568: return null;
569: }
570:
571: /**
572: * Sets Specifies a script to be invoked when the element is modified.
573: *
574: * @param onchange the new onchange value
575: */
576: public void setOnchange(String onchange) {
577: this ._onchange = onchange;
578: }
579:
580: // Property: onselect
581: private String _onselect;
582:
583: /**
584: * Gets Specifies a script to be invoked when the element is selected.
585: *
586: * @return the new onselect value
587: */
588: public String getOnselect() {
589: if (_onselect != null) {
590: return _onselect;
591: }
592: ValueExpression expression = getValueExpression("onselect");
593: if (expression != null) {
594: return (String) expression.getValue(getFacesContext()
595: .getELContext());
596: }
597: return null;
598: }
599:
600: /**
601: * Sets Specifies a script to be invoked when the element is selected.
602: *
603: * @param onselect the new onselect value
604: */
605: public void setOnselect(String onselect) {
606: this ._onselect = onselect;
607: }
608:
609: // Property: accesskey
610: private String _accesskey;
611:
612: /**
613: * Gets Sets the access key for this element.
614: *
615: * @return the new accesskey value
616: */
617: public String getAccesskey() {
618: if (_accesskey != null) {
619: return _accesskey;
620: }
621: ValueExpression expression = getValueExpression("accesskey");
622: if (expression != null) {
623: return (String) expression.getValue(getFacesContext()
624: .getELContext());
625: }
626: return null;
627: }
628:
629: /**
630: * Sets Sets the access key for this element.
631: *
632: * @param accesskey the new accesskey value
633: */
634: public void setAccesskey(String accesskey) {
635: this ._accesskey = accesskey;
636: }
637:
638: // Property: tabindex
639: private String _tabindex;
640:
641: /**
642: * Gets Specifies the position of this element within the tab order of the document.
643: *
644: * @return the new tabindex value
645: */
646: public String getTabindex() {
647: if (_tabindex != null) {
648: return _tabindex;
649: }
650: ValueExpression expression = getValueExpression("tabindex");
651: if (expression != null) {
652: return (String) expression.getValue(getFacesContext()
653: .getELContext());
654: }
655: return null;
656: }
657:
658: /**
659: * Sets Specifies the position of this element within the tab order of the document.
660: *
661: * @param tabindex the new tabindex value
662: */
663: public void setTabindex(String tabindex) {
664: this ._tabindex = tabindex;
665: }
666:
667: // Property: disabled
668: private boolean _disabled = false;
669: private boolean _disabledSet;
670:
671: /**
672: * Gets When true, this element cannot receive focus.
673: *
674: * @return the new disabled value
675: */
676: public boolean isDisabled() {
677: if (_disabledSet) {
678: return _disabled;
679: }
680: ValueExpression expression = getValueExpression("disabled");
681: if (expression != null) {
682: return (Boolean) expression.getValue(getFacesContext()
683: .getELContext());
684: }
685: return false;
686: }
687:
688: /**
689: * Sets When true, this element cannot receive focus.
690: *
691: * @param disabled the new disabled value
692: */
693: public void setDisabled(boolean disabled) {
694: this ._disabled = disabled;
695: this ._disabledSet = true;
696: }
697:
698: // Property: readonly
699: private boolean _readonly;
700: private boolean _readonlySet;
701:
702: /**
703: * Gets When true, indicates that this component cannot be modified by the user.
704: * The element may receive focus unless it has also been disabled.
705: *
706: * @return the new readonly value
707: */
708: public boolean isReadonly() {
709: if (_readonlySet) {
710: return _readonly;
711: }
712: ValueExpression expression = getValueExpression("readonly");
713: if (expression != null) {
714: return (Boolean) expression.getValue(getFacesContext()
715: .getELContext());
716: }
717: return false;
718: }
719:
720: /**
721: * Sets When true, indicates that this component cannot be modified by the user.
722: * The element may receive focus unless it has also been disabled.
723: *
724: * @param readonly the new readonly value
725: */
726: public void setReadonly(boolean readonly) {
727: this ._readonly = readonly;
728: this ._readonlySet = true;
729: }
730:
731: // Property: label
732: private String _label;
733:
734: /**
735: * Gets A diplay name for this component.
736: *
737: * @return the new label value
738: */
739: public String getLabel() {
740: if (_label != null) {
741: return _label;
742: }
743: ValueExpression expression = getValueExpression("label");
744: if (expression != null) {
745: return (String) expression.getValue(getFacesContext()
746: .getELContext());
747: }
748: return null;
749: }
750:
751: /**
752: * Sets A diplay name for this component.
753: *
754: * @param label the new label value
755: */
756: public void setLabel(String label) {
757: this ._label = label;
758: }
759:
760: // Property: image
761: private String _image;
762:
763: /**
764: * Gets Absolute or relative URL of the image
765: *
766: * @return the new image value
767: */
768: public String getImage() {
769: if (_image != null) {
770: return _image;
771: }
772: ValueExpression expression = getValueExpression("image");
773: if (expression != null) {
774: return (String) expression.getValue(getFacesContext()
775: .getELContext());
776: }
777: return null;
778: }
779:
780: /**
781: * Sets Absolute or relative URL of the image
782: *
783: * @param image the new image value
784: */
785: public void setImage(String image) {
786: this ._image = image;
787: }
788:
789: // Property: alt
790: private String _alt;
791:
792: /**
793: * Gets Specifies alternative text that can be used by a browser that can't show this element.
794: *
795: * @return the new alt value
796: */
797: public String getAlt() {
798: if (_alt != null) {
799: return _alt;
800: }
801: ValueExpression expression = getValueExpression("alt");
802: if (expression != null) {
803: return (String) expression.getValue(getFacesContext()
804: .getELContext());
805: }
806: return null;
807: }
808:
809: /**
810: * Sets Specifies alternative text that can be used by a browser that can't show this element.
811: *
812: * @param alt the new alt value
813: */
814: public void setAlt(String alt) {
815: this ._alt = alt;
816: }
817:
818: // Property: type
819: private String _type;
820:
821: /**
822: * Gets A hint to the user agent about the content type of the linked resource.
823: *
824: * @return the new type value
825: */
826: public String getType() {
827: if (_type != null) {
828: return _type;
829: }
830: ValueExpression expression = getValueExpression("type");
831: if (expression != null) {
832: return (String) expression.getValue(getFacesContext()
833: .getELContext());
834: }
835: return null;
836: }
837:
838: /**
839: * Sets A hint to the user agent about the content type of the linked resource.
840: *
841: * @param type the new type value
842: */
843: public void setType(String type) {
844: this ._type = type;
845: }
846:
847: @Override
848: public Object saveState(FacesContext facesContext) {
849: Object[] values = new Object[30];
850: values[0] = super .saveState(facesContext);
851: values[1] = _style;
852: values[2] = _styleClass;
853: values[3] = _dir;
854: values[4] = _lang;
855: values[5] = _title;
856: values[6] = _onclick;
857: values[7] = _ondblclick;
858: values[8] = _onmousedown;
859: values[9] = _onmouseup;
860: values[10] = _onmouseover;
861: values[11] = _onmousemove;
862: values[12] = _onmouseout;
863: values[13] = _onkeypress;
864: values[14] = _onkeydown;
865: values[15] = _onkeyup;
866: values[16] = _onblur;
867: values[17] = _onfocus;
868: values[18] = _onchange;
869: values[19] = _onselect;
870: values[20] = _accesskey;
871: values[21] = _tabindex;
872: values[22] = _disabled;
873: values[23] = _disabledSet;
874: values[24] = _readonly;
875: values[25] = _readonlySet;
876: values[26] = _label;
877: values[27] = _image;
878: values[28] = _alt;
879: values[29] = _type;
880:
881: return values;
882: }
883:
884: @Override
885: public void restoreState(FacesContext facesContext, Object state) {
886: Object[] values = (Object[]) state;
887: super .restoreState(facesContext, values[0]);
888: _style = (String) values[1];
889: _styleClass = (String) values[2];
890: _dir = (String) values[3];
891: _lang = (String) values[4];
892: _title = (String) values[5];
893: _onclick = (String) values[6];
894: _ondblclick = (String) values[7];
895: _onmousedown = (String) values[8];
896: _onmouseup = (String) values[9];
897: _onmouseover = (String) values[10];
898: _onmousemove = (String) values[11];
899: _onmouseout = (String) values[12];
900: _onkeypress = (String) values[13];
901: _onkeydown = (String) values[14];
902: _onkeyup = (String) values[15];
903: _onblur = (String) values[16];
904: _onfocus = (String) values[17];
905: _onchange = (String) values[18];
906: _onselect = (String) values[19];
907: _accesskey = (String) values[20];
908: _tabindex = (String) values[21];
909: _disabled = (Boolean) values[22];
910: _disabledSet = (Boolean) values[23];
911: _readonly = (Boolean) values[24];
912: _readonlySet = (Boolean) values[25];
913: _label = (String) values[26];
914: _image = (String) values[27];
915: _alt = (String) values[28];
916: _type = (String) values[29];
917: }
918:
919: @Override
920: public String getFamily() {
921: return COMPONENT_FAMILY;
922: }
923: }
|