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.AbstractUICommand;
025    import org.apache.myfaces.tobago.layout.Display;
026    import org.apache.myfaces.tobago.layout.Measure;
027    import org.apache.commons.lang.ArrayUtils;
028    import org.apache.commons.lang.StringUtils;
029    import org.apache.myfaces.tobago.component.MethodBindingToMethodExpression;
030    import org.apache.myfaces.tobago.component.MethodExpressionToMethodBinding;
031    import org.apache.myfaces.tobago.internal.util.Deprecation;
032    import org.apache.myfaces.tobago.renderkit.MarginValues;
033    import org.apache.myfaces.tobago.renderkit.SpacingValues;
034    import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
035    import javax.el.ELException;
036    import javax.faces.FacesException;
037    import java.util.ArrayList;
038    import java.util.List;
039    import javax.el.MethodExpression;
040    import javax.el.ValueExpression;
041    
042    /** 
043     Renders a command inside of a tree.
044      * UIComponent class, generated from template {@code component1.2.stg} with class
045      * {@link org.apache.myfaces.tobago.internal.taglib.component.TreeCommandTagDeclaration}.
046     */
047    public class UITreeCommand
048        extends AbstractUICommand implements SupportsMarkup {
049    
050      public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.TreeCommand";
051    
052      private org.apache.myfaces.tobago.context.Markup markup;
053      private org.apache.myfaces.tobago.layout.Measure marginLeft;
054      private java.lang.String link;
055      private java.lang.Integer tabIndex;
056      private org.apache.myfaces.tobago.layout.Measure minimumHeight;
057      private java.lang.String tip;
058      private org.apache.myfaces.tobago.layout.Measure height;
059      private org.apache.myfaces.tobago.layout.Measure minimumWidth;
060      private java.lang.Boolean inline;
061      private java.lang.Integer rowSpan;
062      private org.apache.myfaces.tobago.layout.Measure left;
063      private java.lang.Integer columnSpan;
064      private org.apache.myfaces.tobago.layout.Measure top;
065      private org.apache.myfaces.tobago.layout.Measure maximumHeight;
066      private org.apache.myfaces.tobago.layout.Measure currentWidth;
067      private org.apache.myfaces.tobago.layout.Measure marginTop;
068      private org.apache.myfaces.tobago.layout.Measure width;
069      private org.apache.myfaces.tobago.layout.Measure marginRight;
070      private org.apache.myfaces.tobago.layout.Measure preferredHeight;
071      private java.lang.String resource;
072      private java.lang.Boolean jsfResource;
073      private org.apache.myfaces.tobago.layout.Measure currentHeight;
074      private java.lang.Boolean transition;
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 org.apache.myfaces.tobago.layout.Measure preferredWidth;
079      private java.lang.Boolean immediate;
080      private org.apache.myfaces.tobago.layout.Measure marginBottom;
081      private java.lang.Integer verticalIndex;
082      private java.lang.String[] renderedPartially;
083      private java.lang.String target;
084      private org.apache.myfaces.tobago.context.Markup currentMarkup;
085      private java.lang.String onclick;
086      private java.lang.Integer horizontalIndex;
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      Link to an arbitrary URL, either an internal link or an external link.
132    
133       <dl>
134         <dt>internal absolute link</dt>
135         <dd>Starts with a slash '/' character. The context path will be added.
136             A session id will be added, if needed.</dd>
137         <dt>external link</dt>
138         <dd>Contains a colon ':' character.
139             The link will not be modified.</dd>
140         <dt>internal relative link</dt>
141         <dd>Any other strings. A session id will be added, if needed.</dd>
142       </dl>
143    
144      */
145      public java.lang.String getLink() {
146        if (link != null) {
147          return link;
148        }
149        ValueExpression ve = getValueExpression("link");
150        if (ve != null) {
151          try {
152            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
153          } catch (ELException e) {
154                      throw new FacesException(e);
155              }
156        }
157        return null;
158      }
159    
160      public void setLink(java.lang.String link) {
161        this.link = link;
162      }
163    
164      /**
165      Controls the navigation of the focus through the
166       input controls on a page with the Tab-Key.
167       The navigation starts from the element with
168       the lowest tabIndex value to the element with the highest value.
169       Elements that have identical tabIndex values should be navigated
170       in the order they appear in the character stream
171       Elements that are disabled or with a negative tabIndex
172       do not participate in the tabbing order.
173    
174      */
175      public java.lang.Integer getTabIndex() {
176        if (tabIndex != null) {
177          return tabIndex;
178        }
179        ValueExpression ve = getValueExpression("tabIndex");
180        if (ve != null) {
181          try {
182            Number number = (Number) ve.getValue(getFacesContext().getELContext());
183            if (number != null) {
184              return number.intValue();
185            }
186          } catch (ELException e) {
187                      throw new FacesException(e);
188              }
189        }
190        return null;
191      }
192    
193      public void setTabIndex(java.lang.Integer tabIndex) {
194        this.tabIndex = tabIndex;
195      }
196    
197      public org.apache.myfaces.tobago.layout.Measure getMinimumHeight() {
198        if (minimumHeight != null) {
199          return minimumHeight;
200        }
201        ValueExpression ve = getValueExpression("minimumHeight");
202        if (ve != null) {
203          try {
204            Object object = ve.getValue(getFacesContext().getELContext());
205            return Measure.valueOf(object);
206          } catch (ELException e) {
207                      throw new FacesException(e);
208              }
209        }
210        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumHeight(getFacesContext(), this);
211      }
212    
213      public void setMinimumHeight(org.apache.myfaces.tobago.layout.Measure minimumHeight) {
214        this.minimumHeight = minimumHeight;
215      }
216    
217      /**
218      Text value to display as tooltip.
219    
220      */
221      public java.lang.String getTip() {
222        if (tip != null) {
223          return tip;
224        }
225        ValueExpression ve = getValueExpression("tip");
226        if (ve != null) {
227          try {
228            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
229          } catch (ELException e) {
230                      throw new FacesException(e);
231              }
232        }
233        return null;
234      }
235    
236      public void setTip(java.lang.String tip) {
237        this.tip = tip;
238      }
239    
240      /**
241      This value will usually be set by the layout manager.
242    
243      */
244      public org.apache.myfaces.tobago.layout.Measure getHeight() {
245        if (height != null) {
246          return height;
247        }
248        ValueExpression ve = getValueExpression("height");
249        if (ve != null) {
250          try {
251            Object object = ve.getValue(getFacesContext().getELContext());
252            return Measure.valueOf(object);
253          } catch (ELException e) {
254                      throw new FacesException(e);
255              }
256        }
257        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getHeight(getFacesContext(), this);
258      }
259    
260      public void setHeight(org.apache.myfaces.tobago.layout.Measure height) {
261        this.height = height;
262      }
263    
264      public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() {
265        if (minimumWidth != null) {
266          return minimumWidth;
267        }
268        ValueExpression ve = getValueExpression("minimumWidth");
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())).getMinimumWidth(getFacesContext(), this);
278      }
279    
280      public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) {
281        this.minimumWidth = minimumWidth;
282      }
283    
284      /**
285      Flag indicating this component should rendered as an inline element.
286      <br />Default: <code>false</code>
287      */
288      public boolean isInline() {
289        if (inline != null) {
290          return inline;
291        }
292        ValueExpression ve = getValueExpression("inline");
293        if (ve != null) {
294          try {
295            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
296            if (bool != null) {
297              return bool;
298            }
299          } catch (ELException e) {
300                      throw new FacesException(e);
301              }
302        }
303        return false;
304      }
305    
306      public void setInline(boolean inline) {
307        this.inline = inline;
308      }
309    
310      public java.lang.Integer getRowSpan() {
311        if (rowSpan != null) {
312          return rowSpan;
313        }
314        ValueExpression ve = getValueExpression("rowSpan");
315        if (ve != null) {
316          try {
317            Number number = (Number) ve.getValue(getFacesContext().getELContext());
318            if (number != null) {
319              return number.intValue();
320            }
321          } catch (ELException e) {
322                      throw new FacesException(e);
323              }
324        }
325        return 1;
326      }
327    
328      public void setRowSpan(java.lang.Integer rowSpan) {
329        this.rowSpan = rowSpan;
330      }
331    
332      /**
333      This value will usually be set by the layout manager.
334    
335      */
336      public org.apache.myfaces.tobago.layout.Measure getLeft() {
337        if (left != null) {
338          return left;
339        }
340        ValueExpression ve = getValueExpression("left");
341        if (ve != null) {
342          try {
343            Object object = ve.getValue(getFacesContext().getELContext());
344            return Measure.valueOf(object);
345          } catch (ELException e) {
346                      throw new FacesException(e);
347              }
348        }
349        return null;
350      }
351    
352      public void setLeft(org.apache.myfaces.tobago.layout.Measure left) {
353        this.left = left;
354      }
355    
356      public java.lang.Integer getColumnSpan() {
357        if (columnSpan != null) {
358          return columnSpan;
359        }
360        ValueExpression ve = getValueExpression("columnSpan");
361        if (ve != null) {
362          try {
363            Number number = (Number) ve.getValue(getFacesContext().getELContext());
364            if (number != null) {
365              return number.intValue();
366            }
367          } catch (ELException e) {
368                      throw new FacesException(e);
369              }
370        }
371        return 1;
372      }
373    
374      public void setColumnSpan(java.lang.Integer columnSpan) {
375        this.columnSpan = columnSpan;
376      }
377    
378      /**
379      This value will usually be set by the layout manager.
380    
381      */
382      public org.apache.myfaces.tobago.layout.Measure getTop() {
383        if (top != null) {
384          return top;
385        }
386        ValueExpression ve = getValueExpression("top");
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 setTop(org.apache.myfaces.tobago.layout.Measure top) {
399        this.top = top;
400      }
401    
402      public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() {
403        if (maximumHeight != null) {
404          return maximumHeight;
405        }
406        ValueExpression ve = getValueExpression("maximumHeight");
407        if (ve != null) {
408          try {
409            Object object = ve.getValue(getFacesContext().getELContext());
410            return Measure.valueOf(object);
411          } catch (ELException e) {
412                      throw new FacesException(e);
413              }
414        }
415        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this);
416      }
417    
418      public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) {
419        this.maximumHeight = maximumHeight;
420      }
421    
422      /**
423      This value will usually be set by the layout manager. It holds the current width computed by the layout manager.
424    
425      */
426      public org.apache.myfaces.tobago.layout.Measure getCurrentWidth() {
427        if (currentWidth != null) {
428          return currentWidth;
429        }
430        ValueExpression ve = getValueExpression("currentWidth");
431        if (ve != null) {
432          try {
433            Object object = ve.getValue(getFacesContext().getELContext());
434            return Measure.valueOf(object);
435          } catch (ELException e) {
436                      throw new FacesException(e);
437              }
438        }
439        return getWidth();
440      }
441    
442      public void setCurrentWidth(org.apache.myfaces.tobago.layout.Measure currentWidth) {
443        this.currentWidth = currentWidth;
444      }
445    
446      public org.apache.myfaces.tobago.layout.Measure getMarginTop() {
447        if (marginTop != null) {
448          return marginTop;
449        }
450        ValueExpression ve = getValueExpression("marginTop");
451        if (ve != null) {
452          try {
453            Object object = ve.getValue(getFacesContext().getELContext());
454            return Measure.valueOf(object);
455          } catch (ELException e) {
456                      throw new FacesException(e);
457              }
458        }
459        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this);
460      }
461    
462      public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) {
463        this.marginTop = marginTop;
464      }
465    
466      /**
467      This value will usually be set by the layout manager.
468    
469      */
470      public org.apache.myfaces.tobago.layout.Measure getWidth() {
471        if (width != null) {
472          return width;
473        }
474        ValueExpression ve = getValueExpression("width");
475        if (ve != null) {
476          try {
477            Object object = ve.getValue(getFacesContext().getELContext());
478            return Measure.valueOf(object);
479          } catch (ELException e) {
480                      throw new FacesException(e);
481              }
482        }
483        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getWidth(getFacesContext(), this);
484      }
485    
486      public void setWidth(org.apache.myfaces.tobago.layout.Measure width) {
487        this.width = width;
488      }
489    
490      public org.apache.myfaces.tobago.layout.Measure getMarginRight() {
491        if (marginRight != null) {
492          return marginRight;
493        }
494        ValueExpression ve = getValueExpression("marginRight");
495        if (ve != null) {
496          try {
497            Object object = ve.getValue(getFacesContext().getELContext());
498            return Measure.valueOf(object);
499          } catch (ELException e) {
500                      throw new FacesException(e);
501              }
502        }
503        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this);
504      }
505    
506      public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) {
507        this.marginRight = marginRight;
508      }
509    
510      public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() {
511        if (preferredHeight != null) {
512          return preferredHeight;
513        }
514        ValueExpression ve = getValueExpression("preferredHeight");
515        if (ve != null) {
516          try {
517            Object object = ve.getValue(getFacesContext().getELContext());
518            return Measure.valueOf(object);
519          } catch (ELException e) {
520                      throw new FacesException(e);
521              }
522        }
523        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this);
524      }
525    
526      public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) {
527        this.preferredHeight = preferredHeight;
528      }
529    
530      /**
531      Link to an internal resource.
532       Resources will be processed by the resource management.
533       E. g. define help.html and it will be served help_es.html or help_de.html if available.
534       For JSF-Pages you have to set the jsfResource attribute.
535    
536      */
537      public java.lang.String getResource() {
538        if (resource != null) {
539          return resource;
540        }
541        ValueExpression ve = getValueExpression("resource");
542        if (ve != null) {
543          try {
544            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
545          } catch (ELException e) {
546                      throw new FacesException(e);
547              }
548        }
549        return null;
550      }
551    
552      public void setResource(java.lang.String resource) {
553        this.resource = resource;
554      }
555    
556      /**
557      Flag indicating that the resource referenced by the resource attribute is a jsf resource.
558       That means that the url has to be processed to change the prefix or suffix (e. g. *.jsf or
559       /faces/*). Default is false.
560      <br />Default: <code>false</code>
561      */
562      public boolean isJsfResource() {
563        if (jsfResource != null) {
564          return jsfResource;
565        }
566        ValueExpression ve = getValueExpression("jsfResource");
567        if (ve != null) {
568          try {
569            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
570            if (bool != null) {
571              return bool;
572            }
573          } catch (ELException e) {
574                      throw new FacesException(e);
575              }
576        }
577        return false;
578      }
579    
580      public void setJsfResource(boolean jsfResource) {
581        this.jsfResource = jsfResource;
582      }
583    
584      /**
585      This value will usually be set by the layout manager. It holds the current height computed by the layout manager.
586    
587      */
588      public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() {
589        if (currentHeight != null) {
590          return currentHeight;
591        }
592        ValueExpression ve = getValueExpression("currentHeight");
593        if (ve != null) {
594          try {
595            Object object = ve.getValue(getFacesContext().getELContext());
596            return Measure.valueOf(object);
597          } catch (ELException e) {
598                      throw new FacesException(e);
599              }
600        }
601        return getHeight();
602      }
603    
604      public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) {
605        this.currentHeight = currentHeight;
606      }
607    
608      /**
609      Specify, if the command calls an JSF-Action.
610       Useful to switch off the Double-Submit-Check and Waiting-Behavior.
611      <br />Default: <code>true</code>
612      */
613      public boolean isTransition() {
614        if (transition != null) {
615          return transition;
616        }
617        ValueExpression ve = getValueExpression("transition");
618        if (ve != null) {
619          try {
620            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
621            if (bool != null) {
622              return bool;
623            }
624          } catch (ELException e) {
625                      throw new FacesException(e);
626              }
627        }
628        return true;
629      }
630    
631      public void setTransition(boolean transition) {
632        this.transition = transition;
633      }
634    
635      /**
636      Text value to display as label.
637       If text contains an underscore the next character is used as accesskey.
638    
639      */
640      public java.lang.String getLabel() {
641        if (label != null) {
642          return label;
643        }
644        ValueExpression ve = getValueExpression("label");
645        if (ve != null) {
646          try {
647            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
648          } catch (ELException e) {
649                      throw new FacesException(e);
650              }
651        }
652        return null;
653      }
654    
655      public void setLabel(java.lang.String label) {
656        this.label = label;
657      }
658    
659      /**
660      This attribute is for internal use only.
661    
662      */
663      public org.apache.myfaces.tobago.layout.Display getDisplay() {
664        if (display != null) {
665          return display;
666        }
667        ValueExpression ve = getValueExpression("display");
668        if (ve != null) {
669          try {
670            return (org.apache.myfaces.tobago.layout.Display) ve.getValue(getFacesContext().getELContext());
671          } catch (ELException e) {
672                      throw new FacesException(e);
673              }
674        }
675        return null;
676      }
677    
678      public void setDisplay(org.apache.myfaces.tobago.layout.Display display) {
679        this.display = display;
680      }
681    
682      public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() {
683        if (maximumWidth != null) {
684          return maximumWidth;
685        }
686        ValueExpression ve = getValueExpression("maximumWidth");
687        if (ve != null) {
688          try {
689            Object object = ve.getValue(getFacesContext().getELContext());
690            return Measure.valueOf(object);
691          } catch (ELException e) {
692                      throw new FacesException(e);
693              }
694        }
695        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this);
696      }
697    
698      public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) {
699        this.maximumWidth = maximumWidth;
700      }
701    
702      public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() {
703        if (preferredWidth != null) {
704          return preferredWidth;
705        }
706        ValueExpression ve = getValueExpression("preferredWidth");
707        if (ve != null) {
708          try {
709            Object object = ve.getValue(getFacesContext().getELContext());
710            return Measure.valueOf(object);
711          } catch (ELException e) {
712                      throw new FacesException(e);
713              }
714        }
715        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this);
716      }
717    
718      public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) {
719        this.preferredWidth = preferredWidth;
720      }
721    
722      /**
723      Flag indicating that, if this component is activated by the user,
724       notifications should be delivered to interested listeners and actions
725       immediately (that is, during Apply Request Values phase) rather than
726       waiting until Invoke Application phase.
727      <br />Default: <code>false</code>
728      */
729      public boolean isImmediate() {
730        if (immediate != null) {
731          return immediate;
732        }
733        ValueExpression ve = getValueExpression("immediate");
734        if (ve != null) {
735          try {
736            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
737            if (bool != null) {
738              return bool;
739            }
740          } catch (ELException e) {
741                      throw new FacesException(e);
742              }
743        }
744        return false;
745      }
746    
747      public void setImmediate(boolean immediate) {
748        this.immediate = immediate;
749      }
750    
751      public org.apache.myfaces.tobago.layout.Measure getMarginBottom() {
752        if (marginBottom != null) {
753          return marginBottom;
754        }
755        ValueExpression ve = getValueExpression("marginBottom");
756        if (ve != null) {
757          try {
758            Object object = ve.getValue(getFacesContext().getELContext());
759            return Measure.valueOf(object);
760          } catch (ELException e) {
761                      throw new FacesException(e);
762              }
763        }
764        return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this);
765      }
766    
767      public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) {
768        this.marginBottom = marginBottom;
769      }
770    
771      /**
772      This attribute is for internal use only.
773    
774      */
775      public java.lang.Integer getVerticalIndex() {
776        if (verticalIndex != null) {
777          return verticalIndex;
778        }
779        ValueExpression ve = getValueExpression("verticalIndex");
780        if (ve != null) {
781          try {
782            Number number = (Number) ve.getValue(getFacesContext().getELContext());
783            if (number != null) {
784              return number.intValue();
785            }
786          } catch (ELException e) {
787                      throw new FacesException(e);
788              }
789        }
790        return null;
791      }
792    
793      public void setVerticalIndex(java.lang.Integer verticalIndex) {
794        this.verticalIndex = verticalIndex;
795      }
796    
797      /**
798      Indicate the partially rendered Components in a case of a submit.
799    
800      */
801      public String[] getRenderedPartially() {
802        if (renderedPartially != null) {
803          return renderedPartially;
804        }
805        ValueExpression ve = getValueExpression("renderedPartially");
806        if (ve != null) {
807          try {
808            Object strArray = ve.getValue(getFacesContext().getELContext());
809            if (strArray instanceof String[]) {
810              return (String[]) strArray;
811            } else if (strArray instanceof String) {
812              String[] strings = StringUtils.split((String) strArray, ", ");
813              List<String> result = new ArrayList<String>(strings.length);
814              for (String string : strings) {
815                if (string.trim().length() != 0) {
816                  result.add(string.trim());
817                }
818              }
819              return result.toArray(new String[result.size()]);
820            } else if (strArray == null) {
821              return ArrayUtils.EMPTY_STRING_ARRAY;
822            } else {
823              return new String[]{strArray.toString()};
824            }
825          } catch (ELException e) {
826                      throw new FacesException(e);
827              }
828        }
829        return ArrayUtils.EMPTY_STRING_ARRAY;
830      }
831    
832      public void setRenderedPartially(String[] renderedPartially) {
833        this.renderedPartially = renderedPartially;
834      }
835    
836      /**
837      Name of a frame where the resource retrieved via this hyperlink is to be
838       displayed.
839    
840      */
841      public java.lang.String getTarget() {
842        if (target != null) {
843          return target;
844        }
845        ValueExpression ve = getValueExpression("target");
846        if (ve != null) {
847          try {
848            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
849          } catch (ELException e) {
850                      throw new FacesException(e);
851              }
852        }
853        return null;
854      }
855    
856      public void setTarget(java.lang.String target) {
857        this.target = target;
858      }
859    
860      public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
861        if (currentMarkup != null) {
862          return currentMarkup;
863        }
864        ValueExpression ve = getValueExpression("currentMarkup");
865        if (ve != null) {
866          try {
867            Object object = ve.getValue(getFacesContext().getELContext());
868            return Markup.valueOf(object);
869          } catch (ELException e) {
870                      throw new FacesException(e);
871              }
872        }
873        return null;
874      }
875    
876      public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
877        this.currentMarkup = currentMarkup;
878      }
879    
880      /**
881      Script to be invoked when clicked
882    
883      */
884      public java.lang.String getOnclick() {
885        if (onclick != null) {
886          return onclick;
887        }
888        ValueExpression ve = getValueExpression("onclick");
889        if (ve != null) {
890          try {
891            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
892          } catch (ELException e) {
893                      throw new FacesException(e);
894              }
895        }
896        return null;
897      }
898    
899      public void setOnclick(java.lang.String onclick) {
900        this.onclick = onclick;
901      }
902    
903      /**
904      This attribute is for internal use only.
905    
906      */
907      public java.lang.Integer getHorizontalIndex() {
908        if (horizontalIndex != null) {
909          return horizontalIndex;
910        }
911        ValueExpression ve = getValueExpression("horizontalIndex");
912        if (ve != null) {
913          try {
914            Number number = (Number) ve.getValue(getFacesContext().getELContext());
915            if (number != null) {
916              return number.intValue();
917            }
918          } catch (ELException e) {
919                      throw new FacesException(e);
920              }
921        }
922        return null;
923      }
924    
925      public void setHorizontalIndex(java.lang.Integer horizontalIndex) {
926        this.horizontalIndex = horizontalIndex;
927      }
928    
929      /**
930      Flag indicating that this element is disabled.
931      <br />Default: <code>false</code>
932      */
933      public boolean isDisabled() {
934        if (disabled != null) {
935          return disabled;
936        }
937        ValueExpression ve = getValueExpression("disabled");
938        if (ve != null) {
939          try {
940            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
941            if (bool != null) {
942              return bool;
943            }
944          } catch (ELException e) {
945                      throw new FacesException(e);
946              }
947        }
948        return false;
949      }
950    
951      public void setDisabled(boolean disabled) {
952        this.disabled = disabled;
953      }
954    
955      public void restoreState(FacesContext context, Object componentState) {
956        Object[] values = (Object[]) componentState;
957        super.restoreState(context, values[0]);
958        markup = (org.apache.myfaces.tobago.context.Markup) values[1];
959        marginLeft = (org.apache.myfaces.tobago.layout.Measure) values[2];
960        link = (java.lang.String) values[3];
961        tabIndex = (java.lang.Integer) values[4];
962        minimumHeight = (org.apache.myfaces.tobago.layout.Measure) values[5];
963        tip = (java.lang.String) values[6];
964        height = (org.apache.myfaces.tobago.layout.Measure) values[7];
965        minimumWidth = (org.apache.myfaces.tobago.layout.Measure) values[8];
966        inline = (java.lang.Boolean) values[9];
967        rowSpan = (java.lang.Integer) values[10];
968        left = (org.apache.myfaces.tobago.layout.Measure) values[11];
969        columnSpan = (java.lang.Integer) values[12];
970        top = (org.apache.myfaces.tobago.layout.Measure) values[13];
971        maximumHeight = (org.apache.myfaces.tobago.layout.Measure) values[14];
972        currentWidth = (org.apache.myfaces.tobago.layout.Measure) values[15];
973        marginTop = (org.apache.myfaces.tobago.layout.Measure) values[16];
974        width = (org.apache.myfaces.tobago.layout.Measure) values[17];
975        marginRight = (org.apache.myfaces.tobago.layout.Measure) values[18];
976        preferredHeight = (org.apache.myfaces.tobago.layout.Measure) values[19];
977        resource = (java.lang.String) values[20];
978        jsfResource = (java.lang.Boolean) values[21];
979        currentHeight = (org.apache.myfaces.tobago.layout.Measure) values[22];
980        transition = (java.lang.Boolean) values[23];
981        label = (java.lang.String) values[24];
982        display = (org.apache.myfaces.tobago.layout.Display) values[25];
983        maximumWidth = (org.apache.myfaces.tobago.layout.Measure) values[26];
984        preferredWidth = (org.apache.myfaces.tobago.layout.Measure) values[27];
985        immediate = (java.lang.Boolean) values[28];
986        marginBottom = (org.apache.myfaces.tobago.layout.Measure) values[29];
987        verticalIndex = (java.lang.Integer) values[30];
988        renderedPartially = (java.lang.String[]) values[31];
989        target = (java.lang.String) values[32];
990        currentMarkup = (org.apache.myfaces.tobago.context.Markup) values[33];
991        onclick = (java.lang.String) values[34];
992        horizontalIndex = (java.lang.Integer) values[35];
993        disabled = (java.lang.Boolean) values[36];
994      }
995    
996      public Object saveState(FacesContext context) {
997        Object[] values = new Object[37];
998        values[0] = super.saveState(context);
999        values[1] = markup;
1000        values[2] = marginLeft;
1001        values[3] = link;
1002        values[4] = tabIndex;
1003        values[5] = minimumHeight;
1004        values[6] = tip;
1005        values[7] = height;
1006        values[8] = minimumWidth;
1007        values[9] = inline;
1008        values[10] = rowSpan;
1009        values[11] = left;
1010        values[12] = columnSpan;
1011        values[13] = top;
1012        values[14] = maximumHeight;
1013        values[15] = currentWidth;
1014        values[16] = marginTop;
1015        values[17] = width;
1016        values[18] = marginRight;
1017        values[19] = preferredHeight;
1018        values[20] = resource;
1019        values[21] = jsfResource;
1020        values[22] = currentHeight;
1021        values[23] = transition;
1022        values[24] = label;
1023        values[25] = display;
1024        values[26] = maximumWidth;
1025        values[27] = preferredWidth;
1026        values[28] = immediate;
1027        values[29] = marginBottom;
1028        values[30] = verticalIndex;
1029        values[31] = renderedPartially;
1030        values[32] = target;
1031        values[33] = currentMarkup;
1032        values[34] = onclick;
1033        values[35] = horizontalIndex;
1034        values[36] = disabled;
1035        return values;
1036      }
1037    
1038    
1039    }