public class MenuItem
extends com.google.gwt.user.client.ui.MenuItem
| Constructor and Description |
|---|
MenuItem(String text,
boolean asHTML,
com.google.gwt.user.client.Command cmd)
Constructs a new menu item that fires a command when it is selected.
|
MenuItem(String text,
boolean asHTML,
com.google.gwt.user.client.ui.MenuBar subMenu)
Constructs a new menu item that cascades to a sub-menu when it is selected.
|
MenuItem(String text,
com.google.gwt.user.client.Command cmd)
Constructs a new menu item that fires a command when it is selected.
|
MenuItem(String text,
com.google.gwt.user.client.ui.MenuBar subMenu)
Constructs a new menu item that cascades to a sub-menu when it is selected.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getHTML() |
Element |
getIcon() |
String |
getShortcutKeyLabel() |
String |
getText() |
void |
setHTML(String html) |
void |
setIcon(Element icon)
Sets the icon of this menu item.
|
void |
setIcon(com.google.gwt.resources.client.ImageResource icon)
Sets the icon of this menu item using the element created from an AbstractImagePrototype.
|
void |
setShortcutKeyLabel(String text)
Sets the text representing the shortcut key associated with this menu item.
|
void |
setText(String text) |
getCommand, getParentMenu, getScheduledCommand, getSubMenu, isEnabled, onEnsureDebugId, setCommand, setEnabled, setHTML, setScheduledCommand, setSelectionStyle, setSubMenuaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, sinkEvents, toString, unsinkEventspublic MenuItem(String text, com.google.gwt.user.client.Command cmd)
text - the item's textcmd - the command to be fired when it is selectedpublic MenuItem(String text, boolean asHTML, com.google.gwt.user.client.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, com.google.gwt.user.client.ui.MenuBar subMenu)
text - the item's textsubMenu - the sub-menu to be displayed when it is selectedpublic MenuItem(String text, boolean asHTML, com.google.gwt.user.client.ui.MenuBar subMenu)
text - the item's textasHTML - true to treat the specified text as htmlsubMenu - the sub-menu to be displayed when it is selectedpublic void setIcon(com.google.gwt.resources.client.ImageResource icon)
icon - the icon to be displayed on the left of this menu itempublic void setIcon(Element icon)
icon - the icon to be displayed on the left of this menu itempublic Element getIcon()
public void setHTML(String html)
setHTML in interface com.google.gwt.user.client.ui.HasHTMLsetHTML in class com.google.gwt.user.client.ui.MenuItempublic String getHTML()
getHTML in interface com.google.gwt.user.client.ui.HasHTMLgetHTML in class com.google.gwt.user.client.ui.MenuItempublic void setText(String text)
setText in interface com.google.gwt.user.client.ui.HasTextsetText in class com.google.gwt.user.client.ui.MenuItempublic String getText()
getText in interface com.google.gwt.user.client.ui.HasTextgetText in class com.google.gwt.user.client.ui.MenuItempublic void setShortcutKeyLabel(String text)
text - the text used to display the shortcut keypublic String getShortcutKeyLabel()
null if the shortcut key
label hasn't been setCopyright © 2004–2015 XWiki. All rights reserved.