/*
* 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.menu;
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.XULComponentTag;
/**
*
* @author kito31
* @version $Id: MenuTag.java,v 1.2 2007/05/08 14:20:10 kito31 Exp $
*/
@TAG(name="menu",description="Defines a menu (see XUL menu element).")
public class MenuTag extends XULComponentTag {
@ATTRIBUTE(description = "Text that appears beside beside the menu label to indicate the shortcut key (accelerator key) to use to invoke the command.")
private String acceltext;
@ATTRIBUTE(description = "This should be set to a letter that is used as a shortcut key.")
private String accesskey;
@ATTRIBUTE(mappedType="java.lang.Boolean",description = "If true, events are passed to children of the menu. Otherwise, events are passed to the menu only.")
private String allowevents;
@ATTRIBUTE(description = "If the label of the menu 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 = "Indicates whether the menu is disabled or not. ")
private String disabled;
@ATTRIBUTE(description = "The id of a key element that is used as the menu command's shortcut key.")
private String key;
@ATTRIBUTE(description = "The label that will appear on the menu.")
private String label;
@ATTRIBUTE(mappedType="java.lang.Boolean",description = "This attribute is set on an item in a menu when it is being hovered over.")
private String menuactive;
@ATTRIBUTE(mappedType="java.lang.Boolean",description = "This attribute is set on the menu when it is open.")
private String open;
@ATTRIBUTE(description = "Indicates how the menu width and the popup width are determined.")
private String sizetopopup;
@ATTRIBUTE(description = "A value associated with the menu.")
private String value;
public String getRendererType() {
return "xul.renderer.Menu";
}
public String getComponentType() {
return "xul.component.Menu";
}
public String getAcceltext() {
return acceltext;
}
public void setAcceltext(String acceltext) {
this.acceltext = acceltext;
}
public String getAccesskey() {
return accesskey;
}
public void setAccesskey(String accesskey) {
this.accesskey = accesskey;
}
public String getAllowevents() {
return allowevents;
}
public void setAllowevents(String allowevents) {
this.allowevents = allowevents;
}
public String getCrop() {
return crop;
}
public void setCrop(String crop) {
this.crop = crop;
}
public String getDisabled() {
return disabled;
}
public void setDisabled(String disabled) {
this.disabled = disabled;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getMenuactive() {
return menuactive;
}
public void setMenuactive(String menuactive) {
this.menuactive = menuactive;
}
public String getOpen() {
return open;
}
public void setOpen(String open) {
this.open = open;
}
public String getSizetopopup() {
return sizetopopup;
}
public void setSizetopopup(String sizetopopup) {
this.sizetopopup = sizetopopup;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
// @StartGeneration
protected void setProperties(UIComponent component) {
super.setProperties(component);
FacesContext facesContext = getFacesContext();
setStringAttribute(facesContext,component,"acceltext",acceltext);
setStringAttribute(facesContext,component,"accesskey",accesskey);
setBooleanAttribute(facesContext,component,"allowevents",allowevents);
setStringAttribute(facesContext,component,"crop",crop);
setBooleanAttribute(facesContext,component,"disabled",disabled);
setStringAttribute(facesContext,component,"key",key);
setStringAttribute(facesContext,component,"label",label);
setBooleanAttribute(facesContext,component,"menuactive",menuactive);
setBooleanAttribute(facesContext,component,"open",open);
setStringAttribute(facesContext,component,"sizetopopup",sizetopopup);
setStringAttribute(facesContext,component,"value",value);
}
// @EndGeneration
}