|
||||||||||
| 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
org.xwiki.gwt.user.client.ui.MenuItem
public class MenuItem
Improves the default menu item widget provided by GWT with support for icon and shortcut key label.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class com.google.gwt.user.client.ui.MenuItem |
|---|
getCommand, getParentMenu, getScheduledCommand, getSubMenu, isEnabled, onEnsureDebugId, setCommand, setEnabled, setHTML, setScheduledCommand, setSelectionStyle, setSubMenu |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, 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, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MenuItem(String text,
com.google.gwt.user.client.Command cmd)
text - the item's textcmd - the command to be fired when it is selected
public 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 selected
public 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 selected
public 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 selected| Method Detail |
|---|
public 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 set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||