// 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.navmenu.jscookmenu;

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.navmenu.jscookmenu.AbstractHtmlCommandJSCookMenu.
//
// WARNING: This file was automatically generated. Do not edit it directly,
//          or you will lose your changes.
public class HtmlJSCookMenuTag
    extends javax.faces.webapp.UIComponentTag
{
    public HtmlJSCookMenuTag()
    {    
    }
    
    public String getComponentType()
    {
        return "org.apache.myfaces.JSCookMenu";
    }

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

 
    private String _layout;
    
    public void setLayout(String layout)
    {
        _layout = layout;
    }
 
    private String _theme;
    
    public void setTheme(String theme)
    {
        _theme = theme;
    }
 
    private String _enabledOnUserRole;
    
    public void setEnabledOnUserRole(String enabledOnUserRole)
    {
        _enabledOnUserRole = enabledOnUserRole;
    }
 
    private String _visibleOnUserRole;
    
    public void setVisibleOnUserRole(String visibleOnUserRole)
    {
        _visibleOnUserRole = visibleOnUserRole;
    }
 
    private String _javascriptLocation;
    
    public void setJavascriptLocation(String javascriptLocation)
    {
        _javascriptLocation = javascriptLocation;
    }
 
    private String _imageLocation;
    
    public void setImageLocation(String imageLocation)
    {
        _imageLocation = imageLocation;
    }
 
    private String _styleLocation;
    
    public void setStyleLocation(String styleLocation)
    {
        _styleLocation = styleLocation;
    }
 
    private String _immediate;
    
    public void setImmediate(String immediate)
    {
        _immediate = immediate;
    }

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

        if (_layout != null)
        {
            if (isValueReference(_layout))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_layout);
                comp.setValueBinding("layout", vb);
            }
            else
            {
                comp.getAttributes().put("layout", _layout);
            }
        } 
        if (_theme != null)
        {
            if (isValueReference(_theme))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_theme);
                comp.setValueBinding("theme", vb);
            }
            else
            {
                comp.getAttributes().put("theme", _theme);
            }
        } 
        if (_enabledOnUserRole != null)
        {
            if (isValueReference(_enabledOnUserRole))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_enabledOnUserRole);
                comp.setValueBinding("enabledOnUserRole", vb);
            }
            else
            {
                comp.getAttributes().put("enabledOnUserRole", _enabledOnUserRole);
            }
        } 
        if (_visibleOnUserRole != null)
        {
            if (isValueReference(_visibleOnUserRole))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_visibleOnUserRole);
                comp.setValueBinding("visibleOnUserRole", vb);
            }
            else
            {
                comp.getAttributes().put("visibleOnUserRole", _visibleOnUserRole);
            }
        } 
        if (_javascriptLocation != null)
        {
            if (isValueReference(_javascriptLocation))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_javascriptLocation);
                comp.setValueBinding("javascriptLocation", vb);
            }
            else
            {
                comp.getAttributes().put("javascriptLocation", _javascriptLocation);
            }
        } 
        if (_imageLocation != null)
        {
            if (isValueReference(_imageLocation))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_imageLocation);
                comp.setValueBinding("imageLocation", vb);
            }
            else
            {
                comp.getAttributes().put("imageLocation", _imageLocation);
            }
        } 
        if (_styleLocation != null)
        {
            if (isValueReference(_styleLocation))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_styleLocation);
                comp.setValueBinding("styleLocation", vb);
            }
            else
            {
                comp.getAttributes().put("styleLocation", _styleLocation);
            }
        } 
        if (_immediate != null)
        {
            if (isValueReference(_immediate))
            {
                ValueBinding vb = context.getApplication().createValueBinding(_immediate);
                comp.setValueBinding("immediate", vb);
            }
            else
            {
                comp.getAttributes().put("immediate", Boolean.valueOf(_immediate));
            }
        } 
    }

    public void release()
    {
        super.release();
        _layout = null;
        _theme = null;
        _enabledOnUserRole = null;
        _visibleOnUserRole = null;
        _javascriptLocation = null;
        _imageLocation = null;
        _styleLocation = null;
        _immediate = null;
    }
}