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        ValueExpression ve = getValueExpression("currentMarkup");
693        if (ve != null) {
694          try {
695            Object object = ve.getValue(getFacesContext().getELContext());
696            return Markup.valueOf(object);
697          } catch (ELException e) {
698                      throw new FacesException(e);
699              }
700        }
701        return null;
702      }
703    
704      public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
705        this.currentMarkup = currentMarkup;
706      }
707    
708      /**
709      Indicate the partially rendered Components in a case of a submit.
710    
711      */
712      public String[] getRenderedPartially() {
713        if (renderedPartially != null) {
714          return renderedPartially;
715        }
716        ValueExpression ve = getValueExpression("renderedPartially");
717        if (ve != null) {
718          try {
719            Object strArray = ve.getValue(getFacesContext().getELContext());
720            if (strArray instanceof String[]) {
721              return (String[]) strArray;
722            } else if (strArray instanceof String) {
723              String[] strings = StringUtils.split((String) strArray, ", ");
724              List<String> result = new ArrayList<String>(strings.length);
725              for (String string : strings) {
726                if (string.trim().length() != 0) {
727                  result.add(string.trim());
728                }
729              }
730              return result.toArray(new String[result.size()]);
731            } else if (strArray == null) {
732              return ArrayUtils.EMPTY_STRING_ARRAY;
733            } else {
734              return new String[]{strArray.toString()};
735            }
736          } catch (ELException e) {
737                      throw new FacesException(e);
738              }
739        }
740        return ArrayUtils.EMPTY_STRING_ARRAY;
741      }
742    
743      public void setRenderedPartially(String[] renderedPartially) {
744        this.renderedPartially = renderedPartially;
745      }
746    
747      /**
748      Name of a frame where the resource retrieved via this hyperlink is to be
749       displayed.
750    
751      */
752      public java.lang.String getTarget() {
753        if (target != null) {
754          return target;
755        }
756        ValueExpression ve = getValueExpression("target");
757        if (ve != null) {
758          try {
759            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
760          } catch (ELException e) {
761                      throw new FacesException(e);
762              }
763        }
764        return null;
765      }
766    
767      public void setTarget(java.lang.String target) {
768        this.target = target;
769      }
770    
771      /**
772      Script to be invoked when clicked
773    
774      */
775      public java.lang.String getOnclick() {
776        if (onclick != null) {
777          return onclick;
778        }
779        ValueExpression ve = getValueExpression("onclick");
780        if (ve != null) {
781          try {
782            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
783          } catch (ELException e) {
784                      throw new FacesException(e);
785              }
786        }
787        return null;
788      }
789    
790      public void setOnclick(java.lang.String onclick) {
791        this.onclick = onclick;
792      }
793    
794      /**
795      This attribute is for internal use only.
796    
797      */
798      public java.lang.Integer getHorizontalIndex() {
799        if (horizontalIndex != null) {
800          return horizontalIndex;
801        }
802        ValueExpression ve = getValueExpression("horizontalIndex");
803        if (ve != null) {
804          try {
805            Number number = (Number) ve.getValue(getFacesContext().getELContext());
806            if (number != null) {
807              return number.intValue();
808            }
809          } catch (ELException e) {
810                      throw new FacesException(e);
811              }
812        }
813        return null;
814      }
815    
816      public void setHorizontalIndex(java.lang.Integer horizontalIndex) {
817        this.horizontalIndex = horizontalIndex;
818      }
819    
820      /**
821      Flag indicating that this element is disabled.
822      <br />Default: <code>false</code>
823      */
824      public boolean isDisabled() {
825        if (disabled != null) {
826          return disabled;
827        }
828        ValueExpression ve = getValueExpression("disabled");
829        if (ve != null) {
830          try {
831            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
832            if (bool != null) {
833              return bool;
834            }
835          } catch (ELException e) {
836                      throw new FacesException(e);
837              }
838        }
839        return false;
840      }
841    
842      public void setDisabled(boolean disabled) {
843        this.disabled = disabled;
844      }
845    
846      public void restoreState(FacesContext context, Object componentState) {
847        Object[] values = (Object[]) componentState;
848        super.restoreState(context, values[0]);
849        markup = (org.apache.myfaces.tobago.context.Markup) values[1];
850        marginLeft = (org.apache.myfaces.tobago.layout.Measure) values[2];
851        link = (java.lang.String) values[3];
852        minimumHeight = (org.apache.myfaces.tobago.layout.Measure) values[4];
853        height = (org.apache.myfaces.tobago.layout.Measure) values[5];
854        minimumWidth = (org.apache.myfaces.tobago.layout.Measure) values[6];
855        rowSpan = (java.lang.Integer) values[7];
856        left = (org.apache.myfaces.tobago.layout.Measure) values[8];
857        columnSpan = (java.lang.Integer) values[9];
858        top = (org.apache.myfaces.tobago.layout.Measure) values[10];
859        maximumHeight = (org.apache.myfaces.tobago.layout.Measure) values[11];
860        currentWidth = (org.apache.myfaces.tobago.layout.Measure) values[12];
861        marginTop = (org.apache.myfaces.tobago.layout.Measure) values[13];
862        width = (org.apache.myfaces.tobago.layout.Measure) values[14];
863        marginRight = (org.apache.myfaces.tobago.layout.Measure) values[15];
864        preferredHeight = (org.apache.myfaces.tobago.layout.Measure) values[16];
865        resource = (java.lang.String) values[17];
866        jsfResource = (java.lang.Boolean) values[18];
867        currentHeight = (org.apache.myfaces.tobago.layout.Measure) values[19];
868        transition = (java.lang.Boolean) values[20];
869        display = (org.apache.myfaces.tobago.layout.Display) values[21];
870        maximumWidth = (org.apache.myfaces.tobago.layout.Measure) values[22];
871        preferredWidth = (org.apache.myfaces.tobago.layout.Measure) values[23];
872        immediate = (java.lang.Boolean) values[24];
873        marginBottom = (org.apache.myfaces.tobago.layout.Measure) values[25];
874        verticalIndex = (java.lang.Integer) values[26];
875        currentMarkup = (org.apache.myfaces.tobago.context.Markup) values[27];
876        renderedPartially = (java.lang.String[]) values[28];
877        target = (java.lang.String) values[29];
878        onclick = (java.lang.String) values[30];
879        horizontalIndex = (java.lang.Integer) values[31];
880        disabled = (java.lang.Boolean) values[32];
881      }
882    
883      public Object saveState(FacesContext context) {
884        Object[] values = new Object[33];
885        values[0] = super.saveState(context);
886        values[1] = markup;
887        values[2] = marginLeft;
888        values[3] = link;
889        values[4] = minimumHeight;
890        values[5] = height;
891        values[6] = minimumWidth;
892        values[7] = rowSpan;
893        values[8] = left;
894        values[9] = columnSpan;
895        values[10] = top;
896        values[11] = maximumHeight;
897        values[12] = currentWidth;
898        values[13] = marginTop;
899        values[14] = width;
900        values[15] = marginRight;
901        values[16] = preferredHeight;
902        values[17] = resource;
903        values[18] = jsfResource;
904        values[19] = currentHeight;
905        values[20] = transition;
906        values[21] = display;
907        values[22] = maximumWidth;
908        values[23] = preferredWidth;
909        values[24] = immediate;
910        values[25] = marginBottom;
911        values[26] = verticalIndex;
912        values[27] = currentMarkup;
913        values[28] = renderedPartially;
914        values[29] = target;
915        values[30] = onclick;
916        values[31] = horizontalIndex;
917        values[32] = disabled;
918        return values;
919      }
920    
921    
922    }