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 javax.faces.el.MethodBinding;
024    import org.apache.myfaces.tobago.context.Markup;
025    import org.apache.myfaces.tobago.internal.component.AbstractUIInput;
026    import org.apache.myfaces.tobago.layout.Display;
027    import org.apache.myfaces.tobago.layout.Measure;
028    import org.apache.commons.lang.ArrayUtils;
029    import org.apache.commons.lang.StringUtils;
030    import org.apache.myfaces.tobago.component.MethodBindingToMethodExpression;
031    import org.apache.myfaces.tobago.component.MethodExpressionToMethodBinding;
032    import org.apache.myfaces.tobago.internal.util.Deprecation;
033    import org.apache.myfaces.tobago.renderkit.MarginValues;
034    import org.apache.myfaces.tobago.renderkit.SpacingValues;
035    import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
036    import javax.el.ELException;
037    import javax.faces.FacesException;
038    import java.util.ArrayList;
039    import java.util.List;
040    import javax.el.MethodExpression;
041    import javax.el.ValueExpression;
042    
043    /** 
044     Renders a text input field.
045      * UIComponent class, generated from template {@code component1.2.stg} with class
046      * {@link org.apache.myfaces.tobago.internal.taglib.component.InTagDeclaration}.
047     */
048    public class UIIn
049        extends AbstractUIInput implements InputSuggest2, UIInput, SupportsMarkup, InputSuggest {
050    
051      public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.In";
052    
053      private org.apache.myfaces.tobago.context.Markup markup;
054      private org.apache.myfaces.tobago.layout.Measure marginLeft;
055      private java.lang.Integer tabIndex;
056      private org.apache.myfaces.tobago.layout.Measure minimumHeight;
057      private java.lang.Boolean password;
058      private java.lang.String tip;
059    
060      private javax.el.MethodExpression suggestMethodExpression;
061      private org.apache.myfaces.tobago.layout.Measure height;
062      private org.apache.myfaces.tobago.layout.Measure minimumWidth;
063      private java.lang.Boolean inline;
064      private java.lang.Integer rowSpan;
065      private java.lang.Boolean focus;
066      private org.apache.myfaces.tobago.layout.Measure left;
067      private java.lang.Integer columnSpan;
068      private java.lang.Boolean required;
069      private org.apache.myfaces.tobago.layout.Measure top;
070      private org.apache.myfaces.tobago.layout.Measure maximumHeight;
071      private org.apache.myfaces.tobago.layout.Measure currentWidth;
072      private org.apache.myfaces.tobago.layout.Measure marginTop;
073      private org.apache.myfaces.tobago.layout.Measure width;
074      private org.apache.myfaces.tobago.layout.Measure marginRight;
075      private org.apache.myfaces.tobago.layout.Measure preferredHeight;
076      private org.apache.myfaces.tobago.layout.Measure currentHeight;
077      private java.lang.String label;
078      private org.apache.myfaces.tobago.layout.Display display;
079      private org.apache.myfaces.tobago.layout.Measure maximumWidth;
080      private java.lang.String onchange;
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.context.Markup currentMarkup;
085      private java.lang.Integer horizontalIndex;
086      private java.lang.Boolean readonly;
087      private java.lang.Boolean disabled;
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      /**
131      Controls the navigation of the focus through the
132       input controls on a page with the Tab-Key.
133       The navigation starts from the element with
134       the lowest tabIndex value to the element with the highest value.
135       Elements that have identical tabIndex values should be navigated
136       in the order they appear in the character stream
137       Elements that are disabled or with a negative tabIndex
138       do not participate in the tabbing order.
139    
140      */
141      public java.lang.Integer getTabIndex() {
142        if (tabIndex != null) {
143          return tabIndex;
144        }
145        ValueExpression ve = getValueExpression("tabIndex");
146        if (ve != null) {
147          try {
148            Number number = (Number) ve.getValue(getFacesContext().getELContext());
149            if (number != null) {
150              return number.intValue();
151            }
152          } catch (ELException e) {
153                      throw new FacesException(e);
154              }
155        }
156        return null;
157      }
158    
159      public void setTabIndex(java.lang.Integer tabIndex) {
160        this.tabIndex = tabIndex;
161      }
162    
163      public org.apache.myfaces.tobago.layout.Measure getMinimumHeight() {
164        if (minimumHeight != null) {
165          return minimumHeight;
166        }
167        ValueExpression ve = getValueExpression("minimumHeight");
168        if (ve != null) {
169          try {
170            Object object = ve.getValue(getFacesContext().getELContext());
171            return Measure.valueOf(object);
172          } catch (ELException e) {
173                      throw new FacesException(e);
174              }
175        }
176        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumHeight(getFacesContext(), this);
177      }
178    
179      public void setMinimumHeight(org.apache.myfaces.tobago.layout.Measure minimumHeight) {
180        this.minimumHeight = minimumHeight;
181      }
182    
183      /**
184      Flag indicating whether or not this component should be rendered as
185       password field , so you will not see the typed charakters.
186      <br />Default: <code>false</code>
187      */
188      public boolean isPassword() {
189        if (password != null) {
190          return password;
191        }
192        ValueExpression ve = getValueExpression("password");
193        if (ve != null) {
194          try {
195            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
196            if (bool != null) {
197              return bool;
198            }
199          } catch (ELException e) {
200                      throw new FacesException(e);
201              }
202        }
203        return false;
204      }
205    
206      public void setPassword(boolean password) {
207        this.password = password;
208      }
209    
210      /**
211      Text value to display as tooltip.
212    
213      */
214      public java.lang.String getTip() {
215        if (tip != null) {
216          return tip;
217        }
218        ValueExpression ve = getValueExpression("tip");
219        if (ve != null) {
220          try {
221            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
222          } catch (ELException e) {
223                      throw new FacesException(e);
224              }
225        }
226        return null;
227      }
228    
229      public void setTip(java.lang.String tip) {
230        this.tip = tip;
231      }
232    
233      public javax.faces.el.MethodBinding getSuggestMethod() {
234        MethodExpression expression = getSuggestMethodExpression();
235        if (expression instanceof MethodBindingToMethodExpression) {
236          return ((MethodBindingToMethodExpression)expression).getMethodBinding();
237        }
238        if (expression != null) {
239           return new MethodExpressionToMethodBinding(expression);
240        }
241        return null;
242      }
243    
244      public void setSuggestMethod(javax.faces.el.MethodBinding suggestMethod) {
245        if (suggestMethod != null) {
246          setSuggestMethodExpression(new MethodBindingToMethodExpression(suggestMethod));
247        } else {
248          setSuggestMethodExpression(null);
249        }
250      }
251    
252      public javax.el.MethodExpression getSuggestMethodExpression() {
253        return suggestMethodExpression;
254      }
255    
256      public void setSuggestMethodExpression(javax.el.MethodExpression suggestMethodExpression) {
257        this.suggestMethodExpression = suggestMethodExpression;
258      }
259    
260      /**
261      This value will usually be set by the layout manager.
262    
263      */
264      public org.apache.myfaces.tobago.layout.Measure getHeight() {
265        if (height != null) {
266          return height;
267        }
268        ValueExpression ve = getValueExpression("height");
269        if (ve != null) {
270          try {
271            Object object = ve.getValue(getFacesContext().getELContext());
272            return Measure.valueOf(object);
273          } catch (ELException e) {
274                      throw new FacesException(e);
275              }
276        }
277        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getHeight(getFacesContext(), this);
278      }
279    
280      public void setHeight(org.apache.myfaces.tobago.layout.Measure height) {
281        this.height = height;
282      }
283    
284      public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() {
285        if (minimumWidth != null) {
286          return minimumWidth;
287        }
288        ValueExpression ve = getValueExpression("minimumWidth");
289        if (ve != null) {
290          try {
291            Object object = ve.getValue(getFacesContext().getELContext());
292            return Measure.valueOf(object);
293          } catch (ELException e) {
294                      throw new FacesException(e);
295              }
296        }
297        return ((LayoutComponentRenderer)getRenderer(getFacesContext())).getMinimumWidth(getFacesContext(), this);
298      }
299    
300      public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) {
301        this.minimumWidth = minimumWidth;
302      }
303    
304      /**
305      Flag indicating this component should rendered as an inline element.
306      <br />Default: <code>false</code>
307      */
308      public boolean isInline() {
309        if (inline != null) {
310          return inline;
311        }
312        ValueExpression ve = getValueExpression("inline");
313        if (ve != null) {
314          try {
315            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
316            if (bool != null) {
317              return bool;
318            }
319          } catch (ELException e) {
320                      throw new FacesException(e);
321              }
322        }
323        return false;
324      }
325    
326      public void setInline(boolean inline) {
327        this.inline = inline;
328      }
329    
330      public java.lang.Integer getRowSpan() {
331        if (rowSpan != null) {
332          return rowSpan;
333        }
334        ValueExpression ve = getValueExpression("rowSpan");
335        if (ve != null) {
336          try {
337            Number number = (Number) ve.getValue(getFacesContext().getELContext());
338            if (number != null) {
339              return number.intValue();
340            }
341          } catch (ELException e) {
342                      throw new FacesException(e);
343              }
344        }
345        return 1;
346      }
347    
348      public void setRowSpan(java.lang.Integer rowSpan) {
349        this.rowSpan = rowSpan;
350      }
351    
352      /**
353      Flag indicating this component should receive the focus.
354      <br />Default: <code>false</code>
355      */
356      public boolean isFocus() {
357        if (focus != null) {
358          return focus;
359        }
360        ValueExpression ve = getValueExpression("focus");
361        if (ve != null) {
362          try {
363            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
364            if (bool != null) {
365              return bool;
366            }
367          } catch (ELException e) {
368                      throw new FacesException(e);
369              }
370        }
371        return false;
372      }
373    
374      public void setFocus(boolean focus) {
375        this.focus = focus;
376      }
377    
378      /**
379      This value will usually be set by the layout manager.
380    
381      */
382      public org.apache.myfaces.tobago.layout.Measure getLeft() {
383        if (left != null) {
384          return left;
385        }
386        ValueExpression ve = getValueExpression("left");
387        if (ve != null) {
388          try {
389            Object object = ve.getValue(getFacesContext().getELContext());
390            return Measure.valueOf(object);
391          } catch (ELException e) {
392                      throw new FacesException(e);
393              }
394        }
395        return null;
396      }
397    
398      public void setLeft(org.apache.myfaces.tobago.layout.Measure left) {
399        this.left = left;
400      }
401    
402      public java.lang.Integer getColumnSpan() {
403        if (columnSpan != null) {
404          return columnSpan;
405        }
406        ValueExpression ve = getValueExpression("columnSpan");
407        if (ve != null) {
408          try {
409            Number number = (Number) ve.getValue(getFacesContext().getELContext());
410            if (number != null) {
411              return number.intValue();
412            }
413          } catch (ELException e) {
414                      throw new FacesException(e);
415              }
416        }
417        return 1;
418      }
419    
420      public void setColumnSpan(java.lang.Integer columnSpan) {
421        this.columnSpan = columnSpan;
422      }
423    
424      /**
425      Flag indicating that a value is required.
426       If the value is an empty string a
427       ValidationError occurs and a Error Message is rendered.
428      <br />Default: <code>false</code>
429      */
430      public boolean isRequired() {
431        if (required != null) {
432          return required;
433        }
434        ValueExpression ve = getValueExpression("required");
435        if (ve != null) {
436          try {
437            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
438            if (bool != null) {
439              return bool;
440            }
441          } catch (ELException e) {
442                      throw new FacesException(e);
443              }
444        }
445        return false;
446      }
447    
448      public void setRequired(boolean required) {
449        this.required = required;
450      }
451    
452      /**
453      This value will usually be set by the layout manager.
454    
455      */
456      public org.apache.myfaces.tobago.layout.Measure getTop() {
457        if (top != null) {
458          return top;
459        }
460        ValueExpression ve = getValueExpression("top");
461        if (ve != null) {
462          try {
463            Object object = ve.getValue(getFacesContext().getELContext());
464            return Measure.valueOf(object);
465          } catch (ELException e) {
466                      throw new FacesException(e);
467              }
468        }
469        return null;
470      }
471    
472      public void setTop(org.apache.myfaces.tobago.layout.Measure top) {
473        this.top = top;
474      }
475    
476      public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() {
477        if (maximumHeight != null) {
478          return maximumHeight;
479        }
480        ValueExpression ve = getValueExpression("maximumHeight");
481        if (ve != null) {
482          try {
483            Object object = ve.getValue(getFacesContext().getELContext());
484            return Measure.valueOf(object);
485          } catch (ELException e) {
486                      throw new FacesException(e);
487              }
488        }
489        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this);
490      }
491    
492      public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) {
493        this.maximumHeight = maximumHeight;
494      }
495    
496      /**
497      This value will usually be set by the layout manager. It holds the current width computed by the layout manager.
498    
499      */
500      public org.apache.myfaces.tobago.layout.Measure getCurrentWidth() {
501        if (currentWidth != null) {
502          return currentWidth;
503        }
504        ValueExpression ve = getValueExpression("currentWidth");
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 getWidth();
514      }
515    
516      public void setCurrentWidth(org.apache.myfaces.tobago.layout.Measure currentWidth) {
517        this.currentWidth = currentWidth;
518      }
519    
520      public org.apache.myfaces.tobago.layout.Measure getMarginTop() {
521        if (marginTop != null) {
522          return marginTop;
523        }
524        ValueExpression ve = getValueExpression("marginTop");
525        if (ve != null) {
526          try {
527            Object object = ve.getValue(getFacesContext().getELContext());
528            return Measure.valueOf(object);
529          } catch (ELException e) {
530                      throw new FacesException(e);
531              }
532        }
533        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this);
534      }
535    
536      public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) {
537        this.marginTop = marginTop;
538      }
539    
540      /**
541      This value will usually be set by the layout manager.
542    
543      */
544      public org.apache.myfaces.tobago.layout.Measure getWidth() {
545        if (width != null) {
546          return width;
547        }
548        ValueExpression ve = getValueExpression("width");
549        if (ve != null) {
550          try {
551            Object object = ve.getValue(getFacesContext().getELContext());
552            return Measure.valueOf(object);
553          } catch (ELException e) {
554                      throw new FacesException(e);
555              }
556        }
557        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getWidth(getFacesContext(), this);
558      }
559    
560      public void setWidth(org.apache.myfaces.tobago.layout.Measure width) {
561        this.width = width;
562      }
563    
564      public org.apache.myfaces.tobago.layout.Measure getMarginRight() {
565        if (marginRight != null) {
566          return marginRight;
567        }
568        ValueExpression ve = getValueExpression("marginRight");
569        if (ve != null) {
570          try {
571            Object object = ve.getValue(getFacesContext().getELContext());
572            return Measure.valueOf(object);
573          } catch (ELException e) {
574                      throw new FacesException(e);
575              }
576        }
577        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this);
578      }
579    
580      public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) {
581        this.marginRight = marginRight;
582      }
583    
584      public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() {
585        if (preferredHeight != null) {
586          return preferredHeight;
587        }
588        ValueExpression ve = getValueExpression("preferredHeight");
589        if (ve != null) {
590          try {
591            Object object = ve.getValue(getFacesContext().getELContext());
592            return Measure.valueOf(object);
593          } catch (ELException e) {
594                      throw new FacesException(e);
595              }
596        }
597        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this);
598      }
599    
600      public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) {
601        this.preferredHeight = preferredHeight;
602      }
603    
604      /**
605      This value will usually be set by the layout manager. It holds the current height computed by the layout manager.
606    
607      */
608      public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() {
609        if (currentHeight != null) {
610          return currentHeight;
611        }
612        ValueExpression ve = getValueExpression("currentHeight");
613        if (ve != null) {
614          try {
615            Object object = ve.getValue(getFacesContext().getELContext());
616            return Measure.valueOf(object);
617          } catch (ELException e) {
618                      throw new FacesException(e);
619              }
620        }
621        return getHeight();
622      }
623    
624      public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) {
625        this.currentHeight = currentHeight;
626      }
627    
628      /**
629      A localized user presentable name for this component.
630    
631      */
632      public java.lang.String getLabel() {
633        if (label != null) {
634          return label;
635        }
636        ValueExpression ve = getValueExpression("label");
637        if (ve != null) {
638          try {
639            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
640          } catch (ELException e) {
641                      throw new FacesException(e);
642              }
643        }
644        return null;
645      }
646    
647      public void setLabel(java.lang.String label) {
648        this.label = label;
649      }
650    
651      /**
652      This attribute is for internal use only.
653    
654      */
655      public org.apache.myfaces.tobago.layout.Display getDisplay() {
656        if (display != null) {
657          return display;
658        }
659        ValueExpression ve = getValueExpression("display");
660        if (ve != null) {
661          try {
662            return (org.apache.myfaces.tobago.layout.Display) ve.getValue(getFacesContext().getELContext());
663          } catch (ELException e) {
664                      throw new FacesException(e);
665              }
666        }
667        return null;
668      }
669    
670      public void setDisplay(org.apache.myfaces.tobago.layout.Display display) {
671        this.display = display;
672      }
673    
674      public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() {
675        if (maximumWidth != null) {
676          return maximumWidth;
677        }
678        ValueExpression ve = getValueExpression("maximumWidth");
679        if (ve != null) {
680          try {
681            Object object = ve.getValue(getFacesContext().getELContext());
682            return Measure.valueOf(object);
683          } catch (ELException e) {
684                      throw new FacesException(e);
685              }
686        }
687        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this);
688      }
689    
690      public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) {
691        this.maximumWidth = maximumWidth;
692      }
693    
694      /**
695      Clientside script function to add to this component's onchange handler.
696    
697      */
698      public java.lang.String getOnchange() {
699        if (onchange != null) {
700          return onchange;
701        }
702        ValueExpression ve = getValueExpression("onchange");
703        if (ve != null) {
704          try {
705            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
706          } catch (ELException e) {
707                      throw new FacesException(e);
708              }
709        }
710        return null;
711      }
712    
713      public void setOnchange(java.lang.String onchange) {
714        this.onchange = onchange;
715      }
716    
717      public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() {
718        if (preferredWidth != null) {
719          return preferredWidth;
720        }
721        ValueExpression ve = getValueExpression("preferredWidth");
722        if (ve != null) {
723          try {
724            Object object = ve.getValue(getFacesContext().getELContext());
725            return Measure.valueOf(object);
726          } catch (ELException e) {
727                      throw new FacesException(e);
728              }
729        }
730        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this);
731      }
732    
733      public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) {
734        this.preferredWidth = preferredWidth;
735      }
736    
737      public org.apache.myfaces.tobago.layout.Measure getMarginBottom() {
738        if (marginBottom != null) {
739          return marginBottom;
740        }
741        ValueExpression ve = getValueExpression("marginBottom");
742        if (ve != null) {
743          try {
744            Object object = ve.getValue(getFacesContext().getELContext());
745            return Measure.valueOf(object);
746          } catch (ELException e) {
747                      throw new FacesException(e);
748              }
749        }
750        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this);
751      }
752    
753      public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) {
754        this.marginBottom = marginBottom;
755      }
756    
757      /**
758      This attribute is for internal use only.
759    
760      */
761      public java.lang.Integer getVerticalIndex() {
762        if (verticalIndex != null) {
763          return verticalIndex;
764        }
765        ValueExpression ve = getValueExpression("verticalIndex");
766        if (ve != null) {
767          try {
768            Number number = (Number) ve.getValue(getFacesContext().getELContext());
769            if (number != null) {
770              return number.intValue();
771            }
772          } catch (ELException e) {
773                      throw new FacesException(e);
774              }
775        }
776        return null;
777      }
778    
779      public void setVerticalIndex(java.lang.Integer verticalIndex) {
780        this.verticalIndex = verticalIndex;
781      }
782    
783      public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
784        if (currentMarkup != null) {
785          return currentMarkup;
786        }
787        return null;
788      }
789    
790      public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
791        this.currentMarkup = currentMarkup;
792      }
793    
794      /**
795      This attribute is for internal use only.
796    
797      */
798      public java.lang.Integer getHorizontalIndex() {
799        if (horizontalIndex != null) {
800          return horizontalIndex;
801        }
802        ValueExpression ve = getValueExpression("horizontalIndex");
803        if (ve != null) {
804          try {
805            Number number = (Number) ve.getValue(getFacesContext().getELContext());
806            if (number != null) {
807              return number.intValue();
808            }
809          } catch (ELException e) {
810                      throw new FacesException(e);
811              }
812        }
813        return null;
814      }
815    
816      public void setHorizontalIndex(java.lang.Integer horizontalIndex) {
817        this.horizontalIndex = horizontalIndex;
818      }
819    
820      /**
821      Flag indicating that this component will prohibit changes by the user.
822      <br />Default: <code>false</code>
823      */
824      public boolean isReadonly() {
825        if (readonly != null) {
826          return readonly;
827        }
828        ValueExpression ve = getValueExpression("readonly");
829        if (ve != null) {
830          try {
831            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
832            if (bool != null) {
833              return bool;
834            }
835          } catch (ELException e) {
836                      throw new FacesException(e);
837              }
838        }
839        return false;
840      }
841    
842      public void setReadonly(boolean readonly) {
843        this.readonly = readonly;
844      }
845    
846      /**
847      Flag indicating that this element is disabled.
848      <br />Default: <code>false</code>
849      */
850      public boolean isDisabled() {
851        if (disabled != null) {
852          return disabled;
853        }
854        ValueExpression ve = getValueExpression("disabled");
855        if (ve != null) {
856          try {
857            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
858            if (bool != null) {
859              return bool;
860            }
861          } catch (ELException e) {
862                      throw new FacesException(e);
863              }
864        }
865        return false;
866      }
867    
868      public void setDisabled(boolean disabled) {
869        this.disabled = disabled;
870      }
871    
872      public void restoreState(FacesContext context, Object componentState) {
873        Object[] values = (Object[]) componentState;
874        super.restoreState(context, values[0]);
875        markup = (org.apache.myfaces.tobago.context.Markup) values[1];
876        marginLeft = (org.apache.myfaces.tobago.layout.Measure) values[2];
877        tabIndex = (java.lang.Integer) values[3];
878        minimumHeight = (org.apache.myfaces.tobago.layout.Measure) values[4];
879        password = (java.lang.Boolean) values[5];
880        tip = (java.lang.String) values[6];
881    
882        suggestMethodExpression = (javax.el.MethodExpression) restoreAttachedState(context, values[7]);
883        height = (org.apache.myfaces.tobago.layout.Measure) values[8];
884        minimumWidth = (org.apache.myfaces.tobago.layout.Measure) values[9];
885        inline = (java.lang.Boolean) values[10];
886        rowSpan = (java.lang.Integer) values[11];
887        focus = (java.lang.Boolean) values[12];
888        left = (org.apache.myfaces.tobago.layout.Measure) values[13];
889        columnSpan = (java.lang.Integer) values[14];
890        required = (java.lang.Boolean) values[15];
891        top = (org.apache.myfaces.tobago.layout.Measure) values[16];
892        maximumHeight = (org.apache.myfaces.tobago.layout.Measure) values[17];
893        currentWidth = (org.apache.myfaces.tobago.layout.Measure) values[18];
894        marginTop = (org.apache.myfaces.tobago.layout.Measure) values[19];
895        width = (org.apache.myfaces.tobago.layout.Measure) values[20];
896        marginRight = (org.apache.myfaces.tobago.layout.Measure) values[21];
897        preferredHeight = (org.apache.myfaces.tobago.layout.Measure) values[22];
898        currentHeight = (org.apache.myfaces.tobago.layout.Measure) values[23];
899        label = (java.lang.String) values[24];
900        display = (org.apache.myfaces.tobago.layout.Display) values[25];
901        maximumWidth = (org.apache.myfaces.tobago.layout.Measure) values[26];
902        onchange = (java.lang.String) values[27];
903        preferredWidth = (org.apache.myfaces.tobago.layout.Measure) values[28];
904        marginBottom = (org.apache.myfaces.tobago.layout.Measure) values[29];
905        verticalIndex = (java.lang.Integer) values[30];
906        horizontalIndex = (java.lang.Integer) values[31];
907        readonly = (java.lang.Boolean) values[32];
908        disabled = (java.lang.Boolean) values[33];
909      }
910    
911      public Object saveState(FacesContext context) {
912        Object[] values = new Object[34];
913        values[0] = super.saveState(context);
914        values[1] = markup;
915        values[2] = marginLeft;
916        values[3] = tabIndex;
917        values[4] = minimumHeight;
918        values[5] = password;
919        values[6] = tip;
920    
921        values[7] = saveAttachedState(context, suggestMethodExpression);
922        values[8] = height;
923        values[9] = minimumWidth;
924        values[10] = inline;
925        values[11] = rowSpan;
926        values[12] = focus;
927        values[13] = left;
928        values[14] = columnSpan;
929        values[15] = required;
930        values[16] = top;
931        values[17] = maximumHeight;
932        values[18] = currentWidth;
933        values[19] = marginTop;
934        values[20] = width;
935        values[21] = marginRight;
936        values[22] = preferredHeight;
937        values[23] = currentHeight;
938        values[24] = label;
939        values[25] = display;
940        values[26] = maximumWidth;
941        values[27] = onchange;
942        values[28] = preferredWidth;
943        values[29] = marginBottom;
944        values[30] = verticalIndex;
945        values[31] = horizontalIndex;
946        values[32] = readonly;
947        values[33] = disabled;
948        currentMarkup = null;
949        return values;
950      }
951    
952    
953    }