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.internal.component.AbstractUIColumnSelector;
024    import org.apache.commons.lang.ArrayUtils;
025    import org.apache.commons.lang.StringUtils;
026    import org.apache.myfaces.tobago.component.MethodBindingToMethodExpression;
027    import org.apache.myfaces.tobago.component.MethodExpressionToMethodBinding;
028    import org.apache.myfaces.tobago.internal.util.Deprecation;
029    import org.apache.myfaces.tobago.renderkit.MarginValues;
030    import org.apache.myfaces.tobago.renderkit.SpacingValues;
031    import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
032    import javax.el.ELException;
033    import javax.faces.FacesException;
034    import java.util.ArrayList;
035    import java.util.List;
036    import javax.el.MethodExpression;
037    import javax.el.ValueExpression;
038    
039    /** 
040     Renders a column with checkboxes to mark selected rows.
041      * UIComponent class, generated from template {@code component1.2.stg} with class
042      * {@link org.apache.myfaces.tobago.internal.taglib.component.ColumnSelectorTagDeclaration}.
043     */
044    public class UIColumnSelector
045        extends AbstractUIColumnSelector  {
046    
047      public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.ColumnSelector";
048    
049      private java.lang.Boolean disabled;
050    
051    
052      /**
053      Flag indicating that this element is disabled.
054      <br />Default: <code>false</code>
055      */
056      public boolean isDisabled() {
057        if (disabled != null) {
058          return disabled;
059        }
060        ValueExpression ve = getValueExpression("disabled");
061        if (ve != null) {
062          try {
063            Boolean bool = (Boolean) ve.getValue(getFacesContext().getELContext());
064            if (bool != null) {
065              return bool;
066            }
067          } catch (ELException e) {
068                      throw new FacesException(e);
069              }
070        }
071        return false;
072      }
073    
074      public void setDisabled(boolean disabled) {
075        this.disabled = disabled;
076      }
077    
078      public void restoreState(FacesContext context, Object componentState) {
079        Object[] values = (Object[]) componentState;
080        super.restoreState(context, values[0]);
081        disabled = (java.lang.Boolean) values[1];
082      }
083    
084      public Object saveState(FacesContext context) {
085        Object[] values = new Object[2];
086        values[0] = super.saveState(context);
087        values[1] = disabled;
088        return values;
089      }
090    
091    
092    }