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