org.zkoss.zul.api
Interface Menuitem

All Superinterfaces:
java.lang.Cloneable, Component, Disable, HtmlBasedComponent, LabelElement, LabelImageElement, Scope, java.io.Serializable, XulElement
All Known Implementing Classes:
Menuitem

public interface Menuitem
extends LabelImageElement, Disable

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

Default HtmlBasedComponent.getZclass(): z-menu-item. (since 3.5.0)

Since:
3.5.2
Author:
tomyeh

Field Summary
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Method Summary
 java.lang.String getHref()
          Returns the href.
 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.
 boolean isChecked()
          Returns whether it is checked.
 boolean isDisabled()
          Returns whether it is disabled.
 boolean isTopmost()
          Returns whether this is an top-level menu, i.e., not owning by another Menupopup.
 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 setCheckmark(boolean checkmark)
          Sets whether the check mark shall be displayed in front of each item.
 void setDisabled(boolean disabled)
          Sets whether it is disabled.
 void setHref(java.lang.String href)
          Sets the href.
 void setTarget(java.lang.String target)
          Sets the target frame or window.
 void setValue(java.lang.String value)
          Sets the value.
 
Methods inherited from interface org.zkoss.zul.impl.api.LabelImageElement
getHoverImage, getImage, getImageContent, setHoverImage, setHoverImageContent, setHoverImageContent, setImage, setImageContent, setImageContent
 
Methods inherited from interface org.zkoss.zul.impl.api.LabelElement
getLabel, setLabel
 
Methods inherited from interface org.zkoss.zul.impl.api.XulElement
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from interface org.zkoss.zk.ui.Component
addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, clone, containsVariable, detach, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getChildren, getDefinition, getDesktop, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, setWidgetListener, setWidgetOverride, unsetVariable
 
Methods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
 

Method Detail

setCheckmark

void setCheckmark(boolean checkmark)
Sets whether the check mark shall be displayed in front of each item.


setDisabled

void setDisabled(boolean disabled)
Sets whether it is disabled.

Specified by:
setDisabled in interface Disable

isDisabled

boolean isDisabled()
Returns whether it is disabled.

Default: false.

Specified by:
isDisabled in interface Disable

getValue

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

Default: "".


setValue

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


isChecked

boolean isChecked()
Returns whether it is checked.

Default: false.


setChecked

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

This only applies when Menuitem.isCheckmark() = true. (since 3.5.0)


isAutocheck

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

Default: false.


setAutocheck

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

This only applies when Menuitem.isCheckmark() = true. (since 3.5.0)


getHref

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

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


setHref

void setHref(java.lang.String href)
             throws WrongValueException
Sets the href.

Throws:
WrongValueException

getTarget

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

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

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

isTopmost

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



Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo