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.AbstractUISheetLayout;
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     Creates a SheetLayout, which is a internal layout manager of a sheet.
042      * UIComponent class, generated from template {@code component1.2.stg} with class
043      * {@link org.apache.myfaces.tobago.internal.taglib.component.SheetLayoutTagDeclaration}.
044     */
045    public class UISheetLayout
046        extends AbstractUISheetLayout implements SupportsMarkup {
047    
048      public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.SheetLayout";
049    
050      public static final String COMPONENT_FAMILY = "org.apache.myfaces.tobago.SheetLayout";
051    
052      private org.apache.myfaces.tobago.context.Markup markup;
053      private org.apache.myfaces.tobago.context.Markup currentMarkup;
054    
055      public String getFamily() {
056        return COMPONENT_FAMILY;
057      }
058    
059    
060      public org.apache.myfaces.tobago.context.Markup getMarkup() {
061        if (markup != null) {
062          return markup;
063        }
064        ValueExpression ve = getValueExpression("markup");
065        if (ve != null) {
066          try {
067            Object object = ve.getValue(getFacesContext().getELContext());
068            return Markup.valueOf(object);
069          } catch (ELException e) {
070                      throw new FacesException(e);
071              }
072        }
073        return null;
074      }
075    
076      public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
077        this.markup = markup;
078      }
079    
080      public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
081        if (currentMarkup != null) {
082          return currentMarkup;
083        }
084        ValueExpression ve = getValueExpression("currentMarkup");
085        if (ve != null) {
086          try {
087            Object object = ve.getValue(getFacesContext().getELContext());
088            return Markup.valueOf(object);
089          } catch (ELException e) {
090                      throw new FacesException(e);
091              }
092        }
093        return null;
094      }
095    
096      public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
097        this.currentMarkup = currentMarkup;
098      }
099    
100      public void restoreState(FacesContext context, Object componentState) {
101        Object[] values = (Object[]) componentState;
102        super.restoreState(context, values[0]);
103        markup = (org.apache.myfaces.tobago.context.Markup) values[1];
104        currentMarkup = (org.apache.myfaces.tobago.context.Markup) values[2];
105      }
106    
107      public Object saveState(FacesContext context) {
108        Object[] values = new Object[3];
109        values[0] = super.saveState(context);
110        values[1] = markup;
111        values[2] = currentMarkup;
112        return values;
113      }
114    
115    
116    }