/*
* xulfaces : bring XUL power to Java
*
* Copyright (C) 2005 Olivier SCHMITT
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
package org.xulfaces.tag.toolbar;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import org.xulfaces.annotation.taglib.ATTRIBUTE;
import org.xulfaces.annotation.taglib.TAG;
import org.xulfaces.tag.ButtonTag;
/**
*
* @author kito31
* @version $Id$
*/
@TAG(name="toolbarbutton",description="Defines a toolbarbutton.")
public class ToolbarButtonTag extends ButtonTag {
@ATTRIBUTE(description = "This should be set to a letter that is used as a shortcut key.")
protected String accesskey;
@ATTRIBUTE(mappedType="java.lang.Boolean",description = "If this attribute is true, or left out, the checked state of the button will be switched each time the button is pressed.")
protected String autoCheck;
@ATTRIBUTE(mappedType="java.lang.Integer",description = "This attribute may be used to create three state buttons, numbered 0, 1 and 2.")
protected String checkState;
@ATTRIBUTE(mappedType="java.lang.Boolean",description = "Indicates whether the button is checked or not.")
protected String checked;
@ATTRIBUTE(description = "Set to the id of a command element that is being observed by the element.")
protected String command;
@ATTRIBUTE(description = "If the label of the toolbarbutton is too small to fit in its given space, the text will be cropped on the side specified by the crop attribute.")
protected String crop;
@ATTRIBUTE(description = "The direction in which the child elements of the toolbarbutton are placed.")
protected String dir;
@ATTRIBUTE(type="java.lang.Boolean",description = " Indicates whether the toolbarbutton is disabled or not.")
protected String disabled;
@ATTRIBUTE(description = "The dialog type of the button, used only when the button is in a dialog box.")
protected String dlgType;
@ATTRIBUTE(description = "Buttons with the same value for their group attribute are put into the same group.")
protected String group;
@ATTRIBUTE(description = "The URL of the image to appear on the toolbarbutton.")
protected String image;
@ATTRIBUTE(description = "The label that will appear on the toolbarbutton. If this is left out, no text appears.")
protected String label;
@ATTRIBUTE(type="java.lang.Boolean",description = "For the menu type buttons, the open attribute is set to true when the menu is open.")
protected String open;
@ATTRIBUTE(description = "Used to specify whether the children of the toolbarbutton are oriented horizontally or vertically.")
protected String orient;
@ATTRIBUTE(mappedType="java.lang.Integer",description = "The tab order of the element.")
protected String tabindex;
@ATTRIBUTE(description = "The type of button. If this attribute is not present, a normal button is created.")
protected String type;
@ATTRIBUTE(description = "This attribute indicates whether to load the image from the cache or not.")
protected String validate;
public String getComponentType() {
return "xul.component.ToolbarButton";
}
public String getRendererType() {
return "xul.renderer.ToolbarButton";
}
// @StartGeneration
protected void setProperties(UIComponent component) {
super.setProperties(component);
FacesContext facesContext = getFacesContext();
setStringAttribute(facesContext,component,"accesskey",accesskey);
setBooleanAttribute(facesContext,component,"autoCheck",autoCheck);
setIntegerAttribute(facesContext,component,"checkState",checkState);
setBooleanAttribute(facesContext,component,"checked",checked);
setStringAttribute(facesContext,component,"command",command);
setStringAttribute(facesContext,component,"crop",crop);
setStringAttribute(facesContext,component,"dir",dir);
setStringAttribute(facesContext,component,"disabled",disabled);
setStringAttribute(facesContext,component,"dlgType",dlgType);
setStringAttribute(facesContext,component,"group",group);
setStringAttribute(facesContext,component,"image",image);
setStringAttribute(facesContext,component,"label",label);
setStringAttribute(facesContext,component,"open",open);
setStringAttribute(facesContext,component,"orient",orient);
setIntegerAttribute(facesContext,component,"tabindex",tabindex);
setStringAttribute(facesContext,component,"type",type);
setStringAttribute(facesContext,component,"validate",validate);
}
// @EndGeneration
}