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