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.ItemAppearanceUIObject.DebugIdImpl, UIObject.DebugIdImplEnabledDEBUG_ID_PREFIX| Constructor and Description |
|---|
MenuItem()
Creates a new item.
|
MenuItem(MenuItem.MenuItemAppearance appearance)
Creates a menu item with the given appearance.
|
MenuItem(MenuItem.MenuItemAppearance menuItemAppearance,
Item.ItemAppearance itemAppearance)
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.
|
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, setHideOnClickaddBeforeHideHandler, 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, getStateId, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, onBrowserEvent, removeHandler, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmaskaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEventsequals, getClass, hashCode, notify, notifyAll, wait, wait, waitfireEventpublic MenuItem()
public MenuItem(MenuItem.MenuItemAppearance appearance)
appearance - the menu item appearancepublic MenuItem(MenuItem.MenuItemAppearance menuItemAppearance, Item.ItemAppearance itemAppearance)
menuItemAppearance - the menu item appearanceitemAppearance - the underlying base 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 ImageResource getIcon()
public Menu getSubMenu()
public String getText()
public void setHTML(SafeHtml html)
setHTML in interface HasSafeHtmlpublic 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 © 2012. All Rights Reserved.