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.AbstractUIToolBarCommand;
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     Renders a command button within a toolbar.
044      * UIComponent class, generated from template {@code component1.2.stg} with class
045      * {@link org.apache.myfaces.tobago.internal.taglib.component.ToolBarCommandTagDeclaration}.
046     */
047    public class UIToolBarCommand
048        extends AbstractUIToolBarCommand implements SupportsMarkup {
049    
050      public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.ToolBarCommand";
051    
052      private org.apache.myfaces.tobago.context.Markup markup;
053      private java.lang.Character accessKey;
054      private org.apache.myfaces.tobago.layout.Measure marginLeft;
055      private java.lang.String link;
056      private java.lang.String labelWithAccessKey;
057      private org.apache.myfaces.tobago.layout.Measure minimumHeight;
058      private java.lang.String tip;
059      private org.apache.myfaces.tobago.layout.Measure height;
060      private org.apache.myfaces.tobago.layout.Measure minimumWidth;
061      private java.lang.Integer rowSpan;
062      private org.apache.myfaces.tobago.layout.Measure left;
063      private java.lang.Integer columnSpan;
064      private org.apache.myfaces.tobago.layout.Measure top;
065      private org.apache.myfaces.tobago.layout.Measure maximumHeight;
066      private org.apache.myfaces.tobago.layout.Measure currentWidth;
067      private org.apache.myfaces.tobago.layout.Measure marginTop;
068      private org.apache.myfaces.tobago.layout.Measure width;
069      private org.apache.myfaces.tobago.layout.Measure marginRight;
070      private org.apache.myfaces.tobago.layout.Measure preferredHeight;
071      private java.lang.String resource;
072      private java.lang.Boolean jsfResource;
073      private org.apache.myfaces.tobago.layout.Measure currentHeight;
074      private java.lang.Boolean transition;
075      private java.lang.String image;
076      private java.lang.String label;
077      private org.apache.myfaces.tobago.layout.Display display;
078      private org.apache.myfaces.tobago.layout.Measure maximumWidth;
079      private org.apache.myfaces.tobago.layout.Measure preferredWidth;
080      private java.lang.Boolean immediate;
081      private org.apache.myfaces.tobago.layout.Measure marginBottom;
082      private java.lang.Integer verticalIndex;
083      private org.apache.myfaces.tobago.context.Markup currentMarkup;
084      private java.lang.String[] renderedPartially;
085      private java.lang.String target;
086      private java.lang.String onclick;
087      private java.lang.Integer horizontalIndex;
088      private java.lang.Boolean disabled;
089    
090    
091      public org.apache.myfaces.tobago.context.Markup getMarkup() {
092        if (markup != null) {
093          return markup;
094        }
095        ValueExpression ve = getValueExpression("markup");
096        if (ve != null) {
097          try {
098            Object object = ve.getValue(getFacesContext().getELContext());
099            return Markup.valueOf(object);
100          } catch (ELException e) {
101                      throw new FacesException(e);
102              }
103        }
104        return null;
105      }
106    
107      public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
108        this.markup = markup;
109      }
110    
111      /**
112      Deprecated! Has not longer any function.
113    
114      @deprecated*/
115      @Deprecated
116      public java.lang.Character getAccessKey() {
117        if (accessKey != null) {
118          return accessKey;
119        }
120        ValueExpression ve = getValueExpression("accessKey");
121        if (ve != null) {
122          try {
123            return (java.lang.Character) ve.getValue(getFacesContext().getELContext());
124          } catch (ELException e) {
125                      throw new FacesException(e);
126              }
127        }
128        return null;
129      }
130    
131      @Deprecated
132      public void setAccessKey(java.lang.Character accessKey) {
133        this.accessKey = accessKey;
134      }
135    
136      public org.apache.myfaces.tobago.layout.Measure getMarginLeft() {
137        if (marginLeft != null) {
138          return marginLeft;
139        }
140        ValueExpression ve = getValueExpression("marginLeft");
141        if (ve != null) {
142          try {
143            Object object = ve.getValue(getFacesContext().getELContext());
144            return Measure.valueOf(object);
145          } catch (ELException e) {
146                      throw new FacesException(e);
147              }
148        }
149        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginLeft(getFacesContext(), this);
150      }
151    
152      public void setMarginLeft(org.apache.myfaces.tobago.layout.Measure marginLeft) {
153        this.marginLeft = marginLeft;
154      }
155    
156      /**
157      Link to an arbitrary URL, either an internal link or an external link.
158    
159       <dl>
160         <dt>internal absolute link</dt>
161         <dd>Starts with a slash '/' character. The context path will be added.
162             A session id will be added, if needed.</dd>
163         <dt>external link</dt>
164         <dd>Contains a colon ':' character.
165             The link will not be modified.</dd>
166         <dt>internal relative link</dt>
167         <dd>Any other strings. A session id will be added, if needed.</dd>
168       </dl>
169    
170      */
171      public java.lang.String getLink() {
172        if (link != null) {
173          return link;
174        }
175        ValueExpression ve = getValueExpression("link");
176        if (ve != null) {
177          try {
178            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
179          } catch (ELException e) {
180                      throw new FacesException(e);
181              }
182        }
183        return null;
184      }
185    
186      public void setLink(java.lang.String link) {
187        this.link = link;
188      }
189    
190      /**
191      Deprecated! Use 'label' instead.
192       Text value to display as label.
193       If text contains an underscore the next character overwrites 'accesskey'.
194    
195      @deprecated*/
196      @Deprecated
197      public java.lang.String getLabelWithAccessKey() {
198        if (labelWithAccessKey != null) {
199          return labelWithAccessKey;
200        }
201        ValueExpression ve = getValueExpression("labelWithAccessKey");
202        if (ve != null) {
203          try {
204            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
205          } catch (ELException e) {
206                      throw new FacesException(e);
207              }
208        }
209        return null;
210      }
211    
212      @Deprecated
213      public void setLabelWithAccessKey(java.lang.String labelWithAccessKey) {
214        this.labelWithAccessKey = labelWithAccessKey;
215      }
216    
217      public org.apache.myfaces.tobago.layout.Measure getMinimumHeight() {
218        if (minimumHeight != null) {
219          return minimumHeight;
220        }
221        ValueExpression ve = getValueExpression("minimumHeight");
222        if (ve != null) {
223          try {
224            Object object = ve.getValue(getFacesContext().getELContext());
225            return Measure.valueOf(object);
226          } catch (ELException e) {
227                      throw new FacesException(e);
228              }
229        }
230        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumHeight(getFacesContext(), this);
231      }
232    
233      public void setMinimumHeight(org.apache.myfaces.tobago.layout.Measure minimumHeight) {
234        this.minimumHeight = minimumHeight;
235      }
236    
237      /**
238      Text value to display as tooltip.
239    
240      */
241      public java.lang.String getTip() {
242        if (tip != null) {
243          return tip;
244        }
245        ValueExpression ve = getValueExpression("tip");
246        if (ve != null) {
247          try {
248            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
249          } catch (ELException e) {
250                      throw new FacesException(e);
251              }
252        }
253        return null;
254      }
255    
256      public void setTip(java.lang.String tip) {
257        this.tip = tip;
258      }
259    
260      /**
261      This value will usually be set by the layout manager.
262    
263      */
264      public org.apache.myfaces.tobago.layout.Measure getHeight() {
265        if (height != null) {
266          return height;
267        }
268        ValueExpression ve = getValueExpression("height");
269        if (ve != null) {
270          try {
271            Object object = ve.getValue(getFacesContext().getELContext());
272            return Measure.valueOf(object);
273          } catch (ELException e) {
274                      throw new FacesException(e);
275              }
276        }
277        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getHeight(getFacesContext(), this);
278      }
279    
280      public void setHeight(org.apache.myfaces.tobago.layout.Measure height) {
281        this.height = height;
282      }
283    
284      public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() {
285        if (minimumWidth != null) {
286          return minimumWidth;
287        }
288        ValueExpression ve = getValueExpression("minimumWidth");
289        if (ve != null) {
290          try {
291            Object object = ve.getValue(getFacesContext().getELContext());
292            return Measure.valueOf(object);
293          } catch (ELException e) {
294                      throw new FacesException(e);
295              }
296        }
297        return ((LayoutComponentRenderer)getRenderer(getFacesContext())).getMinimumWidth(getFacesContext(), this);
298      }
299    
300      public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) {
301        this.minimumWidth = minimumWidth;
302      }
303    
304      public java.lang.Integer getRowSpan() {
305        if (rowSpan != null) {
306          return rowSpan;
307        }
308        ValueExpression ve = getValueExpression("rowSpan");
309        if (ve != null) {
310          try {
311            Number number = (Number) ve.getValue(getFacesContext().getELContext());
312            if (number != null) {
313              return number.intValue();
314            }
315          } catch (ELException e) {
316                      throw new FacesException(e);
317              }
318        }
319        return 1;
320      }
321    
322      public void setRowSpan(java.lang.Integer rowSpan) {
323        this.rowSpan = rowSpan;
324      }
325    
326      /**
327      This value will usually be set by the layout manager.
328    
329      */
330      public org.apache.myfaces.tobago.layout.Measure getLeft() {
331        if (left != null) {
332          return left;
333        }
334        ValueExpression ve = getValueExpression("left");
335        if (ve != null) {
336          try {
337            Object object = ve.getValue(getFacesContext().getELContext());
338            return Measure.valueOf(object);
339          } catch (ELException e) {
340                      throw new FacesException(e);
341              }
342        }
343        return null;
344      }
345    
346      public void setLeft(org.apache.myfaces.tobago.layout.Measure left) {
347        this.left = left;
348      }
349    
350      public java.lang.Integer getColumnSpan() {
351        if (columnSpan != null) {
352          return columnSpan;
353        }
354        ValueExpression ve = getValueExpression("columnSpan");
355        if (ve != null) {
356          try {
357            Number number = (Number) ve.getValue(getFacesContext().getELContext());
358            if (number != null) {
359              return number.intValue();
360            }
361          } catch (ELException e) {
362                      throw new FacesException(e);
363              }
364        }
365        return 1;
366      }
367    
368      public void setColumnSpan(java.lang.Integer columnSpan) {
369        this.columnSpan = columnSpan;
370      }
371    
372      /**
373      This value will usually be set by the layout manager.
374    
375      */
376      public org.apache.myfaces.tobago.layout.Measure getTop() {
377        if (top != null) {
378          return top;
379        }
380        ValueExpression ve = getValueExpression("top");
381        if (ve != null) {
382          try {
383            Object object = ve.getValue(getFacesContext().getELContext());
384            return Measure.valueOf(object);
385          } catch (ELException e) {
386                      throw new FacesException(e);
387              }
388        }
389        return null;
390      }
391    
392      public void setTop(org.apache.myfaces.tobago.layout.Measure top) {
393        this.top = top;
394      }
395    
396      public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() {
397        if (maximumHeight != null) {
398          return maximumHeight;
399        }
400        ValueExpression ve = getValueExpression("maximumHeight");
401        if (ve != null) {
402          try {
403            Object object = ve.getValue(getFacesContext().getELContext());
404            return Measure.valueOf(object);
405          } catch (ELException e) {
406                      throw new FacesException(e);
407              }
408        }
409        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this);
410      }
411    
412      public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) {
413        this.maximumHeight = maximumHeight;
414      }
415    
416      /**
417      This value will usually be set by the layout manager. It holds the current width computed by the layout manager.
418    
419      */
420      public org.apache.myfaces.tobago.layout.Measure getCurrentWidth() {
421        if (currentWidth != null) {
422          return currentWidth;
423        }
424        ValueExpression ve = getValueExpression("currentWidth");
425        if (ve != null) {
426          try {
427            Object object = ve.getValue(getFacesContext().getELContext());
428            return Measure.valueOf(object);
429          } catch (ELException e) {
430                      throw new FacesException(e);
431              }
432        }
433        return getWidth();
434      }
435    
436      public void setCurrentWidth(org.apache.myfaces.tobago.layout.Measure currentWidth) {
437        this.currentWidth = currentWidth;
438      }
439    
440      public org.apache.myfaces.tobago.layout.Measure getMarginTop() {
441        if (marginTop != null) {
442          return marginTop;
443        }
444        ValueExpression ve = getValueExpression("marginTop");
445        if (ve != null) {
446          try {
447            Object object = ve.getValue(getFacesContext().getELContext());
448            return Measure.valueOf(object);
449          } catch (ELException e) {
450                      throw new FacesException(e);
451              }
452        }
453        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this);
454      }
455    
456      public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) {
457        this.marginTop = marginTop;
458      }
459    
460      /**
461      This value will usually be set by the layout manager.
462    
463      */
464      public org.apache.myfaces.tobago.layout.Measure getWidth() {
465        if (width != null) {
466          return width;
467        }
468        ValueExpression ve = getValueExpression("width");
469        if (ve != null) {
470          try {
471            Object object = ve.getValue(getFacesContext().getELContext());
472            return Measure.valueOf(object);
473          } catch (ELException e) {
474                      throw new FacesException(e);
475              }
476        }
477        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getWidth(getFacesContext(), this);
478      }
479    
480      public void setWidth(org.apache.myfaces.tobago.layout.Measure width) {
481        this.width = width;
482      }
483    
484      public org.apache.myfaces.tobago.layout.Measure getMarginRight() {
485        if (marginRight != null) {
486          return marginRight;
487        }
488        ValueExpression ve = getValueExpression("marginRight");
489        if (ve != null) {
490          try {
491            Object object = ve.getValue(getFacesContext().getELContext());
492            return Measure.valueOf(object);
493          } catch (ELException e) {
494                      throw new FacesException(e);
495              }
496        }
497        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this);
498      }
499    
500      public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) {
501        this.marginRight = marginRight;
502      }
503    
504      public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() {
505        if (preferredHeight != null) {
506          return preferredHeight;
507        }
508        ValueExpression ve = getValueExpression("preferredHeight");
509        if (ve != null) {
510          try {
511            Object object = ve.getValue(getFacesContext().getELContext());
512            return Measure.valueOf(object);
513          } catch (ELException e) {
514                      throw new FacesException(e);
515              }
516        }
517        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this);
518      }
519    
520      public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) {
521        this.preferredHeight = preferredHeight;
522      }
523    
524      /**
525      Link to an internal resource.
526       Resources will be processed by the resource management.
527       E. g. define help.html and it will be served help_es.html or help_de.html if available.
528       For JSF-Pages you have to set the jsfResource attribute.
529    
530      */
531      public java.lang.String getResource() {
532        if (resource != null) {
533          return resource;
534        }
535        ValueExpression ve = getValueExpression("resource");
536        if (ve != null) {
537          try {
538            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
539          } catch (ELException e) {
540                      throw new FacesException(e);
541              }
542        }
543        return null;
544      }
545    
546      public void setResource(java.lang.String resource) {
547        this.resource = resource;
548      }
549    
550      /**
551      Flag indicating that the resource referenced by the resource attribute is a jsf resource.
552       That means that the url has to be processed to change the prefix or suffix (e. g. *.jsf or
553       /faces/*). Default is false.
554      <br />Default: <code>false</code>
555      */
556      public boolean isJsfResource() {
557        if (jsfResource != null) {
558          return jsfResource;
559        }
560        ValueExpression ve = getValueExpression("jsfResource");
561        if (ve != null) {
562          try {
563            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
564            if (bool != null) {
565              return bool;
566            }
567          } catch (ELException e) {
568                      throw new FacesException(e);
569              }
570        }
571        return false;
572      }
573    
574      public void setJsfResource(boolean jsfResource) {
575        this.jsfResource = jsfResource;
576      }
577    
578      /**
579      This value will usually be set by the layout manager. It holds the current height computed by the layout manager.
580    
581      */
582      public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() {
583        if (currentHeight != null) {
584          return currentHeight;
585        }
586        ValueExpression ve = getValueExpression("currentHeight");
587        if (ve != null) {
588          try {
589            Object object = ve.getValue(getFacesContext().getELContext());
590            return Measure.valueOf(object);
591          } catch (ELException e) {
592                      throw new FacesException(e);
593              }
594        }
595        return getHeight();
596      }
597    
598      public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) {
599        this.currentHeight = currentHeight;
600      }
601    
602      /**
603      Specify, if the command calls an JSF-Action.
604       Useful to switch off the Double-Submit-Check and Waiting-Behavior.
605      <br />Default: <code>true</code>
606      */
607      public boolean isTransition() {
608        if (transition != null) {
609          return transition;
610        }
611        ValueExpression ve = getValueExpression("transition");
612        if (ve != null) {
613          try {
614            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
615            if (bool != null) {
616              return bool;
617            }
618          } catch (ELException e) {
619                      throw new FacesException(e);
620              }
621        }
622        return true;
623      }
624    
625      public void setTransition(boolean transition) {
626        this.transition = transition;
627      }
628    
629      /**
630      Url to an image to display.
631    
632      */
633      public java.lang.String getImage() {
634        if (image != null) {
635          return image;
636        }
637        ValueExpression ve = getValueExpression("image");
638        if (ve != null) {
639          try {
640            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
641          } catch (ELException e) {
642                      throw new FacesException(e);
643              }
644        }
645        return null;
646      }
647    
648      public void setImage(java.lang.String image) {
649        this.image = image;
650      }
651    
652      /**
653      Text value to display as label.
654       If text contains an underscore the next character is used as accesskey.
655    
656      */
657      public java.lang.String getLabel() {
658        if (label != null) {
659          return label;
660        }
661        ValueExpression ve = getValueExpression("label");
662        if (ve != null) {
663          try {
664            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
665          } catch (ELException e) {
666                      throw new FacesException(e);
667              }
668        }
669        return null;
670      }
671    
672      public void setLabel(java.lang.String label) {
673        this.label = label;
674      }
675    
676      /**
677      This attribute is for internal use only.
678    
679      */
680      public org.apache.myfaces.tobago.layout.Display getDisplay() {
681        if (display != null) {
682          return display;
683        }
684        ValueExpression ve = getValueExpression("display");
685        if (ve != null) {
686          try {
687            return (org.apache.myfaces.tobago.layout.Display) ve.getValue(getFacesContext().getELContext());
688          } catch (ELException e) {
689                      throw new FacesException(e);
690              }
691        }
692        return null;
693      }
694    
695      public void setDisplay(org.apache.myfaces.tobago.layout.Display display) {
696        this.display = display;
697      }
698    
699      public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() {
700        if (maximumWidth != null) {
701          return maximumWidth;
702        }
703        ValueExpression ve = getValueExpression("maximumWidth");
704        if (ve != null) {
705          try {
706            Object object = ve.getValue(getFacesContext().getELContext());
707            return Measure.valueOf(object);
708          } catch (ELException e) {
709                      throw new FacesException(e);
710              }
711        }
712        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this);
713      }
714    
715      public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) {
716        this.maximumWidth = maximumWidth;
717      }
718    
719      public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() {
720        if (preferredWidth != null) {
721          return preferredWidth;
722        }
723        ValueExpression ve = getValueExpression("preferredWidth");
724        if (ve != null) {
725          try {
726            Object object = ve.getValue(getFacesContext().getELContext());
727            return Measure.valueOf(object);
728          } catch (ELException e) {
729                      throw new FacesException(e);
730              }
731        }
732        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this);
733      }
734    
735      public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) {
736        this.preferredWidth = preferredWidth;
737      }
738    
739      /**
740      Flag indicating that, if this component is activated by the user,
741       notifications should be delivered to interested listeners and actions
742       immediately (that is, during Apply Request Values phase) rather than
743       waiting until Invoke Application phase.
744      <br />Default: <code>false</code>
745      */
746      public boolean isImmediate() {
747        if (immediate != null) {
748          return immediate;
749        }
750        ValueExpression ve = getValueExpression("immediate");
751        if (ve != null) {
752          try {
753            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
754            if (bool != null) {
755              return bool;
756            }
757          } catch (ELException e) {
758                      throw new FacesException(e);
759              }
760        }
761        return false;
762      }
763    
764      public void setImmediate(boolean immediate) {
765        this.immediate = immediate;
766      }
767    
768      public org.apache.myfaces.tobago.layout.Measure getMarginBottom() {
769        if (marginBottom != null) {
770          return marginBottom;
771        }
772        ValueExpression ve = getValueExpression("marginBottom");
773        if (ve != null) {
774          try {
775            Object object = ve.getValue(getFacesContext().getELContext());
776            return Measure.valueOf(object);
777          } catch (ELException e) {
778                      throw new FacesException(e);
779              }
780        }
781        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this);
782      }
783    
784      public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) {
785        this.marginBottom = marginBottom;
786      }
787    
788      /**
789      This attribute is for internal use only.
790    
791      */
792      public java.lang.Integer getVerticalIndex() {
793        if (verticalIndex != null) {
794          return verticalIndex;
795        }
796        ValueExpression ve = getValueExpression("verticalIndex");
797        if (ve != null) {
798          try {
799            Number number = (Number) ve.getValue(getFacesContext().getELContext());
800            if (number != null) {
801              return number.intValue();
802            }
803          } catch (ELException e) {
804                      throw new FacesException(e);
805              }
806        }
807        return null;
808      }
809    
810      public void setVerticalIndex(java.lang.Integer verticalIndex) {
811        this.verticalIndex = verticalIndex;
812      }
813    
814      public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
815        if (currentMarkup != null) {
816          return currentMarkup;
817        }
818        return null;
819      }
820    
821      public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
822        this.currentMarkup = currentMarkup;
823      }
824    
825      /**
826      Indicate the partially rendered Components in a case of a submit.
827    
828      */
829      public String[] getRenderedPartially() {
830        if (renderedPartially != null) {
831          return renderedPartially;
832        }
833        ValueExpression ve = getValueExpression("renderedPartially");
834        if (ve != null) {
835          try {
836            Object strArray = ve.getValue(getFacesContext().getELContext());
837            if (strArray instanceof String[]) {
838              return (String[]) strArray;
839            } else if (strArray instanceof String) {
840              String[] strings = StringUtils.split((String) strArray, ", ");
841              List<String> result = new ArrayList<String>(strings.length);
842              for (String string : strings) {
843                if (string.trim().length() != 0) {
844                  result.add(string.trim());
845                }
846              }
847              return result.toArray(new String[result.size()]);
848            } else if (strArray == null) {
849              return ArrayUtils.EMPTY_STRING_ARRAY;
850            } else {
851              return new String[]{strArray.toString()};
852            }
853          } catch (ELException e) {
854                      throw new FacesException(e);
855              }
856        }
857        return ArrayUtils.EMPTY_STRING_ARRAY;
858      }
859    
860      public void setRenderedPartially(String[] renderedPartially) {
861        this.renderedPartially = renderedPartially;
862      }
863    
864      /**
865      Name of a frame where the resource retrieved via this hyperlink is to be
866       displayed.
867    
868      */
869      public java.lang.String getTarget() {
870        if (target != null) {
871          return target;
872        }
873        ValueExpression ve = getValueExpression("target");
874        if (ve != null) {
875          try {
876            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
877          } catch (ELException e) {
878                      throw new FacesException(e);
879              }
880        }
881        return null;
882      }
883    
884      public void setTarget(java.lang.String target) {
885        this.target = target;
886      }
887    
888      /**
889      Script to be invoked when clicked
890    
891      */
892      public java.lang.String getOnclick() {
893        if (onclick != null) {
894          return onclick;
895        }
896        ValueExpression ve = getValueExpression("onclick");
897        if (ve != null) {
898          try {
899            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
900          } catch (ELException e) {
901                      throw new FacesException(e);
902              }
903        }
904        return null;
905      }
906    
907      public void setOnclick(java.lang.String onclick) {
908        this.onclick = onclick;
909      }
910    
911      /**
912      This attribute is for internal use only.
913    
914      */
915      public java.lang.Integer getHorizontalIndex() {
916        if (horizontalIndex != null) {
917          return horizontalIndex;
918        }
919        ValueExpression ve = getValueExpression("horizontalIndex");
920        if (ve != null) {
921          try {
922            Number number = (Number) ve.getValue(getFacesContext().getELContext());
923            if (number != null) {
924              return number.intValue();
925            }
926          } catch (ELException e) {
927                      throw new FacesException(e);
928              }
929        }
930        return null;
931      }
932    
933      public void setHorizontalIndex(java.lang.Integer horizontalIndex) {
934        this.horizontalIndex = horizontalIndex;
935      }
936    
937      /**
938      Flag indicating that this element is disabled.
939      <br />Default: <code>false</code>
940      */
941      public boolean isDisabled() {
942        if (disabled != null) {
943          return disabled;
944        }
945        ValueExpression ve = getValueExpression("disabled");
946        if (ve != null) {
947          try {
948            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
949            if (bool != null) {
950              return bool;
951            }
952          } catch (ELException e) {
953                      throw new FacesException(e);
954              }
955        }
956        return false;
957      }
958    
959      public void setDisabled(boolean disabled) {
960        this.disabled = disabled;
961      }
962    
963      public void restoreState(FacesContext context, Object componentState) {
964        Object[] values = (Object[]) componentState;
965        super.restoreState(context, values[0]);
966        markup = (org.apache.myfaces.tobago.context.Markup) values[1];
967        accessKey = (java.lang.Character) values[2];
968        marginLeft = (org.apache.myfaces.tobago.layout.Measure) values[3];
969        link = (java.lang.String) values[4];
970        labelWithAccessKey = (java.lang.String) values[5];
971        minimumHeight = (org.apache.myfaces.tobago.layout.Measure) values[6];
972        tip = (java.lang.String) values[7];
973        height = (org.apache.myfaces.tobago.layout.Measure) values[8];
974        minimumWidth = (org.apache.myfaces.tobago.layout.Measure) values[9];
975        rowSpan = (java.lang.Integer) values[10];
976        left = (org.apache.myfaces.tobago.layout.Measure) values[11];
977        columnSpan = (java.lang.Integer) values[12];
978        top = (org.apache.myfaces.tobago.layout.Measure) values[13];
979        maximumHeight = (org.apache.myfaces.tobago.layout.Measure) values[14];
980        currentWidth = (org.apache.myfaces.tobago.layout.Measure) values[15];
981        marginTop = (org.apache.myfaces.tobago.layout.Measure) values[16];
982        width = (org.apache.myfaces.tobago.layout.Measure) values[17];
983        marginRight = (org.apache.myfaces.tobago.layout.Measure) values[18];
984        preferredHeight = (org.apache.myfaces.tobago.layout.Measure) values[19];
985        resource = (java.lang.String) values[20];
986        jsfResource = (java.lang.Boolean) values[21];
987        currentHeight = (org.apache.myfaces.tobago.layout.Measure) values[22];
988        transition = (java.lang.Boolean) values[23];
989        image = (java.lang.String) values[24];
990        label = (java.lang.String) values[25];
991        display = (org.apache.myfaces.tobago.layout.Display) values[26];
992        maximumWidth = (org.apache.myfaces.tobago.layout.Measure) values[27];
993        preferredWidth = (org.apache.myfaces.tobago.layout.Measure) values[28];
994        immediate = (java.lang.Boolean) values[29];
995        marginBottom = (org.apache.myfaces.tobago.layout.Measure) values[30];
996        verticalIndex = (java.lang.Integer) values[31];
997        renderedPartially = (java.lang.String[]) values[32];
998        target = (java.lang.String) values[33];
999        onclick = (java.lang.String) values[34];
1000        horizontalIndex = (java.lang.Integer) values[35];
1001        disabled = (java.lang.Boolean) values[36];
1002      }
1003    
1004      public Object saveState(FacesContext context) {
1005        Object[] values = new Object[37];
1006        values[0] = super.saveState(context);
1007        values[1] = markup;
1008        values[2] = accessKey;
1009        values[3] = marginLeft;
1010        values[4] = link;
1011        values[5] = labelWithAccessKey;
1012        values[6] = minimumHeight;
1013        values[7] = tip;
1014        values[8] = height;
1015        values[9] = minimumWidth;
1016        values[10] = rowSpan;
1017        values[11] = left;
1018        values[12] = columnSpan;
1019        values[13] = top;
1020        values[14] = maximumHeight;
1021        values[15] = currentWidth;
1022        values[16] = marginTop;
1023        values[17] = width;
1024        values[18] = marginRight;
1025        values[19] = preferredHeight;
1026        values[20] = resource;
1027        values[21] = jsfResource;
1028        values[22] = currentHeight;
1029        values[23] = transition;
1030        values[24] = image;
1031        values[25] = label;
1032        values[26] = display;
1033        values[27] = maximumWidth;
1034        values[28] = preferredWidth;
1035        values[29] = immediate;
1036        values[30] = marginBottom;
1037        values[31] = verticalIndex;
1038        values[32] = renderedPartially;
1039        values[33] = target;
1040        values[34] = onclick;
1041        values[35] = horizontalIndex;
1042        values[36] = disabled;
1043        currentMarkup = null;
1044        return values;
1045      }
1046    
1047    
1048    }