org.zkoss.zul
Class Menuitem

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.zul.impl.LabelElement
                  extended by org.zkoss.zul.impl.LabelImageElement
                      extended by org.zkoss.zul.Menuitem
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.sys.ComponentCtrl

public class Menuitem
extends LabelImageElement

sA single choice in a Menupopup element. It acts much like a button but it is rendered on a menu.

Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
protected  class Menuitem.ExtraCtrl
          A utility class to implement AbstractComponent.getExtraCtrl().
 
Field Summary
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Constructor Summary
Menuitem()
           
Menuitem(java.lang.String label)
           
Menuitem(java.lang.String label, java.lang.String src)
           
 
Method Summary
 java.lang.String getHref()
          Returns the href.
 java.lang.String getOuterAttrs()
           
protected  java.lang.String getRealStyle()
           
 java.lang.String getTarget()
          Returns the target frame or window.
 java.lang.String getValue()
          Returns the value.
 boolean isAutocheck()
          Returns whether the menuitem check mark will update each time the menu item is selected Default: false.
 boolean isChecked()
          Returns whether it is checked.
 boolean isChildable()
          Not childable.
 boolean isTopmost()
          Returns whether this is an top-level menu, i.e., not owning by another Menupopup.
protected  java.lang.Object newExtraCtrl()
           
 void setAutocheck(boolean autocheck)
          Sets whether the menuitem check mark will update each time the menu item is selected
 void setChecked(boolean checked)
          Sets whether it is checked.
 void setHref(java.lang.String href)
          Sets the href.
 void setParent(org.zkoss.zk.ui.Component parent)
           
 void setTarget(java.lang.String target)
          Sets the target frame or window.
 void setValue(java.lang.String value)
          Sets the value.
 
Methods inherited from class org.zkoss.zul.impl.LabelImageElement
getImage, getImageContent, getImgTag, getSrc, isImageAssigned, setImage, setImageContent, setSrc
 
Methods inherited from class org.zkoss.zul.impl.LabelElement
getLabel, setLabel
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getAllOnClickAttrs, getContext, getInnerAttrs, getPopup, getTooltip, setAction, setContext, setPopup, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addEventListener, appendAsapAttr, focus, getDraggable, getDroppable, getHeight, getLeft, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZIndex, isAsapRequired, removeEventListener, setClass, setDraggable, setDroppable, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addEventHandler, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, clone, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getEventHandler, getExtraCtrl, getFellow, getFellowIfAny, getId, getListenerIterator, getMold, getMoldURI, getNamespace, getPage, getParent, getPropagatee, getRoot, getSpaceOwner, getUuid, getVariable, insertBefore, invalidate, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onDrawNewChild, onWrongValue, redraw, removeAttribute, removeAttribute, removeChild, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setVariable, setVisible, smartUpdate, smartUpdate, smartUpdate, toString, unsetVariable
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Menuitem

public Menuitem()

Menuitem

public Menuitem(java.lang.String label)

Menuitem

public Menuitem(java.lang.String label,
                java.lang.String src)
Method Detail

getValue

public java.lang.String getValue()
Returns the value.

Default: "".


setValue

public void setValue(java.lang.String value)
Sets the value.


isChecked

public boolean isChecked()
Returns whether it is checked.

Default: false.


setChecked

public void setChecked(boolean checked)
Sets whether it is checked.


isAutocheck

public boolean isAutocheck()
Returns whether the menuitem check mark will update each time the menu item is selected

Default: false.


setAutocheck

public void setAutocheck(boolean autocheck)
Sets whether the menuitem check mark will update each time the menu item is selected


getHref

public java.lang.String getHref()
Returns the href.

Default: null. If null, the button has no function unless you specify the onClick handler.


setHref

public void setHref(java.lang.String href)
             throws org.zkoss.zk.ui.WrongValueException
Sets the href.

Throws:
org.zkoss.zk.ui.WrongValueException

getTarget

public java.lang.String getTarget()
Returns the target frame or window.

Note: it is useful only if href (setHref(java.lang.String)) is specified (i.e., use the onClick listener).

Default: null.


setTarget

public void setTarget(java.lang.String target)
Sets the target frame or window.

Parameters:
target - the name of the frame or window to hyperlink.

isTopmost

public boolean isTopmost()
Returns whether this is an top-level menu, i.e., not owning by another Menupopup.


getOuterAttrs

public java.lang.String getOuterAttrs()
Overrides:
getOuterAttrs in class XulElement

getRealStyle

protected java.lang.String getRealStyle()
Overrides:
getRealStyle in class org.zkoss.zk.ui.HtmlBasedComponent

setParent

public void setParent(org.zkoss.zk.ui.Component parent)
Specified by:
setParent in interface org.zkoss.zk.ui.Component
Overrides:
setParent in class org.zkoss.zk.ui.AbstractComponent

isChildable

public boolean isChildable()
Not childable.

Specified by:
isChildable in interface org.zkoss.zk.ui.Component
Overrides:
isChildable in class org.zkoss.zk.ui.AbstractComponent

newExtraCtrl

protected java.lang.Object newExtraCtrl()
Overrides:
newExtraCtrl in class LabelImageElement


Copyright © 2005-2007 Potix Corporation. All Rights Reserved.