public class MenuItem extends Item implements HasSafeHtml, HasHTML, HasIcon
Item
by adding menu-specific activation and click
handling.Modifier and Type | Class and Description |
---|---|
static interface |
MenuItem.MenuItemAppearance |
Item.ItemAppearance
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
DEBUG_ID_PREFIX
Constructor and Description |
---|
MenuItem()
Creates a new item.
|
MenuItem(MenuItem.MenuItemAppearance menuItemAppearance)
Creates a menu item with the given appearances.
|
MenuItem(String text)
Creates a new item with the given text.
|
MenuItem(String text,
ImageResource icon)
Creates a new item.
|
MenuItem(String text,
SelectionHandler<MenuItem> handler)
Creates a new item.
|
Modifier and Type | Method and Description |
---|---|
void |
expandMenu()
Expands the item's sub menu.
|
MenuItem.MenuItemAppearance |
getAppearance() |
String |
getHTML() |
ImageResource |
getIcon()
Returns the item's icon style.
|
Menu |
getSubMenu()
Returns the item's sub menu.
|
String |
getText()
Returns the item's text.
|
void |
setHTML(SafeHtml html) |
void |
setHTML(String html) |
void |
setIcon(ImageResource icon)
Sets the icon.
|
void |
setSubMenu(Menu menu)
Sets the item's sub menu.
|
void |
setText(String text)
Sets the item's text.
|
void |
setWidget(Widget widget) |
addActivateHandler, addBeforeSelectionHandler, addDeactivateHandler, addSelectionHandler, getHideOnClick, isCanActivate, setCanActivate, setHideOnClick
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disable, disableEvents, enable, enableEvents, fireEvent, focus, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getShadowPosition, getStateId, getTabIndex, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, onBrowserEvent, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setShadowPosition, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
fireEvent
public MenuItem()
public MenuItem(MenuItem.MenuItemAppearance menuItemAppearance)
menuItemAppearance
- the menu item appearancepublic MenuItem(String text)
text
- the item's textpublic MenuItem(String text, ImageResource icon)
text
- the item's texticon
- the item's iconpublic MenuItem(String text, SelectionHandler<MenuItem> handler)
text
- the item texthandler
- the selection handlerpublic void expandMenu()
public MenuItem.MenuItemAppearance getAppearance()
getAppearance
in class Item
public ImageResource getIcon()
public Menu getSubMenu()
public String getText()
public void setHTML(SafeHtml html)
setHTML
in interface HasSafeHtml
public void setIcon(ImageResource icon)
HasIcon
@UiChild(limit=1, tagname="submenu") public void setSubMenu(Menu menu)
menu
- the sub menupublic void setText(String text)
public void setWidget(Widget widget)
Copyright © 2015. All rights reserved.