|
||||||||||
| 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:
| 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(java.lang.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(java.lang.String text,
boolean asHTML,
MenuBar subMenu)
Constructs a new menu item that cascades to a sub-menu when it is selected. |
|
MenuItem(java.lang.String text,
com.google.gwt.user.client.Command cmd)
Constructs a new menu item that fires a command when it is selected. |
|
MenuItem(java.lang.String text,
MenuBar subMenu)
Constructs a new menu item that cascades to a sub-menu when it is selected. |
|
| Method Summary | |
|---|---|
void |
addMenuListener(MenuListener listener)
Start notifying the given listener of the menu events generated by this object. |
void |
addStyleDependentName(java.lang.String styleSuffix)
|
com.google.gwt.user.client.Command |
getCommand()
|
java.lang.String |
getHTML()
|
Element |
getIcon()
|
com.google.gwt.user.client.ui.MenuBar |
getSubMenu()
|
java.lang.String |
getText()
|
boolean |
isEnabled()
|
void |
removeMenuListener(MenuListener listener)
Stop notifying the given listener of the menu events generated by this object. |
void |
setEnabled(boolean enabled)
Disables or enables this menu item. |
void |
setHTML(java.lang.String html)
|
void |
setIcon(com.google.gwt.user.client.ui.AbstractImagePrototype.ImagePrototypeElement icon)
Sets the icon of this menu item using the element created from an AbstractImagePrototype. |
void |
setIcon(Element icon)
Sets the icon of this menu item. |
void |
setText(java.lang.String text)
|
void |
xSetSelectionStyle(boolean selected)
Visually marks this menu item as selected or unselected based on the given argument. NOTE: This is just a hack required because #setSelectionStyle(boolean) is private. |
| Methods inherited from class com.google.gwt.user.client.ui.MenuItem |
|---|
getParentMenu, onEnsureDebugId, setCommand, setSubMenu |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MenuItem(java.lang.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(java.lang.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(java.lang.String text,
MenuBar subMenu)
text - the item's textsubMenu - the sub-menu to be displayed when it is selected
public MenuItem(java.lang.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 selected| Method Detail |
|---|
public void setEnabled(boolean enabled)
enabled - true to enable this menu item, false to disable itpublic boolean isEnabled()
true if this menu item is enabled, false otherwisepublic void setIcon(com.google.gwt.user.client.ui.AbstractImagePrototype.ImagePrototypeElement 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(java.lang.String html)
setHTML in interface com.google.gwt.user.client.ui.HasHTMLsetHTML in class com.google.gwt.user.client.ui.MenuItemMenuItem.setHTML(String)public java.lang.String getHTML()
getHTML in interface com.google.gwt.user.client.ui.HasHTMLgetHTML in class com.google.gwt.user.client.ui.MenuItemMenuItem.getHTML()public void setText(java.lang.String text)
setText in interface com.google.gwt.user.client.ui.HasTextsetText in class com.google.gwt.user.client.ui.MenuItemMenuItem.setText(String)public java.lang.String getText()
getText in interface com.google.gwt.user.client.ui.HasTextgetText in class com.google.gwt.user.client.ui.MenuItemMenuItem.getText()public com.google.gwt.user.client.Command getCommand()
getCommand in class com.google.gwt.user.client.ui.MenuItemMenuItem.getCommand()public com.google.gwt.user.client.ui.MenuBar getSubMenu()
getSubMenu in class com.google.gwt.user.client.ui.MenuItemMenuItem.getSubMenu()public void addStyleDependentName(java.lang.String styleSuffix)
addStyleDependentName in class com.google.gwt.user.client.ui.UIObjectUIObject.addStyleDependentName(String)public void xSetSelectionStyle(boolean selected)
selected - true to select this menu item, false to remove the selectionpublic void addMenuListener(MenuListener listener)
addMenuListener in interface SourcesMenuEventslistener - the listener to be added to the list of menu listeners that are notified by this objectSourcesMenuEvents.addMenuListener(MenuListener)public void removeMenuListener(MenuListener listener)
removeMenuListener in interface SourcesMenuEventslistener - the listener to be removed from the list of menu listeners that are notified by this objectSourcesMenuEvents.removeMenuListener(MenuListener)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||