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.AbstractUIImage;
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 an image.
044      * UIComponent class, generated from template {@code component1.2.stg} with class
045      * {@link org.apache.myfaces.tobago.internal.taglib.component.ImageTagDeclaration}.
046     */
047    public class UIImage
048        extends AbstractUIImage implements SupportsMarkup {
049    
050      public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Image";
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.String alt;
060      private java.lang.Integer rowSpan;
061      private org.apache.myfaces.tobago.layout.Measure left;
062      private java.lang.Integer columnSpan;
063      private org.apache.myfaces.tobago.layout.Measure borderRight;
064      private java.lang.String border;
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 width;
072      private org.apache.myfaces.tobago.layout.Measure marginRight;
073      private org.apache.myfaces.tobago.layout.Measure currentHeight;
074      private org.apache.myfaces.tobago.layout.Measure preferredHeight;
075      private org.apache.myfaces.tobago.layout.Measure borderBottom;
076      private org.apache.myfaces.tobago.layout.Display display;
077      private org.apache.myfaces.tobago.layout.Measure maximumWidth;
078      private org.apache.myfaces.tobago.layout.Measure paddingLeft;
079      private org.apache.myfaces.tobago.layout.Measure paddingRight;
080      private org.apache.myfaces.tobago.layout.Measure preferredWidth;
081      private org.apache.myfaces.tobago.layout.Measure marginBottom;
082      private org.apache.myfaces.tobago.layout.Measure borderTop;
083      private java.lang.Integer verticalIndex;
084      private org.apache.myfaces.tobago.context.Markup currentMarkup;
085      private java.lang.Integer horizontalIndex;
086      private java.lang.Boolean disabled;
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      @deprecated*/
201      @Deprecated
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      @Deprecated
219      public void setHeight(org.apache.myfaces.tobago.layout.Measure height) {
220        this.height = height;
221      }
222    
223      public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() {
224        if (minimumWidth != null) {
225          return minimumWidth;
226        }
227        ValueExpression ve = getValueExpression("minimumWidth");
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())).getMinimumWidth(getFacesContext(), this);
237      }
238    
239      public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) {
240        this.minimumWidth = minimumWidth;
241      }
242    
243      /**
244      Alternate textual description of the image rendered by this component.
245    
246      */
247      public java.lang.String getAlt() {
248        if (alt != null) {
249          return alt;
250        }
251        ValueExpression ve = getValueExpression("alt");
252        if (ve != null) {
253          try {
254            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
255          } catch (ELException e) {
256                      throw new FacesException(e);
257              }
258        }
259        return null;
260      }
261    
262      public void setAlt(java.lang.String alt) {
263        this.alt = alt;
264      }
265    
266      public java.lang.Integer getRowSpan() {
267        if (rowSpan != null) {
268          return rowSpan;
269        }
270        ValueExpression ve = getValueExpression("rowSpan");
271        if (ve != null) {
272          try {
273            Number number = (Number) ve.getValue(getFacesContext().getELContext());
274            if (number != null) {
275              return number.intValue();
276            }
277          } catch (ELException e) {
278                      throw new FacesException(e);
279              }
280        }
281        return 1;
282      }
283    
284      public void setRowSpan(java.lang.Integer rowSpan) {
285        this.rowSpan = rowSpan;
286      }
287    
288      /**
289      This value will usually be set by the layout manager.
290    
291      */
292      public org.apache.myfaces.tobago.layout.Measure getLeft() {
293        if (left != null) {
294          return left;
295        }
296        ValueExpression ve = getValueExpression("left");
297        if (ve != null) {
298          try {
299            Object object = ve.getValue(getFacesContext().getELContext());
300            return Measure.valueOf(object);
301          } catch (ELException e) {
302                      throw new FacesException(e);
303              }
304        }
305        return null;
306      }
307    
308      public void setLeft(org.apache.myfaces.tobago.layout.Measure left) {
309        this.left = left;
310      }
311    
312      public java.lang.Integer getColumnSpan() {
313        if (columnSpan != null) {
314          return columnSpan;
315        }
316        ValueExpression ve = getValueExpression("columnSpan");
317        if (ve != null) {
318          try {
319            Number number = (Number) ve.getValue(getFacesContext().getELContext());
320            if (number != null) {
321              return number.intValue();
322            }
323          } catch (ELException e) {
324                      throw new FacesException(e);
325              }
326        }
327        return 1;
328      }
329    
330      public void setColumnSpan(java.lang.Integer columnSpan) {
331        this.columnSpan = columnSpan;
332      }
333    
334      /**
335      This attribute is for internal use only.
336    
337      */
338      public org.apache.myfaces.tobago.layout.Measure getBorderRight() {
339        if (borderRight != null) {
340          return borderRight;
341        }
342        ValueExpression ve = getValueExpression("borderRight");
343        if (ve != null) {
344          try {
345            Object object = ve.getValue(getFacesContext().getELContext());
346            return Measure.valueOf(object);
347          } catch (ELException e) {
348                      throw new FacesException(e);
349              }
350        }
351        return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
352      getRenderer(getFacesContext())).getBorderRight(getFacesContext(), this);
353      }
354    
355      public void setBorderRight(org.apache.myfaces.tobago.layout.Measure borderRight) {
356        this.borderRight = borderRight;
357      }
358    
359      /**
360      Border size of this component.
361    
362      */
363      public java.lang.String getBorder() {
364        if (border != null) {
365          return border;
366        }
367        ValueExpression ve = getValueExpression("border");
368        if (ve != null) {
369          try {
370            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
371          } catch (ELException e) {
372                      throw new FacesException(e);
373              }
374        }
375        return null;
376      }
377    
378      public void setBorder(java.lang.String border) {
379        this.border = border;
380      }
381    
382      /**
383      This attribute is for internal use only.
384    
385      */
386      public org.apache.myfaces.tobago.layout.Measure getPaddingBottom() {
387        if (paddingBottom != null) {
388          return paddingBottom;
389        }
390        ValueExpression ve = getValueExpression("paddingBottom");
391        if (ve != null) {
392          try {
393            Object object = ve.getValue(getFacesContext().getELContext());
394            return Measure.valueOf(object);
395          } catch (ELException e) {
396                      throw new FacesException(e);
397              }
398        }
399        return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
400      getRenderer(getFacesContext())).getPaddingBottom(getFacesContext(), this);
401      }
402    
403      public void setPaddingBottom(org.apache.myfaces.tobago.layout.Measure paddingBottom) {
404        this.paddingBottom = paddingBottom;
405      }
406    
407      public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() {
408        if (maximumHeight != null) {
409          return maximumHeight;
410        }
411        ValueExpression ve = getValueExpression("maximumHeight");
412        if (ve != null) {
413          try {
414            Object object = ve.getValue(getFacesContext().getELContext());
415            return Measure.valueOf(object);
416          } catch (ELException e) {
417                      throw new FacesException(e);
418              }
419        }
420        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this);
421      }
422    
423      public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) {
424        this.maximumHeight = maximumHeight;
425      }
426    
427      /**
428      This value will usually be set by the layout manager.
429    
430      */
431      public org.apache.myfaces.tobago.layout.Measure getTop() {
432        if (top != null) {
433          return top;
434        }
435        ValueExpression ve = getValueExpression("top");
436        if (ve != null) {
437          try {
438            Object object = ve.getValue(getFacesContext().getELContext());
439            return Measure.valueOf(object);
440          } catch (ELException e) {
441                      throw new FacesException(e);
442              }
443        }
444        return null;
445      }
446    
447      public void setTop(org.apache.myfaces.tobago.layout.Measure top) {
448        this.top = top;
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      /**
521      This value will usually be set by the layout manager.
522    
523      @deprecated*/
524      @Deprecated
525      public org.apache.myfaces.tobago.layout.Measure getWidth() {
526        if (width != null) {
527          return width;
528        }
529        ValueExpression ve = getValueExpression("width");
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())).getWidth(getFacesContext(), this);
539      }
540    
541      @Deprecated
542      public void setWidth(org.apache.myfaces.tobago.layout.Measure width) {
543        this.width = width;
544      }
545    
546      public org.apache.myfaces.tobago.layout.Measure getMarginRight() {
547        if (marginRight != null) {
548          return marginRight;
549        }
550        ValueExpression ve = getValueExpression("marginRight");
551        if (ve != null) {
552          try {
553            Object object = ve.getValue(getFacesContext().getELContext());
554            return Measure.valueOf(object);
555          } catch (ELException e) {
556                      throw new FacesException(e);
557              }
558        }
559        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this);
560      }
561    
562      public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) {
563        this.marginRight = marginRight;
564      }
565    
566      /**
567      This value will usually be set by the layout manager. It holds the current height computed by the layout manager.
568    
569      */
570      public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() {
571        if (currentHeight != null) {
572          return currentHeight;
573        }
574        ValueExpression ve = getValueExpression("currentHeight");
575        if (ve != null) {
576          try {
577            Object object = ve.getValue(getFacesContext().getELContext());
578            return Measure.valueOf(object);
579          } catch (ELException e) {
580                      throw new FacesException(e);
581              }
582        }
583        return getHeight();
584      }
585    
586      public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) {
587        this.currentHeight = currentHeight;
588      }
589    
590      public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() {
591        if (preferredHeight != null) {
592          return preferredHeight;
593        }
594        ValueExpression ve = getValueExpression("preferredHeight");
595        if (ve != null) {
596          try {
597            Object object = ve.getValue(getFacesContext().getELContext());
598            return Measure.valueOf(object);
599          } catch (ELException e) {
600                      throw new FacesException(e);
601              }
602        }
603        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this);
604      }
605    
606      public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) {
607        this.preferredHeight = preferredHeight;
608      }
609    
610      /**
611      This attribute is for internal use only.
612    
613      */
614      public org.apache.myfaces.tobago.layout.Measure getBorderBottom() {
615        if (borderBottom != null) {
616          return borderBottom;
617        }
618        ValueExpression ve = getValueExpression("borderBottom");
619        if (ve != null) {
620          try {
621            Object object = ve.getValue(getFacesContext().getELContext());
622            return Measure.valueOf(object);
623          } catch (ELException e) {
624                      throw new FacesException(e);
625              }
626        }
627        return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
628      getRenderer(getFacesContext())).getBorderBottom(getFacesContext(), this);
629      }
630    
631      public void setBorderBottom(org.apache.myfaces.tobago.layout.Measure borderBottom) {
632        this.borderBottom = borderBottom;
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      public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() {
659        if (maximumWidth != null) {
660          return maximumWidth;
661        }
662        ValueExpression ve = getValueExpression("maximumWidth");
663        if (ve != null) {
664          try {
665            Object object = ve.getValue(getFacesContext().getELContext());
666            return Measure.valueOf(object);
667          } catch (ELException e) {
668                      throw new FacesException(e);
669              }
670        }
671        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this);
672      }
673    
674      public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) {
675        this.maximumWidth = maximumWidth;
676      }
677    
678      /**
679      This attribute is for internal use only.
680    
681      */
682      public org.apache.myfaces.tobago.layout.Measure getPaddingLeft() {
683        if (paddingLeft != null) {
684          return paddingLeft;
685        }
686        ValueExpression ve = getValueExpression("paddingLeft");
687        if (ve != null) {
688          try {
689            Object object = ve.getValue(getFacesContext().getELContext());
690            return Measure.valueOf(object);
691          } catch (ELException e) {
692                      throw new FacesException(e);
693              }
694        }
695        return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
696      getRenderer(getFacesContext())).getPaddingLeft(getFacesContext(), this);
697      }
698    
699      public void setPaddingLeft(org.apache.myfaces.tobago.layout.Measure paddingLeft) {
700        this.paddingLeft = paddingLeft;
701      }
702    
703      /**
704      This attribute is for internal use only.
705    
706      */
707      public org.apache.myfaces.tobago.layout.Measure getPaddingRight() {
708        if (paddingRight != null) {
709          return paddingRight;
710        }
711        ValueExpression ve = getValueExpression("paddingRight");
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())).getPaddingRight(getFacesContext(), this);
722      }
723    
724      public void setPaddingRight(org.apache.myfaces.tobago.layout.Measure paddingRight) {
725        this.paddingRight = paddingRight;
726      }
727    
728      public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() {
729        if (preferredWidth != null) {
730          return preferredWidth;
731        }
732        ValueExpression ve = getValueExpression("preferredWidth");
733        if (ve != null) {
734          try {
735            Object object = ve.getValue(getFacesContext().getELContext());
736            return Measure.valueOf(object);
737          } catch (ELException e) {
738                      throw new FacesException(e);
739              }
740        }
741        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this);
742      }
743    
744      public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) {
745        this.preferredWidth = preferredWidth;
746      }
747    
748      public org.apache.myfaces.tobago.layout.Measure getMarginBottom() {
749        if (marginBottom != null) {
750          return marginBottom;
751        }
752        ValueExpression ve = getValueExpression("marginBottom");
753        if (ve != null) {
754          try {
755            Object object = ve.getValue(getFacesContext().getELContext());
756            return Measure.valueOf(object);
757          } catch (ELException e) {
758                      throw new FacesException(e);
759              }
760        }
761        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this);
762      }
763    
764      public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) {
765        this.marginBottom = marginBottom;
766      }
767    
768      /**
769      This attribute is for internal use only.
770    
771      */
772      public org.apache.myfaces.tobago.layout.Measure getBorderTop() {
773        if (borderTop != null) {
774          return borderTop;
775        }
776        ValueExpression ve = getValueExpression("borderTop");
777        if (ve != null) {
778          try {
779            Object object = ve.getValue(getFacesContext().getELContext());
780            return Measure.valueOf(object);
781          } catch (ELException e) {
782                      throw new FacesException(e);
783              }
784        }
785        return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
786      getRenderer(getFacesContext())).getBorderTop(getFacesContext(), this);
787      }
788    
789      public void setBorderTop(org.apache.myfaces.tobago.layout.Measure borderTop) {
790        this.borderTop = borderTop;
791      }
792    
793      /**
794      This attribute is for internal use only.
795    
796      */
797      public java.lang.Integer getVerticalIndex() {
798        if (verticalIndex != null) {
799          return verticalIndex;
800        }
801        ValueExpression ve = getValueExpression("verticalIndex");
802        if (ve != null) {
803          try {
804            Number number = (Number) ve.getValue(getFacesContext().getELContext());
805            if (number != null) {
806              return number.intValue();
807            }
808          } catch (ELException e) {
809                      throw new FacesException(e);
810              }
811        }
812        return null;
813      }
814    
815      public void setVerticalIndex(java.lang.Integer verticalIndex) {
816        this.verticalIndex = verticalIndex;
817      }
818    
819      public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
820        if (currentMarkup != null) {
821          return currentMarkup;
822        }
823        ValueExpression ve = getValueExpression("currentMarkup");
824        if (ve != null) {
825          try {
826            Object object = ve.getValue(getFacesContext().getELContext());
827            return Markup.valueOf(object);
828          } catch (ELException e) {
829                      throw new FacesException(e);
830              }
831        }
832        return null;
833      }
834    
835      public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
836        this.currentMarkup = currentMarkup;
837      }
838    
839      /**
840      This attribute is for internal use only.
841    
842      */
843      public java.lang.Integer getHorizontalIndex() {
844        if (horizontalIndex != null) {
845          return horizontalIndex;
846        }
847        ValueExpression ve = getValueExpression("horizontalIndex");
848        if (ve != null) {
849          try {
850            Number number = (Number) ve.getValue(getFacesContext().getELContext());
851            if (number != null) {
852              return number.intValue();
853            }
854          } catch (ELException e) {
855                      throw new FacesException(e);
856              }
857        }
858        return null;
859      }
860    
861      public void setHorizontalIndex(java.lang.Integer horizontalIndex) {
862        this.horizontalIndex = horizontalIndex;
863      }
864    
865      /**
866      Flag indicating that this element is disabled.
867      <br />Default: <code>false</code>
868      */
869      public boolean isDisabled() {
870        if (disabled != null) {
871          return disabled;
872        }
873        ValueExpression ve = getValueExpression("disabled");
874        if (ve != null) {
875          try {
876            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
877            if (bool != null) {
878              return bool;
879            }
880          } catch (ELException e) {
881                      throw new FacesException(e);
882              }
883        }
884        return false;
885      }
886    
887      public void setDisabled(boolean disabled) {
888        this.disabled = disabled;
889      }
890    
891      public void restoreState(FacesContext context, Object componentState) {
892        Object[] values = (Object[]) componentState;
893        super.restoreState(context, values[0]);
894        markup = (org.apache.myfaces.tobago.context.Markup) values[1];
895        marginLeft = (org.apache.myfaces.tobago.layout.Measure) values[2];
896        minimumHeight = (org.apache.myfaces.tobago.layout.Measure) values[3];
897        borderLeft = (org.apache.myfaces.tobago.layout.Measure) values[4];
898        tip = (java.lang.String) values[5];
899        height = (org.apache.myfaces.tobago.layout.Measure) values[6];
900        minimumWidth = (org.apache.myfaces.tobago.layout.Measure) values[7];
901        alt = (java.lang.String) values[8];
902        rowSpan = (java.lang.Integer) values[9];
903        left = (org.apache.myfaces.tobago.layout.Measure) values[10];
904        columnSpan = (java.lang.Integer) values[11];
905        borderRight = (org.apache.myfaces.tobago.layout.Measure) values[12];
906        border = (java.lang.String) values[13];
907        paddingBottom = (org.apache.myfaces.tobago.layout.Measure) values[14];
908        maximumHeight = (org.apache.myfaces.tobago.layout.Measure) values[15];
909        top = (org.apache.myfaces.tobago.layout.Measure) values[16];
910        currentWidth = (org.apache.myfaces.tobago.layout.Measure) values[17];
911        paddingTop = (org.apache.myfaces.tobago.layout.Measure) values[18];
912        marginTop = (org.apache.myfaces.tobago.layout.Measure) values[19];
913        width = (org.apache.myfaces.tobago.layout.Measure) values[20];
914        marginRight = (org.apache.myfaces.tobago.layout.Measure) values[21];
915        currentHeight = (org.apache.myfaces.tobago.layout.Measure) values[22];
916        preferredHeight = (org.apache.myfaces.tobago.layout.Measure) values[23];
917        borderBottom = (org.apache.myfaces.tobago.layout.Measure) values[24];
918        display = (org.apache.myfaces.tobago.layout.Display) values[25];
919        maximumWidth = (org.apache.myfaces.tobago.layout.Measure) values[26];
920        paddingLeft = (org.apache.myfaces.tobago.layout.Measure) values[27];
921        paddingRight = (org.apache.myfaces.tobago.layout.Measure) values[28];
922        preferredWidth = (org.apache.myfaces.tobago.layout.Measure) values[29];
923        marginBottom = (org.apache.myfaces.tobago.layout.Measure) values[30];
924        borderTop = (org.apache.myfaces.tobago.layout.Measure) values[31];
925        verticalIndex = (java.lang.Integer) values[32];
926        currentMarkup = (org.apache.myfaces.tobago.context.Markup) values[33];
927        horizontalIndex = (java.lang.Integer) values[34];
928        disabled = (java.lang.Boolean) values[35];
929      }
930    
931      public Object saveState(FacesContext context) {
932        Object[] values = new Object[36];
933        values[0] = super.saveState(context);
934        values[1] = markup;
935        values[2] = marginLeft;
936        values[3] = minimumHeight;
937        values[4] = borderLeft;
938        values[5] = tip;
939        values[6] = height;
940        values[7] = minimumWidth;
941        values[8] = alt;
942        values[9] = rowSpan;
943        values[10] = left;
944        values[11] = columnSpan;
945        values[12] = borderRight;
946        values[13] = border;
947        values[14] = paddingBottom;
948        values[15] = maximumHeight;
949        values[16] = top;
950        values[17] = currentWidth;
951        values[18] = paddingTop;
952        values[19] = marginTop;
953        values[20] = width;
954        values[21] = marginRight;
955        values[22] = currentHeight;
956        values[23] = preferredHeight;
957        values[24] = borderBottom;
958        values[25] = display;
959        values[26] = maximumWidth;
960        values[27] = paddingLeft;
961        values[28] = paddingRight;
962        values[29] = preferredWidth;
963        values[30] = marginBottom;
964        values[31] = borderTop;
965        values[32] = verticalIndex;
966        values[33] = currentMarkup;
967        values[34] = horizontalIndex;
968        values[35] = disabled;
969        return values;
970      }
971    
972    
973    }