001    // ---------- Attention: Generated code, please do not modify! -----------  
002    
003    /*
004     * Licensed to the Apache Software Foundation (ASF) under one or more
005     * contributor license agreements.  See the NOTICE file distributed with
006     * this work for additional information regarding copyright ownership.
007     * The ASF licenses this file to You under the Apache License, Version 2.0
008     * (the "License"); you may not use this file except in compliance with
009     * the License.  You may obtain a copy of the License at
010     *
011     *      http://www.apache.org/licenses/LICENSE-2.0
012     *
013     * Unless required by applicable law or agreed to in writing, software
014     * distributed under the License is distributed on an "AS IS" BASIS,
015     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016     * See the License for the specific language governing permissions and
017     * limitations under the License.
018     */
019    
020    package org.apache.myfaces.tobago.component;
021    
022    import javax.faces.context.FacesContext;
023    import org.apache.myfaces.tobago.context.Markup;
024    import org.apache.myfaces.tobago.internal.component.AbstractUICommand;
025    import org.apache.myfaces.tobago.layout.Display;
026    import org.apache.myfaces.tobago.layout.Measure;
027    import org.apache.commons.lang.ArrayUtils;
028    import org.apache.commons.lang.StringUtils;
029    import org.apache.myfaces.tobago.component.MethodBindingToMethodExpression;
030    import org.apache.myfaces.tobago.component.MethodExpressionToMethodBinding;
031    import org.apache.myfaces.tobago.internal.util.Deprecation;
032    import org.apache.myfaces.tobago.renderkit.MarginValues;
033    import org.apache.myfaces.tobago.renderkit.SpacingValues;
034    import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
035    import javax.el.ELException;
036    import javax.faces.FacesException;
037    import java.util.ArrayList;
038    import java.util.List;
039    import javax.el.MethodExpression;
040    import javax.el.ValueExpression;
041    
042    /** 
043     Use this tag only as a facet for click, change in selectOneRadio,
044      selectBooleanCheckbox, selectManyCheckbox and selectOneChoice
045      * UIComponent class, generated from template {@code component1.2.stg} with class
046      * {@link org.apache.myfaces.tobago.internal.taglib.component.CommandTagDeclaration}.
047     */
048    public class UICommand
049        extends AbstractUICommand implements SupportsMarkup {
050    
051      public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Command";
052    
053      private org.apache.myfaces.tobago.context.Markup markup;
054      private org.apache.myfaces.tobago.layout.Measure marginLeft;
055      private java.lang.String link;
056      private org.apache.myfaces.tobago.layout.Measure minimumHeight;
057      private org.apache.myfaces.tobago.layout.Measure height;
058      private org.apache.myfaces.tobago.layout.Measure minimumWidth;
059      private java.lang.Integer rowSpan;
060      private org.apache.myfaces.tobago.layout.Measure left;
061      private java.lang.Integer columnSpan;
062      private org.apache.myfaces.tobago.layout.Measure top;
063      private org.apache.myfaces.tobago.layout.Measure maximumHeight;
064      private org.apache.myfaces.tobago.layout.Measure currentWidth;
065      private org.apache.myfaces.tobago.layout.Measure marginTop;
066      private org.apache.myfaces.tobago.layout.Measure width;
067      private org.apache.myfaces.tobago.layout.Measure marginRight;
068      private org.apache.myfaces.tobago.layout.Measure preferredHeight;
069      private java.lang.String resource;
070      private java.lang.Boolean jsfResource;
071      private org.apache.myfaces.tobago.layout.Measure currentHeight;
072      private java.lang.Boolean transition;
073      private org.apache.myfaces.tobago.layout.Display display;
074      private org.apache.myfaces.tobago.layout.Measure maximumWidth;
075      private org.apache.myfaces.tobago.layout.Measure preferredWidth;
076      private java.lang.Boolean immediate;
077      private org.apache.myfaces.tobago.layout.Measure marginBottom;
078      private java.lang.Integer verticalIndex;
079      private org.apache.myfaces.tobago.context.Markup currentMarkup;
080      private java.lang.String[] renderedPartially;
081      private java.lang.String target;
082      private java.lang.String onclick;
083      private java.lang.Integer horizontalIndex;
084      private java.lang.Boolean disabled;
085    
086    
087      public org.apache.myfaces.tobago.context.Markup getMarkup() {
088        if (markup != null) {
089          return markup;
090        }
091        ValueExpression ve = getValueExpression("markup");
092        if (ve != null) {
093          try {
094            Object object = ve.getValue(getFacesContext().getELContext());
095            return Markup.valueOf(object);
096          } catch (ELException e) {
097                      throw new FacesException(e);
098              }
099        }
100        return null;
101      }
102    
103      public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
104        this.markup = markup;
105      }
106    
107      public org.apache.myfaces.tobago.layout.Measure getMarginLeft() {
108        if (marginLeft != null) {
109          return marginLeft;
110        }
111        ValueExpression ve = getValueExpression("marginLeft");
112        if (ve != null) {
113          try {
114            Object object = ve.getValue(getFacesContext().getELContext());
115            return Measure.valueOf(object);
116          } catch (ELException e) {
117                      throw new FacesException(e);
118              }
119        }
120        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginLeft(getFacesContext(), this);
121      }
122    
123      public void setMarginLeft(org.apache.myfaces.tobago.layout.Measure marginLeft) {
124        this.marginLeft = marginLeft;
125      }
126    
127      /**
128      Link to an arbitrary URL, either an internal link or an external link.
129    
130       <dl>
131         <dt>internal absolute link</dt>
132         <dd>Starts with a slash '/' character. The context path will be added.
133             A session id will be added, if needed.</dd>
134         <dt>external link</dt>
135         <dd>Contains a colon ':' character.
136             The link will not be modified.</dd>
137         <dt>internal relative link</dt>
138         <dd>Any other strings. A session id will be added, if needed.</dd>
139       </dl>
140    
141      */
142      public java.lang.String getLink() {
143        if (link != null) {
144          return link;
145        }
146        ValueExpression ve = getValueExpression("link");
147        if (ve != null) {
148          try {
149            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
150          } catch (ELException e) {
151                      throw new FacesException(e);
152              }
153        }
154        return null;
155      }
156    
157      public void setLink(java.lang.String link) {
158        this.link = link;
159      }
160    
161      public org.apache.myfaces.tobago.layout.Measure getMinimumHeight() {
162        if (minimumHeight != null) {
163          return minimumHeight;
164        }
165        ValueExpression ve = getValueExpression("minimumHeight");
166        if (ve != null) {
167          try {
168            Object object = ve.getValue(getFacesContext().getELContext());
169            return Measure.valueOf(object);
170          } catch (ELException e) {
171                      throw new FacesException(e);
172              }
173        }
174        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumHeight(getFacesContext(), this);
175      }
176    
177      public void setMinimumHeight(org.apache.myfaces.tobago.layout.Measure minimumHeight) {
178        this.minimumHeight = minimumHeight;
179      }
180    
181      /**
182      This value will usually be set by the layout manager.
183    
184      */
185      public org.apache.myfaces.tobago.layout.Measure getHeight() {
186        if (height != null) {
187          return height;
188        }
189        ValueExpression ve = getValueExpression("height");
190        if (ve != null) {
191          try {
192            Object object = ve.getValue(getFacesContext().getELContext());
193            return Measure.valueOf(object);
194          } catch (ELException e) {
195                      throw new FacesException(e);
196              }
197        }
198        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getHeight(getFacesContext(), this);
199      }
200    
201      public void setHeight(org.apache.myfaces.tobago.layout.Measure height) {
202        this.height = height;
203      }
204    
205      public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() {
206        if (minimumWidth != null) {
207          return minimumWidth;
208        }
209        ValueExpression ve = getValueExpression("minimumWidth");
210        if (ve != null) {
211          try {
212            Object object = ve.getValue(getFacesContext().getELContext());
213            return Measure.valueOf(object);
214          } catch (ELException e) {
215                      throw new FacesException(e);
216              }
217        }
218        return ((LayoutComponentRenderer)getRenderer(getFacesContext())).getMinimumWidth(getFacesContext(), this);
219      }
220    
221      public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) {
222        this.minimumWidth = minimumWidth;
223      }
224    
225      public java.lang.Integer getRowSpan() {
226        if (rowSpan != null) {
227          return rowSpan;
228        }
229        ValueExpression ve = getValueExpression("rowSpan");
230        if (ve != null) {
231          try {
232            Number number = (Number) ve.getValue(getFacesContext().getELContext());
233            if (number != null) {
234              return number.intValue();
235            }
236          } catch (ELException e) {
237                      throw new FacesException(e);
238              }
239        }
240        return 1;
241      }
242    
243      public void setRowSpan(java.lang.Integer rowSpan) {
244        this.rowSpan = rowSpan;
245      }
246    
247      /**
248      This value will usually be set by the layout manager.
249    
250      */
251      public org.apache.myfaces.tobago.layout.Measure getLeft() {
252        if (left != null) {
253          return left;
254        }
255        ValueExpression ve = getValueExpression("left");
256        if (ve != null) {
257          try {
258            Object object = ve.getValue(getFacesContext().getELContext());
259            return Measure.valueOf(object);
260          } catch (ELException e) {
261                      throw new FacesException(e);
262              }
263        }
264        return null;
265      }
266    
267      public void setLeft(org.apache.myfaces.tobago.layout.Measure left) {
268        this.left = left;
269      }
270    
271      public java.lang.Integer getColumnSpan() {
272        if (columnSpan != null) {
273          return columnSpan;
274        }
275        ValueExpression ve = getValueExpression("columnSpan");
276        if (ve != null) {
277          try {
278            Number number = (Number) ve.getValue(getFacesContext().getELContext());
279            if (number != null) {
280              return number.intValue();
281            }
282          } catch (ELException e) {
283                      throw new FacesException(e);
284              }
285        }
286        return 1;
287      }
288    
289      public void setColumnSpan(java.lang.Integer columnSpan) {
290        this.columnSpan = columnSpan;
291      }
292    
293      /**
294      This value will usually be set by the layout manager.
295    
296      */
297      public org.apache.myfaces.tobago.layout.Measure getTop() {
298        if (top != null) {
299          return top;
300        }
301        ValueExpression ve = getValueExpression("top");
302        if (ve != null) {
303          try {
304            Object object = ve.getValue(getFacesContext().getELContext());
305            return Measure.valueOf(object);
306          } catch (ELException e) {
307                      throw new FacesException(e);
308              }
309        }
310        return null;
311      }
312    
313      public void setTop(org.apache.myfaces.tobago.layout.Measure top) {
314        this.top = top;
315      }
316    
317      public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() {
318        if (maximumHeight != null) {
319          return maximumHeight;
320        }
321        ValueExpression ve = getValueExpression("maximumHeight");
322        if (ve != null) {
323          try {
324            Object object = ve.getValue(getFacesContext().getELContext());
325            return Measure.valueOf(object);
326          } catch (ELException e) {
327                      throw new FacesException(e);
328              }
329        }
330        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this);
331      }
332    
333      public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) {
334        this.maximumHeight = maximumHeight;
335      }
336    
337      /**
338      This value will usually be set by the layout manager. It holds the current width computed by the layout manager.
339    
340      */
341      public org.apache.myfaces.tobago.layout.Measure getCurrentWidth() {
342        if (currentWidth != null) {
343          return currentWidth;
344        }
345        ValueExpression ve = getValueExpression("currentWidth");
346        if (ve != null) {
347          try {
348            Object object = ve.getValue(getFacesContext().getELContext());
349            return Measure.valueOf(object);
350          } catch (ELException e) {
351                      throw new FacesException(e);
352              }
353        }
354        return getWidth();
355      }
356    
357      public void setCurrentWidth(org.apache.myfaces.tobago.layout.Measure currentWidth) {
358        this.currentWidth = currentWidth;
359      }
360    
361      public org.apache.myfaces.tobago.layout.Measure getMarginTop() {
362        if (marginTop != null) {
363          return marginTop;
364        }
365        ValueExpression ve = getValueExpression("marginTop");
366        if (ve != null) {
367          try {
368            Object object = ve.getValue(getFacesContext().getELContext());
369            return Measure.valueOf(object);
370          } catch (ELException e) {
371                      throw new FacesException(e);
372              }
373        }
374        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this);
375      }
376    
377      public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) {
378        this.marginTop = marginTop;
379      }
380    
381      /**
382      This value will usually be set by the layout manager.
383    
384      */
385      public org.apache.myfaces.tobago.layout.Measure getWidth() {
386        if (width != null) {
387          return width;
388        }
389        ValueExpression ve = getValueExpression("width");
390        if (ve != null) {
391          try {
392            Object object = ve.getValue(getFacesContext().getELContext());
393            return Measure.valueOf(object);
394          } catch (ELException e) {
395                      throw new FacesException(e);
396              }
397        }
398        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getWidth(getFacesContext(), this);
399      }
400    
401      public void setWidth(org.apache.myfaces.tobago.layout.Measure width) {
402        this.width = width;
403      }
404    
405      public org.apache.myfaces.tobago.layout.Measure getMarginRight() {
406        if (marginRight != null) {
407          return marginRight;
408        }
409        ValueExpression ve = getValueExpression("marginRight");
410        if (ve != null) {
411          try {
412            Object object = ve.getValue(getFacesContext().getELContext());
413            return Measure.valueOf(object);
414          } catch (ELException e) {
415                      throw new FacesException(e);
416              }
417        }
418        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this);
419      }
420    
421      public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) {
422        this.marginRight = marginRight;
423      }
424    
425      public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() {
426        if (preferredHeight != null) {
427          return preferredHeight;
428        }
429        ValueExpression ve = getValueExpression("preferredHeight");
430        if (ve != null) {
431          try {
432            Object object = ve.getValue(getFacesContext().getELContext());
433            return Measure.valueOf(object);
434          } catch (ELException e) {
435                      throw new FacesException(e);
436              }
437        }
438        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this);
439      }
440    
441      public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) {
442        this.preferredHeight = preferredHeight;
443      }
444    
445      /**
446      Link to an internal resource.
447       Resources will be processed by the resource management.
448       E. g. define help.html and it will be served help_es.html or help_de.html if available.
449       For JSF-Pages you have to set the jsfResource attribute.
450    
451      */
452      public java.lang.String getResource() {
453        if (resource != null) {
454          return resource;
455        }
456        ValueExpression ve = getValueExpression("resource");
457        if (ve != null) {
458          try {
459            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
460          } catch (ELException e) {
461                      throw new FacesException(e);
462              }
463        }
464        return null;
465      }
466    
467      public void setResource(java.lang.String resource) {
468        this.resource = resource;
469      }
470    
471      /**
472      Flag indicating that the resource referenced by the resource attribute is a jsf resource.
473       That means that the url has to be processed to change the prefix or suffix (e. g. *.jsf or
474       /faces/*). Default is false.
475      <br />Default: <code>false</code>
476      */
477      public boolean isJsfResource() {
478        if (jsfResource != null) {
479          return jsfResource;
480        }
481        ValueExpression ve = getValueExpression("jsfResource");
482        if (ve != null) {
483          try {
484            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
485            if (bool != null) {
486              return bool;
487            }
488          } catch (ELException e) {
489                      throw new FacesException(e);
490              }
491        }
492        return false;
493      }
494    
495      public void setJsfResource(boolean jsfResource) {
496        this.jsfResource = jsfResource;
497      }
498    
499      /**
500      This value will usually be set by the layout manager. It holds the current height computed by the layout manager.
501    
502      */
503      public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() {
504        if (currentHeight != null) {
505          return currentHeight;
506        }
507        ValueExpression ve = getValueExpression("currentHeight");
508        if (ve != null) {
509          try {
510            Object object = ve.getValue(getFacesContext().getELContext());
511            return Measure.valueOf(object);
512          } catch (ELException e) {
513                      throw new FacesException(e);
514              }
515        }
516        return getHeight();
517      }
518    
519      public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) {
520        this.currentHeight = currentHeight;
521      }
522    
523      /**
524      Specify, if the command calls an JSF-Action.
525       Useful to switch off the Double-Submit-Check and Waiting-Behavior.
526      <br />Default: <code>true</code>
527      */
528      public boolean isTransition() {
529        if (transition != null) {
530          return transition;
531        }
532        ValueExpression ve = getValueExpression("transition");
533        if (ve != null) {
534          try {
535            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
536            if (bool != null) {
537              return bool;
538            }
539          } catch (ELException e) {
540                      throw new FacesException(e);
541              }
542        }
543        return true;
544      }
545    
546      public void setTransition(boolean transition) {
547        this.transition = transition;
548      }
549    
550      /**
551      This attribute is for internal use only.
552    
553      */
554      public org.apache.myfaces.tobago.layout.Display getDisplay() {
555        if (display != null) {
556          return display;
557        }
558        ValueExpression ve = getValueExpression("display");
559        if (ve != null) {
560          try {
561            return (org.apache.myfaces.tobago.layout.Display) ve.getValue(getFacesContext().getELContext());
562          } catch (ELException e) {
563                      throw new FacesException(e);
564              }
565        }
566        return null;
567      }
568    
569      public void setDisplay(org.apache.myfaces.tobago.layout.Display display) {
570        this.display = display;
571      }
572    
573      public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() {
574        if (maximumWidth != null) {
575          return maximumWidth;
576        }
577        ValueExpression ve = getValueExpression("maximumWidth");
578        if (ve != null) {
579          try {
580            Object object = ve.getValue(getFacesContext().getELContext());
581            return Measure.valueOf(object);
582          } catch (ELException e) {
583                      throw new FacesException(e);
584              }
585        }
586        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this);
587      }
588    
589      public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) {
590        this.maximumWidth = maximumWidth;
591      }
592    
593      public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() {
594        if (preferredWidth != null) {
595          return preferredWidth;
596        }
597        ValueExpression ve = getValueExpression("preferredWidth");
598        if (ve != null) {
599          try {
600            Object object = ve.getValue(getFacesContext().getELContext());
601            return Measure.valueOf(object);
602          } catch (ELException e) {
603                      throw new FacesException(e);
604              }
605        }
606        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this);
607      }
608    
609      public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) {
610        this.preferredWidth = preferredWidth;
611      }
612    
613      /**
614      Flag indicating that, if this component is activated by the user,
615       notifications should be delivered to interested listeners and actions
616       immediately (that is, during Apply Request Values phase) rather than
617       waiting until Invoke Application phase.
618      <br />Default: <code>false</code>
619      */
620      public boolean isImmediate() {
621        if (immediate != null) {
622          return immediate;
623        }
624        ValueExpression ve = getValueExpression("immediate");
625        if (ve != null) {
626          try {
627            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
628            if (bool != null) {
629              return bool;
630            }
631          } catch (ELException e) {
632                      throw new FacesException(e);
633              }
634        }
635        return false;
636      }
637    
638      public void setImmediate(boolean immediate) {
639        this.immediate = immediate;
640      }
641    
642      public org.apache.myfaces.tobago.layout.Measure getMarginBottom() {
643        if (marginBottom != null) {
644          return marginBottom;
645        }
646        ValueExpression ve = getValueExpression("marginBottom");
647        if (ve != null) {
648          try {
649            Object object = ve.getValue(getFacesContext().getELContext());
650            return Measure.valueOf(object);
651          } catch (ELException e) {
652                      throw new FacesException(e);
653              }
654        }
655        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this);
656      }
657    
658      public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) {
659        this.marginBottom = marginBottom;
660      }
661    
662      /**
663      This attribute is for internal use only.
664    
665      */
666      public java.lang.Integer getVerticalIndex() {
667        if (verticalIndex != null) {
668          return verticalIndex;
669        }
670        ValueExpression ve = getValueExpression("verticalIndex");
671        if (ve != null) {
672          try {
673            Number number = (Number) ve.getValue(getFacesContext().getELContext());
674            if (number != null) {
675              return number.intValue();
676            }
677          } catch (ELException e) {
678                      throw new FacesException(e);
679              }
680        }
681        return null;
682      }
683    
684      public void setVerticalIndex(java.lang.Integer verticalIndex) {
685        this.verticalIndex = verticalIndex;
686      }
687    
688      public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
689        if (currentMarkup != null) {
690          return currentMarkup;
691        }
692        return null;
693      }
694    
695      public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
696        this.currentMarkup = currentMarkup;
697      }
698    
699      /**
700      Indicate the partially rendered Components in a case of a submit.
701    
702      */
703      public String[] getRenderedPartially() {
704        if (renderedPartially != null) {
705          return renderedPartially;
706        }
707        ValueExpression ve = getValueExpression("renderedPartially");
708        if (ve != null) {
709          try {
710            Object strArray = ve.getValue(getFacesContext().getELContext());
711            if (strArray instanceof String[]) {
712              return (String[]) strArray;
713            } else if (strArray instanceof String) {
714              String[] strings = StringUtils.split((String) strArray, ", ");
715              List<String> result = new ArrayList<String>(strings.length);
716              for (String string : strings) {
717                if (string.trim().length() != 0) {
718                  result.add(string.trim());
719                }
720              }
721              return result.toArray(new String[result.size()]);
722            } else if (strArray == null) {
723              return ArrayUtils.EMPTY_STRING_ARRAY;
724            } else {
725              return new String[]{strArray.toString()};
726            }
727          } catch (ELException e) {
728                      throw new FacesException(e);
729              }
730        }
731        return ArrayUtils.EMPTY_STRING_ARRAY;
732      }
733    
734      public void setRenderedPartially(String[] renderedPartially) {
735        this.renderedPartially = renderedPartially;
736      }
737    
738      /**
739      Name of a frame where the resource retrieved via this hyperlink is to be
740       displayed.
741    
742      */
743      public java.lang.String getTarget() {
744        if (target != null) {
745          return target;
746        }
747        ValueExpression ve = getValueExpression("target");
748        if (ve != null) {
749          try {
750            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
751          } catch (ELException e) {
752                      throw new FacesException(e);
753              }
754        }
755        return null;
756      }
757    
758      public void setTarget(java.lang.String target) {
759        this.target = target;
760      }
761    
762      /**
763      Script to be invoked when clicked
764    
765      */
766      public java.lang.String getOnclick() {
767        if (onclick != null) {
768          return onclick;
769        }
770        ValueExpression ve = getValueExpression("onclick");
771        if (ve != null) {
772          try {
773            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
774          } catch (ELException e) {
775                      throw new FacesException(e);
776              }
777        }
778        return null;
779      }
780    
781      public void setOnclick(java.lang.String onclick) {
782        this.onclick = onclick;
783      }
784    
785      /**
786      This attribute is for internal use only.
787    
788      */
789      public java.lang.Integer getHorizontalIndex() {
790        if (horizontalIndex != null) {
791          return horizontalIndex;
792        }
793        ValueExpression ve = getValueExpression("horizontalIndex");
794        if (ve != null) {
795          try {
796            Number number = (Number) ve.getValue(getFacesContext().getELContext());
797            if (number != null) {
798              return number.intValue();
799            }
800          } catch (ELException e) {
801                      throw new FacesException(e);
802              }
803        }
804        return null;
805      }
806    
807      public void setHorizontalIndex(java.lang.Integer horizontalIndex) {
808        this.horizontalIndex = horizontalIndex;
809      }
810    
811      /**
812      Flag indicating that this element is disabled.
813      <br />Default: <code>false</code>
814      */
815      public boolean isDisabled() {
816        if (disabled != null) {
817          return disabled;
818        }
819        ValueExpression ve = getValueExpression("disabled");
820        if (ve != null) {
821          try {
822            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
823            if (bool != null) {
824              return bool;
825            }
826          } catch (ELException e) {
827                      throw new FacesException(e);
828              }
829        }
830        return false;
831      }
832    
833      public void setDisabled(boolean disabled) {
834        this.disabled = disabled;
835      }
836    
837      public void restoreState(FacesContext context, Object componentState) {
838        Object[] values = (Object[]) componentState;
839        super.restoreState(context, values[0]);
840        markup = (org.apache.myfaces.tobago.context.Markup) values[1];
841        marginLeft = (org.apache.myfaces.tobago.layout.Measure) values[2];
842        link = (java.lang.String) values[3];
843        minimumHeight = (org.apache.myfaces.tobago.layout.Measure) values[4];
844        height = (org.apache.myfaces.tobago.layout.Measure) values[5];
845        minimumWidth = (org.apache.myfaces.tobago.layout.Measure) values[6];
846        rowSpan = (java.lang.Integer) values[7];
847        left = (org.apache.myfaces.tobago.layout.Measure) values[8];
848        columnSpan = (java.lang.Integer) values[9];
849        top = (org.apache.myfaces.tobago.layout.Measure) values[10];
850        maximumHeight = (org.apache.myfaces.tobago.layout.Measure) values[11];
851        currentWidth = (org.apache.myfaces.tobago.layout.Measure) values[12];
852        marginTop = (org.apache.myfaces.tobago.layout.Measure) values[13];
853        width = (org.apache.myfaces.tobago.layout.Measure) values[14];
854        marginRight = (org.apache.myfaces.tobago.layout.Measure) values[15];
855        preferredHeight = (org.apache.myfaces.tobago.layout.Measure) values[16];
856        resource = (java.lang.String) values[17];
857        jsfResource = (java.lang.Boolean) values[18];
858        currentHeight = (org.apache.myfaces.tobago.layout.Measure) values[19];
859        transition = (java.lang.Boolean) values[20];
860        display = (org.apache.myfaces.tobago.layout.Display) values[21];
861        maximumWidth = (org.apache.myfaces.tobago.layout.Measure) values[22];
862        preferredWidth = (org.apache.myfaces.tobago.layout.Measure) values[23];
863        immediate = (java.lang.Boolean) values[24];
864        marginBottom = (org.apache.myfaces.tobago.layout.Measure) values[25];
865        verticalIndex = (java.lang.Integer) values[26];
866        renderedPartially = (java.lang.String[]) values[27];
867        target = (java.lang.String) values[28];
868        onclick = (java.lang.String) values[29];
869        horizontalIndex = (java.lang.Integer) values[30];
870        disabled = (java.lang.Boolean) values[31];
871      }
872    
873      public Object saveState(FacesContext context) {
874        Object[] values = new Object[32];
875        values[0] = super.saveState(context);
876        values[1] = markup;
877        values[2] = marginLeft;
878        values[3] = link;
879        values[4] = minimumHeight;
880        values[5] = height;
881        values[6] = minimumWidth;
882        values[7] = rowSpan;
883        values[8] = left;
884        values[9] = columnSpan;
885        values[10] = top;
886        values[11] = maximumHeight;
887        values[12] = currentWidth;
888        values[13] = marginTop;
889        values[14] = width;
890        values[15] = marginRight;
891        values[16] = preferredHeight;
892        values[17] = resource;
893        values[18] = jsfResource;
894        values[19] = currentHeight;
895        values[20] = transition;
896        values[21] = display;
897        values[22] = maximumWidth;
898        values[23] = preferredWidth;
899        values[24] = immediate;
900        values[25] = marginBottom;
901        values[26] = verticalIndex;
902        values[27] = renderedPartially;
903        values[28] = target;
904        values[29] = onclick;
905        values[30] = horizontalIndex;
906        values[31] = disabled;
907        currentMarkup = null;
908        return values;
909      }
910    
911    
912    }