|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.MenuItem
A widget that can be placed in a MenuBar
.
Menu items can either fire a Command
when
they are clicked, or open a cascading sub-menu.
Field Summary |
Fields inherited from class java.lang.Object |
typeId, typeName |
Constructor Summary | |
MenuItem(String text,
boolean asHTML,
Command cmd)
Constructs a new menu item that fires a command when it is selected. |
|
MenuItem(String text,
boolean asHTML,
MenuBar subMenu)
Constructs a new menu item that cascades to a sub-menu when it is selected. |
|
MenuItem(String text,
Command cmd)
Constructs a new menu item that fires a command when it is selected. |
|
MenuItem(String text,
MenuBar subMenu)
Constructs a new menu item that cascades to a sub-menu when it is selected. |
Method Summary | |
Command |
getCommand()
Gets the command associated with this item. |
String |
getHTML()
Gets this object's contents as HTML. |
MenuBar |
getParentMenu()
Gets the menu that contains this item. |
MenuBar |
getSubMenu()
Gets the sub-menu associated with this item. |
String |
getText()
Gets this object's text. |
void |
setCommand(Command cmd)
Sets the command associated with this item. |
void |
setHTML(String html)
Sets this object's contents via HTML. |
void |
setSubMenu(MenuBar subMenu)
Sets the sub-menu associated with this item. |
void |
setText(String text)
Sets this object's text. |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
equals, finalize, hashCode |
Constructor Detail |
public MenuItem(String text, Command cmd)
text
- the item's textcmd
- the command to be fired when it is selectedpublic MenuItem(String text, boolean asHTML, Command cmd)
text
- the item's textasHTML
- true
to treat the specified text as htmlcmd
- the command to be fired when it is selectedpublic MenuItem(String text, MenuBar subMenu)
text
- the item's textsubMenu
- the sub-menu to be displayed when it is selectedpublic MenuItem(String text, boolean asHTML, MenuBar subMenu)
text
- the item's textasHTML
- true
to treat the specified text as htmlsubMenu
- the sub-menu to be displayed when it is selectedMethod Detail |
public Command getCommand()
null
if none existspublic String getHTML()
HasHTML
getHTML
in interface HasHTML
public MenuBar getParentMenu()
null
if none exists.public MenuBar getSubMenu()
null
if none existspublic String getText()
HasText
getText
in interface HasText
public void setCommand(Command cmd)
cmd
- the command to be associated with this itempublic void setHTML(String html)
HasHTML
HasText.setText(java.lang.String)
whenever possible.
setHTML
in interface HasHTML
html
- the object's new HTMLpublic void setSubMenu(MenuBar subMenu)
subMenu
- this item's new sub-menupublic void setText(String text)
HasText
setText
in interface HasText
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |