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