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.AbstractUITreeIndent;
025    import org.apache.commons.lang.ArrayUtils;
026    import org.apache.commons.lang.StringUtils;
027    import org.apache.myfaces.tobago.component.MethodBindingToMethodExpression;
028    import org.apache.myfaces.tobago.component.MethodExpressionToMethodBinding;
029    import org.apache.myfaces.tobago.internal.util.Deprecation;
030    import org.apache.myfaces.tobago.renderkit.MarginValues;
031    import org.apache.myfaces.tobago.renderkit.SpacingValues;
032    import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
033    import javax.el.ELException;
034    import javax.faces.FacesException;
035    import java.util.ArrayList;
036    import java.util.List;
037    import javax.el.MethodExpression;
038    import javax.el.ValueExpression;
039    
040    /** 
041     Renders an indent beside a tree node.
042      * UIComponent class, generated from template {@code component1.2.stg} with class
043      * {@link org.apache.myfaces.tobago.internal.taglib.component.TreeIndentTagDeclaration}.
044     */
045    public class UITreeIndent
046        extends AbstractUITreeIndent implements SupportsMarkup {
047    
048      public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.TreeIndent";
049    
050      private org.apache.myfaces.tobago.context.Markup markup;
051      private java.lang.Boolean showJunctions;
052      private org.apache.myfaces.tobago.context.Markup currentMarkup;
053      private java.lang.String tip;
054    
055    
056      public org.apache.myfaces.tobago.context.Markup getMarkup() {
057        if (markup != null) {
058          return markup;
059        }
060        ValueExpression ve = getValueExpression("markup");
061        if (ve != null) {
062          try {
063            Object object = ve.getValue(getFacesContext().getELContext());
064            return Markup.valueOf(object);
065          } catch (ELException e) {
066                      throw new FacesException(e);
067              }
068        }
069        return null;
070      }
071    
072      public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
073        this.markup = markup;
074      }
075    
076      /**
077      Show the lines and icons which are defining the tree structure.
078      <br />Default: <code>true</code>
079      */
080      public boolean isShowJunctions() {
081        if (showJunctions != null) {
082          return showJunctions;
083        }
084        ValueExpression ve = getValueExpression("showJunctions");
085        if (ve != null) {
086          try {
087            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
088            if (bool != null) {
089              return bool;
090            }
091          } catch (ELException e) {
092                      throw new FacesException(e);
093              }
094        }
095        return true;
096      }
097    
098      public void setShowJunctions(boolean showJunctions) {
099        this.showJunctions = showJunctions;
100      }
101    
102      public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
103        if (currentMarkup != null) {
104          return currentMarkup;
105        }
106        return null;
107      }
108    
109      public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
110        this.currentMarkup = currentMarkup;
111      }
112    
113      /**
114      Text value to display as tooltip.
115    
116      */
117      public java.lang.String getTip() {
118        if (tip != null) {
119          return tip;
120        }
121        ValueExpression ve = getValueExpression("tip");
122        if (ve != null) {
123          try {
124            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
125          } catch (ELException e) {
126                      throw new FacesException(e);
127              }
128        }
129        return null;
130      }
131    
132      public void setTip(java.lang.String tip) {
133        this.tip = tip;
134      }
135    
136      public void restoreState(FacesContext context, Object componentState) {
137        Object[] values = (Object[]) componentState;
138        super.restoreState(context, values[0]);
139        markup = (org.apache.myfaces.tobago.context.Markup) values[1];
140        showJunctions = (java.lang.Boolean) values[2];
141        tip = (java.lang.String) values[3];
142      }
143    
144      public Object saveState(FacesContext context) {
145        Object[] values = new Object[4];
146        values[0] = super.saveState(context);
147        values[1] = markup;
148        values[2] = showJunctions;
149        values[3] = tip;
150        currentMarkup = null;
151        return values;
152      }
153    
154    
155    }