/*
* 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.component.toolbar;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
import org.xulfaces.annotation.faces.ATTRIBUTE;
import org.xulfaces.annotation.faces.COMPONENT;
import org.xulfaces.component.XULComponentBase;
/**
*
* @author kito31
* @version $Id$
*/
@COMPONENT(type="xul.component.ToolbarButton")
public class ToolbarButtonComponent extends XULComponentBase {
@ATTRIBUTE(description = "Returns the accessibility object for the toolbox.")
protected String accessible;
@ATTRIBUTE(description = "This should be set to a letter that is used as a shortcut key.")
protected String accesskey;
@ATTRIBUTE(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 Boolean autoCheck;
@ATTRIBUTE(description = "This attribute may be used to create three state buttons, numbered 0, 1 and 2.")
protected Integer checkState;
@ATTRIBUTE(description = "Indicates whether the button is checked or not.")
protected Boolean 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 = "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 dir;
@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. Only one button from each group can be checked at a time.")
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(description = "For the menu type buttons, the open attribute is set to true when the menu is open.")
protected Boolean open;
@ATTRIBUTE(description = "Used to specify whether the children of the toolbarbutton are oriented horizontally or vertically.")
protected String orient;
@ATTRIBUTE(description = "The tab order of the element.")
protected Integer 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;
// @StartGeneration
public java.lang.String getAccessible(){
java.lang.String value = null;
ValueBinding vb = getValueBinding("accessible");
if (vb != null) {
return (java.lang.String)(vb.getValue(getFacesContext()));
}
else {
value = this.accessible;
}
return value;
}
public void setAccessible(java.lang.String value){
this.accessible = value;
}
public java.lang.String getAccesskey(){
java.lang.String value = null;
ValueBinding vb = getValueBinding("accesskey");
if (vb != null) {
return (java.lang.String)(vb.getValue(getFacesContext()));
}
else {
value = this.accesskey;
}
return value;
}
public void setAccesskey(java.lang.String value){
this.accesskey = value;
}
public java.lang.Boolean getAutoCheck(){
java.lang.Boolean value = null;
ValueBinding vb = getValueBinding("autoCheck");
if (vb != null) {
return (java.lang.Boolean)(vb.getValue(getFacesContext()));
}
else {
value = this.autoCheck;
}
return value;
}
public void setAutoCheck(java.lang.Boolean value){
this.autoCheck = value;
}
public java.lang.Integer getCheckState(){
java.lang.Integer value = null;
ValueBinding vb = getValueBinding("checkState");
if (vb != null) {
return (java.lang.Integer)(vb.getValue(getFacesContext()));
}
else {
value = this.checkState;
}
return value;
}
public void setCheckState(java.lang.Integer value){
this.checkState = value;
}
public java.lang.Boolean getChecked(){
java.lang.Boolean value = null;
ValueBinding vb = getValueBinding("checked");
if (vb != null) {
return (java.lang.Boolean)(vb.getValue(getFacesContext()));
}
else {
value = this.checked;
}
return value;
}
public void setChecked(java.lang.Boolean value){
this.checked = value;
}
public java.lang.String getCommand(){
java.lang.String value = null;
ValueBinding vb = getValueBinding("command");
if (vb != null) {
return (java.lang.String)(vb.getValue(getFacesContext()));
}
else {
value = this.command;
}
return value;
}
public void setCommand(java.lang.String value){
this.command = value;
}
public java.lang.String getCrop(){
java.lang.String value = null;
ValueBinding vb = getValueBinding("crop");
if (vb != null) {
return (java.lang.String)(vb.getValue(getFacesContext()));
}
else {
value = this.crop;
}
return value;
}
public void setCrop(java.lang.String value){
this.crop = value;
}
public java.lang.String getDir(){
java.lang.String value = null;
ValueBinding vb = getValueBinding("dir");
if (vb != null) {
return (java.lang.String)(vb.getValue(getFacesContext()));
}
else {
value = this.dir;
}
return value;
}
public void setDir(java.lang.String value){
this.dir = value;
}
public java.lang.String getDlgType(){
java.lang.String value = null;
ValueBinding vb = getValueBinding("dlgType");
if (vb != null) {
return (java.lang.String)(vb.getValue(getFacesContext()));
}
else {
value = this.dlgType;
}
return value;
}
public void setDlgType(java.lang.String value){
this.dlgType = value;
}
public java.lang.String getGroup(){
java.lang.String value = null;
ValueBinding vb = getValueBinding("group");
if (vb != null) {
return (java.lang.String)(vb.getValue(getFacesContext()));
}
else {
value = this.group;
}
return value;
}
public void setGroup(java.lang.String value){
this.group = value;
}
public java.lang.String getImage(){
java.lang.String value = null;
ValueBinding vb = getValueBinding("image");
if (vb != null) {
return (java.lang.String)(vb.getValue(getFacesContext()));
}
else {
value = this.image;
}
return value;
}
public void setImage(java.lang.String value){
this.image = value;
}
public java.lang.String getLabel(){
java.lang.String value = null;
ValueBinding vb = getValueBinding("label");
if (vb != null) {
return (java.lang.String)(vb.getValue(getFacesContext()));
}
else {
value = this.label;
}
return value;
}
public void setLabel(java.lang.String value){
this.label = value;
}
public java.lang.Boolean getOpen(){
java.lang.Boolean value = null;
ValueBinding vb = getValueBinding("open");
if (vb != null) {
return (java.lang.Boolean)(vb.getValue(getFacesContext()));
}
else {
value = this.open;
}
return value;
}
public void setOpen(java.lang.Boolean value){
this.open = value;
}
public java.lang.String getOrient(){
java.lang.String value = null;
ValueBinding vb = getValueBinding("orient");
if (vb != null) {
return (java.lang.String)(vb.getValue(getFacesContext()));
}
else {
value = this.orient;
}
return value;
}
public void setOrient(java.lang.String value){
this.orient = value;
}
public java.lang.Integer getTabindex(){
java.lang.Integer value = null;
ValueBinding vb = getValueBinding("tabindex");
if (vb != null) {
return (java.lang.Integer)(vb.getValue(getFacesContext()));
}
else {
value = this.tabindex;
}
return value;
}
public void setTabindex(java.lang.Integer value){
this.tabindex = value;
}
public java.lang.String getType(){
java.lang.String value = null;
ValueBinding vb = getValueBinding("type");
if (vb != null) {
return (java.lang.String)(vb.getValue(getFacesContext()));
}
else {
value = this.type;
}
return value;
}
public void setType(java.lang.String value){
this.type = value;
}
public java.lang.String getValidate(){
java.lang.String value = null;
ValueBinding vb = getValueBinding("validate");
if (vb != null) {
return (java.lang.String)(vb.getValue(getFacesContext()));
}
else {
value = this.validate;
}
return value;
}
public void setValidate(java.lang.String value){
this.validate = value;
}
public Object saveState(FacesContext context) {
Object values[] = new Object[18];
values[0] = super.saveState(context);
values[1] = this.accessible;
values[2] = this.accesskey;
values[3] = this.autoCheck;
values[4] = this.checkState;
values[5] = this.checked;
values[6] = this.command;
values[7] = this.crop;
values[8] = this.dir;
values[9] = this.dlgType;
values[10] = this.group;
values[11] = this.image;
values[12] = this.label;
values[13] = this.open;
values[14] = this.orient;
values[15] = this.tabindex;
values[16] = this.type;
values[17] = this.validate;
return ((Object) (values));
}
public void restoreState(FacesContext context, Object state) {
Object values[] = (Object[]) state;
super.restoreState(context, values[0]);
this.accessible = (java.lang.String) values[1];
this.accesskey = (java.lang.String) values[2];
this.autoCheck = (java.lang.Boolean) values[3];
this.checkState = (java.lang.Integer) values[4];
this.checked = (java.lang.Boolean) values[5];
this.command = (java.lang.String) values[6];
this.crop = (java.lang.String) values[7];
this.dir = (java.lang.String) values[8];
this.dlgType = (java.lang.String) values[9];
this.group = (java.lang.String) values[10];
this.image = (java.lang.String) values[11];
this.label = (java.lang.String) values[12];
this.open = (java.lang.Boolean) values[13];
this.orient = (java.lang.String) values[14];
this.tabindex = (java.lang.Integer) values[15];
this.type = (java.lang.String) values[16];
this.validate = (java.lang.String) values[17];
}
// @EndGeneration
}