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.AbstractUIToolBar;
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     <p/>
044      Renders a toolbar.<p />
045      Allowed subcomponents are subtypes of UICommand i.e.
046      <code>'button'</code> and <code>'link'</code> tags.
047      These are rendered by ToolbarRenderer, so the result has
048      no difference.<p />
049      To add an dropdown menu to a button add a facet <code>'menupopup'</code>
050      containing a
051      <a href="menu.html"><code>&lt;tc:menu></code></a>
052      tag to the button. Label's and Image's on those menu tag's are ignored
053      and replaced by the renderer.
054      <pre>
055           &lt;tc:button onclick="alert('test 0')"
056               label="Alert 0" &gt;
057             &lt;f:facet name="menupopup"&gt;
058               &lt;tc:menu&gt;
059                 &lt;tc:menuCommand onclick="alert('test 1')" label="Alert 1"/&gt;
060                 &lt;tc:menuCommand onclick="alert('test 2')" label="Alert 2"/&gt;
061                 &lt;tc:menuCommand onclick="alert('test 3')" label="Alert 3"/&gt;
062               &lt;/tc:menu&gt;
063             &lt;/f:facet&gt;
064           &lt;/tc:button&gt;
065           </pre>
066      * UIComponent class, generated from template {@code component1.2.stg} with class
067      * {@link org.apache.myfaces.tobago.internal.taglib.component.ToolBarTagDeclaration}.
068     */
069    public class UIToolBar
070        extends AbstractUIToolBar implements SupportsMarkup {
071    
072      public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.ToolBar";
073    
074      private org.apache.myfaces.tobago.context.Markup markup;
075      private org.apache.myfaces.tobago.layout.Measure marginLeft;
076      private org.apache.myfaces.tobago.layout.Measure minimumHeight;
077      private org.apache.myfaces.tobago.layout.Measure borderLeft;
078      private java.lang.String tip;
079      private org.apache.myfaces.tobago.layout.Measure height;
080      private org.apache.myfaces.tobago.layout.Measure minimumWidth;
081      private java.lang.Integer rowSpan;
082      private org.apache.myfaces.tobago.layout.Measure left;
083      private java.lang.Integer columnSpan;
084      private org.apache.myfaces.tobago.layout.Measure borderRight;
085      private org.apache.myfaces.tobago.layout.Measure paddingBottom;
086      private org.apache.myfaces.tobago.layout.Measure maximumHeight;
087      private org.apache.myfaces.tobago.layout.Measure top;
088      private java.lang.String orientation;
089      private org.apache.myfaces.tobago.layout.Measure currentWidth;
090      private org.apache.myfaces.tobago.layout.Measure paddingTop;
091      private org.apache.myfaces.tobago.layout.Measure marginTop;
092      private org.apache.myfaces.tobago.layout.Measure marginRight;
093      private org.apache.myfaces.tobago.layout.Measure width;
094      private org.apache.myfaces.tobago.layout.Measure currentHeight;
095      private org.apache.myfaces.tobago.layout.Measure preferredHeight;
096      private java.lang.String labelPosition;
097      private org.apache.myfaces.tobago.layout.Display display;
098      private org.apache.myfaces.tobago.layout.Measure borderBottom;
099      private org.apache.myfaces.tobago.layout.Measure maximumWidth;
100      private org.apache.myfaces.tobago.layout.Measure paddingLeft;
101      private org.apache.myfaces.tobago.layout.Measure paddingRight;
102      private org.apache.myfaces.tobago.layout.Measure preferredWidth;
103      private org.apache.myfaces.tobago.layout.Measure marginBottom;
104      private java.lang.String iconSize;
105      private java.lang.Integer verticalIndex;
106      private org.apache.myfaces.tobago.layout.Measure borderTop;
107      private org.apache.myfaces.tobago.context.Markup currentMarkup;
108      private java.lang.Integer horizontalIndex;
109    
110    
111      public org.apache.myfaces.tobago.context.Markup getMarkup() {
112        if (markup != null) {
113          return markup;
114        }
115        ValueExpression ve = getValueExpression("markup");
116        if (ve != null) {
117          try {
118            Object object = ve.getValue(getFacesContext().getELContext());
119            return Markup.valueOf(object);
120          } catch (ELException e) {
121                      throw new FacesException(e);
122              }
123        }
124        return null;
125      }
126    
127      public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
128        this.markup = markup;
129      }
130    
131      public org.apache.myfaces.tobago.layout.Measure getMarginLeft() {
132        if (marginLeft != null) {
133          return marginLeft;
134        }
135        ValueExpression ve = getValueExpression("marginLeft");
136        if (ve != null) {
137          try {
138            Object object = ve.getValue(getFacesContext().getELContext());
139            return Measure.valueOf(object);
140          } catch (ELException e) {
141                      throw new FacesException(e);
142              }
143        }
144        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginLeft(getFacesContext(), this);
145      }
146    
147      public void setMarginLeft(org.apache.myfaces.tobago.layout.Measure marginLeft) {
148        this.marginLeft = marginLeft;
149      }
150    
151      public org.apache.myfaces.tobago.layout.Measure getMinimumHeight() {
152        if (minimumHeight != null) {
153          return minimumHeight;
154        }
155        ValueExpression ve = getValueExpression("minimumHeight");
156        if (ve != null) {
157          try {
158            Object object = ve.getValue(getFacesContext().getELContext());
159            return Measure.valueOf(object);
160          } catch (ELException e) {
161                      throw new FacesException(e);
162              }
163        }
164        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumHeight(getFacesContext(), this);
165      }
166    
167      public void setMinimumHeight(org.apache.myfaces.tobago.layout.Measure minimumHeight) {
168        this.minimumHeight = minimumHeight;
169      }
170    
171      /**
172      This attribute is for internal use only.
173    
174      */
175      public org.apache.myfaces.tobago.layout.Measure getBorderLeft() {
176        if (borderLeft != null) {
177          return borderLeft;
178        }
179        ValueExpression ve = getValueExpression("borderLeft");
180        if (ve != null) {
181          try {
182            Object object = ve.getValue(getFacesContext().getELContext());
183            return Measure.valueOf(object);
184          } catch (ELException e) {
185                      throw new FacesException(e);
186              }
187        }
188        return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
189      getRenderer(getFacesContext())).getBorderLeft(getFacesContext(), this);
190      }
191    
192      public void setBorderLeft(org.apache.myfaces.tobago.layout.Measure borderLeft) {
193        this.borderLeft = borderLeft;
194      }
195    
196      /**
197      Text value to display as tooltip.
198    
199      */
200      public java.lang.String getTip() {
201        if (tip != null) {
202          return tip;
203        }
204        ValueExpression ve = getValueExpression("tip");
205        if (ve != null) {
206          try {
207            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
208          } catch (ELException e) {
209                      throw new FacesException(e);
210              }
211        }
212        return null;
213      }
214    
215      public void setTip(java.lang.String tip) {
216        this.tip = tip;
217      }
218    
219      /**
220      This value will usually be set by the layout manager.
221    
222      */
223      public org.apache.myfaces.tobago.layout.Measure getHeight() {
224        if (height != null) {
225          return height;
226        }
227        ValueExpression ve = getValueExpression("height");
228        if (ve != null) {
229          try {
230            Object object = ve.getValue(getFacesContext().getELContext());
231            return Measure.valueOf(object);
232          } catch (ELException e) {
233                      throw new FacesException(e);
234              }
235        }
236        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getHeight(getFacesContext(), this);
237      }
238    
239      public void setHeight(org.apache.myfaces.tobago.layout.Measure height) {
240        this.height = height;
241      }
242    
243      public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() {
244        if (minimumWidth != null) {
245          return minimumWidth;
246        }
247        ValueExpression ve = getValueExpression("minimumWidth");
248        if (ve != null) {
249          try {
250            Object object = ve.getValue(getFacesContext().getELContext());
251            return Measure.valueOf(object);
252          } catch (ELException e) {
253                      throw new FacesException(e);
254              }
255        }
256        return ((LayoutComponentRenderer)getRenderer(getFacesContext())).getMinimumWidth(getFacesContext(), this);
257      }
258    
259      public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) {
260        this.minimumWidth = minimumWidth;
261      }
262    
263      public java.lang.Integer getRowSpan() {
264        if (rowSpan != null) {
265          return rowSpan;
266        }
267        ValueExpression ve = getValueExpression("rowSpan");
268        if (ve != null) {
269          try {
270            Number number = (Number) ve.getValue(getFacesContext().getELContext());
271            if (number != null) {
272              return number.intValue();
273            }
274          } catch (ELException e) {
275                      throw new FacesException(e);
276              }
277        }
278        return 1;
279      }
280    
281      public void setRowSpan(java.lang.Integer rowSpan) {
282        this.rowSpan = rowSpan;
283      }
284    
285      /**
286      This value will usually be set by the layout manager.
287    
288      */
289      public org.apache.myfaces.tobago.layout.Measure getLeft() {
290        if (left != null) {
291          return left;
292        }
293        ValueExpression ve = getValueExpression("left");
294        if (ve != null) {
295          try {
296            Object object = ve.getValue(getFacesContext().getELContext());
297            return Measure.valueOf(object);
298          } catch (ELException e) {
299                      throw new FacesException(e);
300              }
301        }
302        return null;
303      }
304    
305      public void setLeft(org.apache.myfaces.tobago.layout.Measure left) {
306        this.left = left;
307      }
308    
309      public java.lang.Integer getColumnSpan() {
310        if (columnSpan != null) {
311          return columnSpan;
312        }
313        ValueExpression ve = getValueExpression("columnSpan");
314        if (ve != null) {
315          try {
316            Number number = (Number) ve.getValue(getFacesContext().getELContext());
317            if (number != null) {
318              return number.intValue();
319            }
320          } catch (ELException e) {
321                      throw new FacesException(e);
322              }
323        }
324        return 1;
325      }
326    
327      public void setColumnSpan(java.lang.Integer columnSpan) {
328        this.columnSpan = columnSpan;
329      }
330    
331      /**
332      This attribute is for internal use only.
333    
334      */
335      public org.apache.myfaces.tobago.layout.Measure getBorderRight() {
336        if (borderRight != null) {
337          return borderRight;
338        }
339        ValueExpression ve = getValueExpression("borderRight");
340        if (ve != null) {
341          try {
342            Object object = ve.getValue(getFacesContext().getELContext());
343            return Measure.valueOf(object);
344          } catch (ELException e) {
345                      throw new FacesException(e);
346              }
347        }
348        return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
349      getRenderer(getFacesContext())).getBorderRight(getFacesContext(), this);
350      }
351    
352      public void setBorderRight(org.apache.myfaces.tobago.layout.Measure borderRight) {
353        this.borderRight = borderRight;
354      }
355    
356      /**
357      This attribute is for internal use only.
358    
359      */
360      public org.apache.myfaces.tobago.layout.Measure getPaddingBottom() {
361        if (paddingBottom != null) {
362          return paddingBottom;
363        }
364        ValueExpression ve = getValueExpression("paddingBottom");
365        if (ve != null) {
366          try {
367            Object object = ve.getValue(getFacesContext().getELContext());
368            return Measure.valueOf(object);
369          } catch (ELException e) {
370                      throw new FacesException(e);
371              }
372        }
373        return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
374      getRenderer(getFacesContext())).getPaddingBottom(getFacesContext(), this);
375      }
376    
377      public void setPaddingBottom(org.apache.myfaces.tobago.layout.Measure paddingBottom) {
378        this.paddingBottom = paddingBottom;
379      }
380    
381      public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() {
382        if (maximumHeight != null) {
383          return maximumHeight;
384        }
385        ValueExpression ve = getValueExpression("maximumHeight");
386        if (ve != null) {
387          try {
388            Object object = ve.getValue(getFacesContext().getELContext());
389            return Measure.valueOf(object);
390          } catch (ELException e) {
391                      throw new FacesException(e);
392              }
393        }
394        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this);
395      }
396    
397      public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) {
398        this.maximumHeight = maximumHeight;
399      }
400    
401      /**
402      This value will usually be set by the layout manager.
403    
404      */
405      public org.apache.myfaces.tobago.layout.Measure getTop() {
406        if (top != null) {
407          return top;
408        }
409        ValueExpression ve = getValueExpression("top");
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 null;
419      }
420    
421      public void setTop(org.apache.myfaces.tobago.layout.Measure top) {
422        this.top = top;
423      }
424    
425      /**
426      Orientation of toolbar
427      <br />Default: <code>left</code><br />Allowed Values: <code>left,right</code>
428      */
429      public java.lang.String getOrientation() {
430        if (orientation != null) {
431          return orientation;
432        }
433        ValueExpression ve = getValueExpression("orientation");
434        if (ve != null) {
435          try {
436            java.lang.String orientation = (java.lang.String) ve.getValue(getFacesContext().getELContext());
437            if (orientation != null) {
438              return orientation;
439            }
440          } catch (ELException e) {
441                      throw new FacesException(e);
442              }
443        }
444        return "left";
445      }
446    
447      public void setOrientation(java.lang.String orientation) {
448        this.orientation = orientation;
449      }
450    
451      /**
452      This value will usually be set by the layout manager. It holds the current width computed by the layout manager.
453    
454      */
455      public org.apache.myfaces.tobago.layout.Measure getCurrentWidth() {
456        if (currentWidth != null) {
457          return currentWidth;
458        }
459        ValueExpression ve = getValueExpression("currentWidth");
460        if (ve != null) {
461          try {
462            Object object = ve.getValue(getFacesContext().getELContext());
463            return Measure.valueOf(object);
464          } catch (ELException e) {
465                      throw new FacesException(e);
466              }
467        }
468        return getWidth();
469      }
470    
471      public void setCurrentWidth(org.apache.myfaces.tobago.layout.Measure currentWidth) {
472        this.currentWidth = currentWidth;
473      }
474    
475      /**
476      This attribute is for internal use only.
477    
478      */
479      public org.apache.myfaces.tobago.layout.Measure getPaddingTop() {
480        if (paddingTop != null) {
481          return paddingTop;
482        }
483        ValueExpression ve = getValueExpression("paddingTop");
484        if (ve != null) {
485          try {
486            Object object = ve.getValue(getFacesContext().getELContext());
487            return Measure.valueOf(object);
488          } catch (ELException e) {
489                      throw new FacesException(e);
490              }
491        }
492        return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
493      getRenderer(getFacesContext())).getPaddingTop(getFacesContext(), this);
494      }
495    
496      public void setPaddingTop(org.apache.myfaces.tobago.layout.Measure paddingTop) {
497        this.paddingTop = paddingTop;
498      }
499    
500      public org.apache.myfaces.tobago.layout.Measure getMarginTop() {
501        if (marginTop != null) {
502          return marginTop;
503        }
504        ValueExpression ve = getValueExpression("marginTop");
505        if (ve != null) {
506          try {
507            Object object = ve.getValue(getFacesContext().getELContext());
508            return Measure.valueOf(object);
509          } catch (ELException e) {
510                      throw new FacesException(e);
511              }
512        }
513        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this);
514      }
515    
516      public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) {
517        this.marginTop = marginTop;
518      }
519    
520      public org.apache.myfaces.tobago.layout.Measure getMarginRight() {
521        if (marginRight != null) {
522          return marginRight;
523        }
524        ValueExpression ve = getValueExpression("marginRight");
525        if (ve != null) {
526          try {
527            Object object = ve.getValue(getFacesContext().getELContext());
528            return Measure.valueOf(object);
529          } catch (ELException e) {
530                      throw new FacesException(e);
531              }
532        }
533        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this);
534      }
535    
536      public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) {
537        this.marginRight = marginRight;
538      }
539    
540      /**
541      This value will usually be set by the layout manager.
542    
543      */
544      public org.apache.myfaces.tobago.layout.Measure getWidth() {
545        if (width != null) {
546          return width;
547        }
548        ValueExpression ve = getValueExpression("width");
549        if (ve != null) {
550          try {
551            Object object = ve.getValue(getFacesContext().getELContext());
552            return Measure.valueOf(object);
553          } catch (ELException e) {
554                      throw new FacesException(e);
555              }
556        }
557        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getWidth(getFacesContext(), this);
558      }
559    
560      public void setWidth(org.apache.myfaces.tobago.layout.Measure width) {
561        this.width = width;
562      }
563    
564      /**
565      This value will usually be set by the layout manager. It holds the current height computed by the layout manager.
566    
567      */
568      public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() {
569        if (currentHeight != null) {
570          return currentHeight;
571        }
572        ValueExpression ve = getValueExpression("currentHeight");
573        if (ve != null) {
574          try {
575            Object object = ve.getValue(getFacesContext().getELContext());
576            return Measure.valueOf(object);
577          } catch (ELException e) {
578                      throw new FacesException(e);
579              }
580        }
581        return getHeight();
582      }
583    
584      public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) {
585        this.currentHeight = currentHeight;
586      }
587    
588      public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() {
589        if (preferredHeight != null) {
590          return preferredHeight;
591        }
592        ValueExpression ve = getValueExpression("preferredHeight");
593        if (ve != null) {
594          try {
595            Object object = ve.getValue(getFacesContext().getELContext());
596            return Measure.valueOf(object);
597          } catch (ELException e) {
598                      throw new FacesException(e);
599              }
600        }
601        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this);
602      }
603    
604      public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) {
605        this.preferredHeight = preferredHeight;
606      }
607    
608      /**
609      Position of the button label, possible values are: right, bottom, off.
610       If toolbar is facet of box: bottom is changed to right!
611      <br />Default: <code>bottom</code><br />Allowed Values: <code>bottom,right,off</code>
612      */
613      public java.lang.String getLabelPosition() {
614        if (labelPosition != null) {
615          return labelPosition;
616        }
617        ValueExpression ve = getValueExpression("labelPosition");
618        if (ve != null) {
619          try {
620            java.lang.String labelPosition = (java.lang.String) ve.getValue(getFacesContext().getELContext());
621            if (labelPosition != null) {
622              return labelPosition;
623            }
624          } catch (ELException e) {
625                      throw new FacesException(e);
626              }
627        }
628        return "bottom";
629      }
630    
631      public void setLabelPosition(java.lang.String labelPosition) {
632        this.labelPosition = labelPosition;
633      }
634    
635      /**
636      This attribute is for internal use only.
637    
638      */
639      public org.apache.myfaces.tobago.layout.Display getDisplay() {
640        if (display != null) {
641          return display;
642        }
643        ValueExpression ve = getValueExpression("display");
644        if (ve != null) {
645          try {
646            return (org.apache.myfaces.tobago.layout.Display) ve.getValue(getFacesContext().getELContext());
647          } catch (ELException e) {
648                      throw new FacesException(e);
649              }
650        }
651        return null;
652      }
653    
654      public void setDisplay(org.apache.myfaces.tobago.layout.Display display) {
655        this.display = display;
656      }
657    
658      /**
659      This attribute is for internal use only.
660    
661      */
662      public org.apache.myfaces.tobago.layout.Measure getBorderBottom() {
663        if (borderBottom != null) {
664          return borderBottom;
665        }
666        ValueExpression ve = getValueExpression("borderBottom");
667        if (ve != null) {
668          try {
669            Object object = ve.getValue(getFacesContext().getELContext());
670            return Measure.valueOf(object);
671          } catch (ELException e) {
672                      throw new FacesException(e);
673              }
674        }
675        return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
676      getRenderer(getFacesContext())).getBorderBottom(getFacesContext(), this);
677      }
678    
679      public void setBorderBottom(org.apache.myfaces.tobago.layout.Measure borderBottom) {
680        this.borderBottom = borderBottom;
681      }
682    
683      public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() {
684        if (maximumWidth != null) {
685          return maximumWidth;
686        }
687        ValueExpression ve = getValueExpression("maximumWidth");
688        if (ve != null) {
689          try {
690            Object object = ve.getValue(getFacesContext().getELContext());
691            return Measure.valueOf(object);
692          } catch (ELException e) {
693                      throw new FacesException(e);
694              }
695        }
696        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this);
697      }
698    
699      public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) {
700        this.maximumWidth = maximumWidth;
701      }
702    
703      /**
704      This attribute is for internal use only.
705    
706      */
707      public org.apache.myfaces.tobago.layout.Measure getPaddingLeft() {
708        if (paddingLeft != null) {
709          return paddingLeft;
710        }
711        ValueExpression ve = getValueExpression("paddingLeft");
712        if (ve != null) {
713          try {
714            Object object = ve.getValue(getFacesContext().getELContext());
715            return Measure.valueOf(object);
716          } catch (ELException e) {
717                      throw new FacesException(e);
718              }
719        }
720        return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
721      getRenderer(getFacesContext())).getPaddingLeft(getFacesContext(), this);
722      }
723    
724      public void setPaddingLeft(org.apache.myfaces.tobago.layout.Measure paddingLeft) {
725        this.paddingLeft = paddingLeft;
726      }
727    
728      /**
729      This attribute is for internal use only.
730    
731      */
732      public org.apache.myfaces.tobago.layout.Measure getPaddingRight() {
733        if (paddingRight != null) {
734          return paddingRight;
735        }
736        ValueExpression ve = getValueExpression("paddingRight");
737        if (ve != null) {
738          try {
739            Object object = ve.getValue(getFacesContext().getELContext());
740            return Measure.valueOf(object);
741          } catch (ELException e) {
742                      throw new FacesException(e);
743              }
744        }
745        return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
746      getRenderer(getFacesContext())).getPaddingRight(getFacesContext(), this);
747      }
748    
749      public void setPaddingRight(org.apache.myfaces.tobago.layout.Measure paddingRight) {
750        this.paddingRight = paddingRight;
751      }
752    
753      public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() {
754        if (preferredWidth != null) {
755          return preferredWidth;
756        }
757        ValueExpression ve = getValueExpression("preferredWidth");
758        if (ve != null) {
759          try {
760            Object object = ve.getValue(getFacesContext().getELContext());
761            return Measure.valueOf(object);
762          } catch (ELException e) {
763                      throw new FacesException(e);
764              }
765        }
766        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this);
767      }
768    
769      public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) {
770        this.preferredWidth = preferredWidth;
771      }
772    
773      public org.apache.myfaces.tobago.layout.Measure getMarginBottom() {
774        if (marginBottom != null) {
775          return marginBottom;
776        }
777        ValueExpression ve = getValueExpression("marginBottom");
778        if (ve != null) {
779          try {
780            Object object = ve.getValue(getFacesContext().getELContext());
781            return Measure.valueOf(object);
782          } catch (ELException e) {
783                      throw new FacesException(e);
784              }
785        }
786        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this);
787      }
788    
789      public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) {
790        this.marginBottom = marginBottom;
791      }
792    
793      /**
794      Size of button images, possible values are: small, big, off.
795      <br />Default: <code>small</code><br />Allowed Values: <code>small,big,off</code>
796      */
797      public java.lang.String getIconSize() {
798        if (iconSize != null) {
799          return iconSize;
800        }
801        ValueExpression ve = getValueExpression("iconSize");
802        if (ve != null) {
803          try {
804            java.lang.String iconSize = (java.lang.String) ve.getValue(getFacesContext().getELContext());
805            if (iconSize != null) {
806              return iconSize;
807            }
808          } catch (ELException e) {
809                      throw new FacesException(e);
810              }
811        }
812        return "small";
813      }
814    
815      public void setIconSize(java.lang.String iconSize) {
816        this.iconSize = iconSize;
817      }
818    
819      /**
820      This attribute is for internal use only.
821    
822      */
823      public java.lang.Integer getVerticalIndex() {
824        if (verticalIndex != null) {
825          return verticalIndex;
826        }
827        ValueExpression ve = getValueExpression("verticalIndex");
828        if (ve != null) {
829          try {
830            Number number = (Number) ve.getValue(getFacesContext().getELContext());
831            if (number != null) {
832              return number.intValue();
833            }
834          } catch (ELException e) {
835                      throw new FacesException(e);
836              }
837        }
838        return null;
839      }
840    
841      public void setVerticalIndex(java.lang.Integer verticalIndex) {
842        this.verticalIndex = verticalIndex;
843      }
844    
845      /**
846      This attribute is for internal use only.
847    
848      */
849      public org.apache.myfaces.tobago.layout.Measure getBorderTop() {
850        if (borderTop != null) {
851          return borderTop;
852        }
853        ValueExpression ve = getValueExpression("borderTop");
854        if (ve != null) {
855          try {
856            Object object = ve.getValue(getFacesContext().getELContext());
857            return Measure.valueOf(object);
858          } catch (ELException e) {
859                      throw new FacesException(e);
860              }
861        }
862        return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
863      getRenderer(getFacesContext())).getBorderTop(getFacesContext(), this);
864      }
865    
866      public void setBorderTop(org.apache.myfaces.tobago.layout.Measure borderTop) {
867        this.borderTop = borderTop;
868      }
869    
870      public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
871        if (currentMarkup != null) {
872          return currentMarkup;
873        }
874        ValueExpression ve = getValueExpression("currentMarkup");
875        if (ve != null) {
876          try {
877            Object object = ve.getValue(getFacesContext().getELContext());
878            return Markup.valueOf(object);
879          } catch (ELException e) {
880                      throw new FacesException(e);
881              }
882        }
883        return null;
884      }
885    
886      public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
887        this.currentMarkup = currentMarkup;
888      }
889    
890      /**
891      This attribute is for internal use only.
892    
893      */
894      public java.lang.Integer getHorizontalIndex() {
895        if (horizontalIndex != null) {
896          return horizontalIndex;
897        }
898        ValueExpression ve = getValueExpression("horizontalIndex");
899        if (ve != null) {
900          try {
901            Number number = (Number) ve.getValue(getFacesContext().getELContext());
902            if (number != null) {
903              return number.intValue();
904            }
905          } catch (ELException e) {
906                      throw new FacesException(e);
907              }
908        }
909        return null;
910      }
911    
912      public void setHorizontalIndex(java.lang.Integer horizontalIndex) {
913        this.horizontalIndex = horizontalIndex;
914      }
915    
916      public void restoreState(FacesContext context, Object componentState) {
917        Object[] values = (Object[]) componentState;
918        super.restoreState(context, values[0]);
919        markup = (org.apache.myfaces.tobago.context.Markup) values[1];
920        marginLeft = (org.apache.myfaces.tobago.layout.Measure) values[2];
921        minimumHeight = (org.apache.myfaces.tobago.layout.Measure) values[3];
922        borderLeft = (org.apache.myfaces.tobago.layout.Measure) values[4];
923        tip = (java.lang.String) values[5];
924        height = (org.apache.myfaces.tobago.layout.Measure) values[6];
925        minimumWidth = (org.apache.myfaces.tobago.layout.Measure) values[7];
926        rowSpan = (java.lang.Integer) values[8];
927        left = (org.apache.myfaces.tobago.layout.Measure) values[9];
928        columnSpan = (java.lang.Integer) values[10];
929        borderRight = (org.apache.myfaces.tobago.layout.Measure) values[11];
930        paddingBottom = (org.apache.myfaces.tobago.layout.Measure) values[12];
931        maximumHeight = (org.apache.myfaces.tobago.layout.Measure) values[13];
932        top = (org.apache.myfaces.tobago.layout.Measure) values[14];
933        orientation = (java.lang.String) values[15];
934        currentWidth = (org.apache.myfaces.tobago.layout.Measure) values[16];
935        paddingTop = (org.apache.myfaces.tobago.layout.Measure) values[17];
936        marginTop = (org.apache.myfaces.tobago.layout.Measure) values[18];
937        marginRight = (org.apache.myfaces.tobago.layout.Measure) values[19];
938        width = (org.apache.myfaces.tobago.layout.Measure) values[20];
939        currentHeight = (org.apache.myfaces.tobago.layout.Measure) values[21];
940        preferredHeight = (org.apache.myfaces.tobago.layout.Measure) values[22];
941        labelPosition = (java.lang.String) values[23];
942        display = (org.apache.myfaces.tobago.layout.Display) values[24];
943        borderBottom = (org.apache.myfaces.tobago.layout.Measure) values[25];
944        maximumWidth = (org.apache.myfaces.tobago.layout.Measure) values[26];
945        paddingLeft = (org.apache.myfaces.tobago.layout.Measure) values[27];
946        paddingRight = (org.apache.myfaces.tobago.layout.Measure) values[28];
947        preferredWidth = (org.apache.myfaces.tobago.layout.Measure) values[29];
948        marginBottom = (org.apache.myfaces.tobago.layout.Measure) values[30];
949        iconSize = (java.lang.String) values[31];
950        verticalIndex = (java.lang.Integer) values[32];
951        borderTop = (org.apache.myfaces.tobago.layout.Measure) values[33];
952        currentMarkup = (org.apache.myfaces.tobago.context.Markup) values[34];
953        horizontalIndex = (java.lang.Integer) values[35];
954      }
955    
956      public Object saveState(FacesContext context) {
957        Object[] values = new Object[36];
958        values[0] = super.saveState(context);
959        values[1] = markup;
960        values[2] = marginLeft;
961        values[3] = minimumHeight;
962        values[4] = borderLeft;
963        values[5] = tip;
964        values[6] = height;
965        values[7] = minimumWidth;
966        values[8] = rowSpan;
967        values[9] = left;
968        values[10] = columnSpan;
969        values[11] = borderRight;
970        values[12] = paddingBottom;
971        values[13] = maximumHeight;
972        values[14] = top;
973        values[15] = orientation;
974        values[16] = currentWidth;
975        values[17] = paddingTop;
976        values[18] = marginTop;
977        values[19] = marginRight;
978        values[20] = width;
979        values[21] = currentHeight;
980        values[22] = preferredHeight;
981        values[23] = labelPosition;
982        values[24] = display;
983        values[25] = borderBottom;
984        values[26] = maximumWidth;
985        values[27] = paddingLeft;
986        values[28] = paddingRight;
987        values[29] = preferredWidth;
988        values[30] = marginBottom;
989        values[31] = iconSize;
990        values[32] = verticalIndex;
991        values[33] = borderTop;
992        values[34] = currentMarkup;
993        values[35] = horizontalIndex;
994        return values;
995      }
996    
997    
998    }