// WARNING: This file was automatically generated. Do not edit it directly,
//          or you will lose your changes.
/*
 *  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 * 
 *  http://www.apache.org/licenses/LICENSE-2.0
 * 
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 */
package org.apache.myfaces.custom.sortheader;

import javax.faces.component.UIComponent;
import javax.faces.el.ValueBinding;
import javax.faces.context.FacesContext;
import javax.faces.el.MethodBinding;


// Generated from class org.apache.myfaces.custom.sortheader.AbstractHtmlCommandSortHeader.
//
// WARNING: This file was automatically generated. Do not edit it directly,
//          or you will lose your changes.
public class HtmlCommandSortHeaderTag
    extends org.apache.myfaces.generated.taglib.html.ext.HtmlCommandLinkTag
{
    public HtmlCommandSortHeaderTag()
    {    
    }
    
    public String getComponentType()
    {
        return "org.apache.myfaces.HtmlCommandSortHeader";
    }

    public String getRendererType()
    {
        return "org.apache.myfaces.SortHeader";
    }

 
    private String _columnName;
    
    public void setColumnName(String columnName)
    {
        _columnName = columnName;
    }
 
    private String _propertyName;
    
    public void setPropertyName(String propertyName)
    {
        _propertyName = propertyName;
    }
 
    private String _arrow;
    
    public void setArrow(String arrow)
    {
        _arrow = arrow;
    }

    protected void setProperties(UIComponent component)
    {
        if (!(component instanceof org.apache.myfaces.custom.sortheader.HtmlCommandSortHeader))
        {
            throw new IllegalArgumentException("Component "+
                component.getClass().getName() +" is no org.apache.myfaces.custom.sortheader.HtmlCommandSortHeader");
        }
        
        org.apache.myfaces.custom.sortheader.HtmlCommandSortHeader comp = (org.apache.myfaces.custom.sortheader.HtmlCommandSortHeader) component;
        
        super.setProperties(component);
        
        FacesContext context = getFacesContext();

        if (_columnName != null)
        {
            if (isValueReference(_columnName))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_columnName);
                comp.setValueBinding("columnName", vb);
            }
            else
            {
                comp.getAttributes().put("columnName", _columnName);
            }
        } 
        if (_propertyName != null)
        {
            if (isValueReference(_propertyName))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_propertyName);
                comp.setValueBinding("propertyName", vb);
            }
            else
            {
                comp.getAttributes().put("propertyName", _propertyName);
            }
        } 
        if (_arrow != null)
        {
            if (isValueReference(_arrow))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_arrow);
                comp.setValueBinding("arrow", vb);
            }
            else
            {
                comp.getAttributes().put("arrow", Boolean.valueOf(_arrow));
            }
        } 
    }

    public void release()
    {
        super.release();
        _columnName = null;
        _propertyName = null;
        _arrow = null;
    }
}