/*
* 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.input;
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.ModelTag;
/**
*
* @author kito31
* @version $Id: MenuListTag.java,v 1.4 2007/05/08 14:17:56 kito31 Exp $
*/
@TAG(name="menulist",description="Defines a menulist (see XUL menulist element).")
public class MenuListTag extends ModelTag {
@ATTRIBUTE(description = "This should be set to a letter that is used as a shortcut key.")
private String accesskey;
@ATTRIBUTE(description = "If the label of the description is too small to fit in its given space, the text will be cropped on the side specified by the crop attribute.")
private String crop;
@ATTRIBUTE(mappedType="java.lang.Boolean",description = "If this attribute is true or omitted, the selected item on the menu will update to match what the user entered in the textbox.")
private String disableautoselect;
@ATTRIBUTE(mappedType="java.lang.Boolean",description = "Indicates that the value of the menulist can be modified by typing directly into the value field.")
private String editable;
@ATTRIBUTE(mappedType="java.lang.Boolean",description = "This attribute is set to true if the menulist element is focused.")
private String focused;
@ATTRIBUTE(description = " The URL of the image to appear on the menulist.")
private String image;
@ATTRIBUTE(description = " The label that will appear on the menulist. If this is left out, no text appears.")
private String label;
@ATTRIBUTE(mappedType="java.lang.Boolean",description = " If true, the menu popup is showing.")
private String open;
@ATTRIBUTE(description = "Connects the textbox to a corresponding preference.")
private String preference;
@ATTRIBUTE(mappedType="java.lang.Boolean",description = " If set to true, then the user cannot type into the field of an editable menulist. ")
private String readonly;
@ATTRIBUTE(description = " Indicates how the menu width and the popup width are determined. ")
private String sizetopopup;
@ATTRIBUTE(description = " The URL of the image to appear on the menulist.")
private String src;
@ATTRIBUTE(mappedType="java.lang.Integer",description = "The tab order of the element.")
private String tabindex;
public String getComponentType() {
return "xul.component.MenuList";
}
public String getRendererType() {
return "xul.renderer.MenuList";
}
public String getAccesskey() {
return accesskey;
}
public void setAccesskey(String accesskey) {
this.accesskey = accesskey;
}
public String getCrop() {
return crop;
}
public void setCrop(String crop) {
this.crop = crop;
}
public String getDisableautoselect() {
return disableautoselect;
}
public void setDisableautoselect(String disableautoselect) {
this.disableautoselect = disableautoselect;
}
public String getEditable() {
return editable;
}
public void setEditable(String editable) {
this.editable = editable;
}
public String getFocused() {
return focused;
}
public void setFocused(String focused) {
this.focused = focused;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getOpen() {
return open;
}
public void setOpen(String open) {
this.open = open;
}
public String getPreference() {
return preference;
}
public void setPreference(String preference) {
this.preference = preference;
}
public String getReadonly() {
return readonly;
}
public void setReadonly(String readonly) {
this.readonly = readonly;
}
public String getSizetopopup() {
return sizetopopup;
}
public void setSizetopopup(String sizetopopup) {
this.sizetopopup = sizetopopup;
}
public String getSrc() {
return src;
}
public void setSrc(String src) {
this.src = src;
}
public String getTabindex() {
return tabindex;
}
public void setTabindex(String tabindex) {
this.tabindex = tabindex;
}
// @StartGeneration
protected void setProperties(UIComponent component) {
super.setProperties(component);
FacesContext facesContext = getFacesContext();
setStringAttribute(facesContext,component,"accesskey",accesskey);
setStringAttribute(facesContext,component,"crop",crop);
setBooleanAttribute(facesContext,component,"disableautoselect",disableautoselect);
setBooleanAttribute(facesContext,component,"editable",editable);
setBooleanAttribute(facesContext,component,"focused",focused);
setStringAttribute(facesContext,component,"image",image);
setStringAttribute(facesContext,component,"label",label);
setBooleanAttribute(facesContext,component,"open",open);
setStringAttribute(facesContext,component,"preference",preference);
setBooleanAttribute(facesContext,component,"readonly",readonly);
setStringAttribute(facesContext,component,"sizetopopup",sizetopopup);
setStringAttribute(facesContext,component,"src",src);
setIntegerAttribute(facesContext,component,"tabindex",tabindex);
}
// @EndGeneration
}