Package org.xulfaces.tag.menu

Source Code of org.xulfaces.tag.menu.MenuItemTag

/*
*   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: MenuItemTag.java,v 1.2 2007/05/08 14:20:10 kito31 Exp $
*/
@TAG(name="menuitem",description="Defines a menuitem (see XUL menuitem element).")
public class MenuItemTag  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 = "Returns the accessibility object for the menuitem.")
  private String accessible;

  @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 this attribute is true, or left out, the menuitem check mark will update each time the menu item is selected. If this attribute is false, the check mark must be adjusted manually.")
  private String autocheck;

  @ATTRIBUTE(mappedType="java.lang.Boolean",description = "Indicates whether the menuitem is checked or not.")
  private String checked;

  @ATTRIBUTE(description = "Set to the id of a command element that is being observed by the menuitem.")
  private String command;
 
  @ATTRIBUTE(description = "If the label of the menuitem 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(description = "An optional description to appear alongside the label.")
  private String description;

  @ATTRIBUTE(description = "The URL of the image to appear on the menuitem.")
  private String image;

  @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 menuitem.")
  private String label;

  @ATTRIBUTE(description = "Radio menuitems with the same name as put into a group.")
  private String name;

  @ATTRIBUTE(mappedType="java.lang.Boolean",description = "Indicates that the menuitem is selected in a menulist.")
  private String selected;

  @ATTRIBUTE(mappedType="java.lang.Integer",description = "The tab order of the element.")
  private String tabindex;

  @ATTRIBUTE(description = " Can be used to create checkable menuitems or for radio button menuitems.(checkbox or radio)")
  private String type;

  @ATTRIBUTE(description = "This attribute indicates whether to load the image from the cache or not.(always or never)")
  private String validate;

  @ATTRIBUTE(description = " You can associate a data value with each menu and menuitem.It is not used for any specific purpose but you can access it with a script for your own use.")
  private String value;

 
  public String getRendererType() {
    return "xul.renderer.MenuItem";
  }
 
  public String getComponentType() {
    return "xul.component.MenuItem";
  }

  public String getAcceltext() {
    return acceltext;
  }

  public void setAcceltext(String acceltext) {
    this.acceltext = acceltext;
  }

  public String getAccessible() {
    return accessible;
  }

  public void setAccessible(String accessible) {
    this.accessible = accessible;
  }

  public String getAccesskey() {
    return accesskey;
  }

  public void setAccesskey(String accesskey) {
    this.accesskey = accesskey;
  }
 
  public String getAutocheck() {
    return autocheck;
  }

  public void setAutocheck(String autocheck) {
    this.autocheck = autocheck;
  }

  public String getChecked() {
    return checked;
  }

  public void setChecked(String checked) {
    this.checked = checked;
  }

  public String getCommand() {
    return command;
  }

  public void setCommand(String command) {
    this.command = command;
  }

  public String getCrop() {
    return crop;
  }

  public void setCrop(String crop) {
    this.crop = crop;
  }

  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

 
  public String getImage() {
    return image;
  }

  public void setImage(String image) {
    this.image = image;
  }

  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 getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getSelected() {
    return selected;
  }

  public void setSelected(String selected) {
    this.selected = selected;
  }

  public String getTabindex() {
    return tabindex;
  }

  public void setTabindex(String tabindex) {
    this.tabindex = tabindex;
  }

  public String getType() {
    return type;
  }

  public void setType(String type) {
    this.type = type;
  }

  public String getValidate() {
    return validate;
  }

  public void setValidate(String validate) {
    this.validate = validate;
  }

  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,"accessible",accessible);
    setStringAttribute(facesContext,component,"accesskey",accesskey);
    setBooleanAttribute(facesContext,component,"autocheck",autocheck);
    setBooleanAttribute(facesContext,component,"checked",checked);
    setStringAttribute(facesContext,component,"command",command);
    setStringAttribute(facesContext,component,"crop",crop);
    setStringAttribute(facesContext,component,"description",description);
    setStringAttribute(facesContext,component,"image",image);
    setStringAttribute(facesContext,component,"key",key);
    setStringAttribute(facesContext,component,"label",label);
    setStringAttribute(facesContext,component,"name",name);
    setBooleanAttribute(facesContext,component,"selected",selected);
    setIntegerAttribute(facesContext,component,"tabindex",tabindex);
    setStringAttribute(facesContext,component,"type",type);
    setStringAttribute(facesContext,component,"validate",validate);
    setStringAttribute(facesContext,component,"value",value);

  }
 
                    // @EndGeneration
 
}
TOP

Related Classes of org.xulfaces.tag.menu.MenuItemTag

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.