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