Class Index | File Index

Classes


Class zwt.ui.menu.MenuItem


Extends zwt.ui.Widget.

A Menu Item is added to a zwt.ui.menu.Menu. It can contains a sub menu which contains menu items...

CSS rules

.zwt_menuItem {}
.zwt_menuItem .zwt_menuItem-label {}
.zwt_menuItem .zwt_menuItem-label-selected {}
.zwt_menuItem .zwt_menuItem-label-separator {}
.zwt_menuItem .zwt_menuItem-label-submenu {}
.zwt_menuItem .zwt_menuItem-label-disabled {}
.zwt_menuItem .zwt_menuItem-label .zwt_menuItem-label-content {}
.zwt_menuItem .zwt_menuItem-label .zwt_menuItem-label-bg1 {}
.zwt_menuItem .zwt_menuItem-label .zwt_menuItem-label-bg2 {}

Defined in: MenuItem.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Construct a menu item.
Method Summary
Method Attributes Method Name and Description
 
deselect(boolean_close)
Deselect this menu item.
 
draw()
Menu item doesn't need to be drawn as a result this method does nothing.
 
Return the click event manager attached to the menu item.
 
Return the HTML text of the item.
 
Return the mouse event manager attached to the menu item.
 
Return the item's sub menu.
 
Return the text of the item.
 
Determine whether this menu item is disabled.
 
Determine whether this item is a separator.
 
processClickEvent(zwt_event_ClickEvent_event)
Process the specified click event.
 
processEvent(zwt_event_Event_event)
Process the specified event.
 
processMouseEvent(zwt_event_MouseEvent_event)
Process the specified mouse event.
 
select(boolean_open)
Select this menu item.
 
setDisabled(boolean_disabled)
Disable or enable the menu item.
 
setHTML(string_html)
Set the HTML text of the item.
 
setSeparator(boolean_separator)
Set the item as a menu separator.
 
setSubMenu(zwt_ui_menu_Menu_menu)
Set the item's sub menu.
 
setText(string_text)
Set the text of the item.
Methods borrowed from class zwt.ui.Widget:
addStyle, getContextFill, getDimension, getElement, getElementDimension, getFill, getFocusEventManager, getId, getKeyboardEventManager, getParent, getRelativeLeft, getRelativeTop, getStyle, getWheelEventManager, hasFocus, hasStyle, isFocusable, isVisible, onEvent, processContentEvent, processFocusEvent, processKeyboardEvent, processWheelEvent, redraw, removeStyle, replaceStyle, setFill, setFocusable, setId, setStyle, setVisible
Class Detail
zwt.ui.menu.MenuItem()
Construct a menu item.
Author: Jeremy KUHN.
See:
zwt.ui.menu.Menu
Method Detail
deselect(boolean_close)
Deselect this menu item.
Parameters:
{Boolean} boolean_close
Close or not the sub menu if this item has a sub menu

draw()
Menu item doesn't need to be drawn as a result this method does nothing.

{zwt.event.ClickEventManager} getClickEventManager()
Return the click event manager attached to the menu item.
Returns:
The click event manager

{String} getHTML()
Return the HTML text of the item.
Returns:
The HTML text of the item

{zwt.event.MouseEventManager} getMouseEventManager()
Return the mouse event manager attached to the menu item.
Returns:
The mouse event manager

{zwt.ui.menu.Menu} getSubMenu()
Return the item's sub menu.
Returns:
The sub menu

{String} getText()
Return the text of the item.
Returns:
The text of the item

{Boolean} isDisabled()
Determine whether this menu item is disabled. A disabled item can't respond to user input and generate events. The item is enabled initially by default.
Returns:
true if the item is disabled, false otherwise

{Boolean} isSeparator()
Determine whether this item is a separator.
Returns:
true if the item is a separator, false otherwise

processClickEvent(zwt_event_ClickEvent_event)
Process the specified click event.
Parameters:
{zwt.event.ClickEvent} zwt_event_ClickEvent_event
The click event to process

processEvent(zwt_event_Event_event)
Process the specified event.
Parameters:
{zwt.event.Event} zwt_event_Event_event
The event to process

processMouseEvent(zwt_event_MouseEvent_event)
Process the specified mouse event.
Parameters:
{zwt.event.MouseEvent} zwt_event_MouseEvent_event
The mouse event to process

select(boolean_open)
Select this menu item.
Parameters:
{Boolean} boolean_open
Open or not the sub menu if this item has a sub menu

setDisabled(boolean_disabled)
Disable or enable the menu item.
Parameters:
{Boolean} boolean_disabled
true to disable the item, otherwise false

setHTML(string_html)
Set the HTML text of the item.
Parameters:
{String} string_html
The HTML text to set

setSeparator(boolean_separator)
Set the item as a menu separator.
Parameters:
{Boolean} boolean_separator
true to set this item as a sub menu, false otherwise

setSubMenu(zwt_ui_menu_Menu_menu)
Set the item's sub menu.
Parameters:
{zwt.ui.menu.Menu} zwt_ui_menu_Menu_menu
The sub menu to set

setText(string_text)
Set the text of the item.
Parameters:
{String} string_text
The text to set

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Nov 09 2011 19:29:08 GMT+0100 (CET)