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.UIColumn;
023    import javax.faces.context.FacesContext;
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     This component creates an event in a UISheet for each row.
041      * UIComponent class, generated from template {@code component1.2.stg} with class
042      * {@link org.apache.myfaces.tobago.internal.taglib.component.ColumnEventTagDeclaration}.
043     */
044    public class UIColumnEvent
045        extends UIColumn implements ColumnEvent {
046    
047      public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.ColumnEvent";
048    
049      private java.lang.String event;
050    
051    
052      public java.lang.String getEvent() {
053        if (event != null) {
054          return event;
055        }
056        ValueExpression ve = getValueExpression("event");
057        if (ve != null) {
058          try {
059            return (java.lang.String) ve.getValue(getFacesContext().getELContext());
060          } catch (ELException e) {
061                      throw new FacesException(e);
062              }
063        }
064        return null;
065      }
066    
067      public void setEvent(java.lang.String event) {
068        this.event = event;
069      }
070    
071      public void restoreState(FacesContext context, Object componentState) {
072        Object[] values = (Object[]) componentState;
073        super.restoreState(context, values[0]);
074        event = (java.lang.String) values[1];
075      }
076    
077      public Object saveState(FacesContext context) {
078        Object[] values = new Object[2];
079        values[0] = super.saveState(context);
080        values[1] = event;
081        return values;
082      }
083    
084    
085    }