// 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.newspaper;

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


// Generated from class org.apache.myfaces.custom.newspaper.AbstractHtmlNewspaperTable.
//
// WARNING: This file was automatically generated. Do not edit it directly,
//          or you will lose your changes.
public class HtmlNewspaperTableTag
    extends org.apache.myfaces.shared_tomahawk.taglib.html.HtmlDataTableTag
{
    public HtmlNewspaperTableTag()
    {    
    }
    
    public String getComponentType()
    {
        return "org.apache.myfaces.HtmlNewspaperTable";
    }

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

 
    private String _newspaperColumns;
    
    public void setNewspaperColumns(String newspaperColumns)
    {
        _newspaperColumns = newspaperColumns;
    }
 
    private String _newspaperOrientation;
    
    public void setNewspaperOrientation(String newspaperOrientation)
    {
        _newspaperOrientation = newspaperOrientation;
    }
 
    private String _datafld;
    
    public void setDatafld(String datafld)
    {
        _datafld = datafld;
    }
 
    private String _datasrc;
    
    public void setDatasrc(String datasrc)
    {
        _datasrc = datasrc;
    }
 
    private String _dataformatas;
    
    public void setDataformatas(String dataformatas)
    {
        _dataformatas = dataformatas;
    }
 
    private String _align;
    
    public void setAlign(String align)
    {
        _align = align;
    }

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

        if (_newspaperColumns != null)
        {
            if (isValueReference(_newspaperColumns))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_newspaperColumns);
                comp.setValueBinding("newspaperColumns", vb);
            }
            else
            {
                comp.getAttributes().put("newspaperColumns", Integer.valueOf(_newspaperColumns));
            }
        } 
        if (_newspaperOrientation != null)
        {
            if (isValueReference(_newspaperOrientation))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_newspaperOrientation);
                comp.setValueBinding("newspaperOrientation", vb);
            }
            else
            {
                comp.getAttributes().put("newspaperOrientation", _newspaperOrientation);
            }
        } 
        if (_datafld != null)
        {
            if (isValueReference(_datafld))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_datafld);
                comp.setValueBinding("datafld", vb);
            }
            else
            {
                comp.getAttributes().put("datafld", _datafld);
            }
        } 
        if (_datasrc != null)
        {
            if (isValueReference(_datasrc))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_datasrc);
                comp.setValueBinding("datasrc", vb);
            }
            else
            {
                comp.getAttributes().put("datasrc", _datasrc);
            }
        } 
        if (_dataformatas != null)
        {
            if (isValueReference(_dataformatas))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_dataformatas);
                comp.setValueBinding("dataformatas", vb);
            }
            else
            {
                comp.getAttributes().put("dataformatas", _dataformatas);
            }
        } 
        if (_align != null)
        {
            if (isValueReference(_align))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_align);
                comp.setValueBinding("align", vb);
            }
            else
            {
                comp.getAttributes().put("align", _align);
            }
        } 
    }

    public void release()
    {
        super.release();
        _newspaperColumns = null;
        _newspaperOrientation = null;
        _datafld = null;
        _datasrc = null;
        _dataformatas = null;
        _align = null;
    }
}