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