public class Menu extends InsertContainer implements HasBeforeSelectionHandlers<Item>, HasSelectionHandlers<Item>
| Modifier and Type | Class and Description |
|---|---|
static interface |
Menu.MenuAppearance |
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabledInsertPanel.ForIsWidgetHasWidgets.ForIsWidgetDEBUG_ID_PREFIX| Constructor and Description |
|---|
Menu() |
Menu(Menu.MenuAppearance appearance) |
| Modifier and Type | Method and Description |
|---|---|
HandlerRegistration |
addBeforeSelectionHandler(BeforeSelectionHandler<Item> handler) |
HandlerRegistration |
addSelectionHandler(SelectionHandler<Item> handler) |
String |
getDefaultAlign()
Returns the default alignment.
|
int |
getMaxHeight()
Returns the max height of the menu or -1 if not set.
|
int |
getMinWidth()
Returns the menu's minimum width.
|
Item |
getParentItem()
Returns the menu's parent item.
|
String |
getSubMenuAlign()
Returns the sub menu alignment.
|
void |
hide()
Hides the menu.
|
void |
hide(boolean deep)
Hides this menu and optionally all parent menus
|
boolean |
isConstrainViewport()
Returns true if constrain to viewport is enabled.
|
boolean |
isEnableScrolling()
Returns true if vertical scrolling is enabled.
|
boolean |
isFocusOnShow()
Returns true if the menu will be focused when displayed.
|
boolean |
isVisible() |
void |
onBrowserEvent(Event event) |
void |
setActiveItem(Widget widget,
boolean autoExpand)
Sets the active item.
|
void |
setConstrainViewport(boolean constrainViewport)
Sets whether the menu should be constrained to the viewport when shown.
|
void |
setDefaultAlign(String defaultAlign)
Sets the default
XElement.alignTo(com.google.gwt.dom.client.Element, com.sencha.gxt.core.client.Style.AnchorAlignment, int[]) anchor position value for this
menu relative to its element of origin (defaults to "tl-bl?"). |
void |
setEnableScrolling(boolean enableScrolling)
True to enable vertical scrolling of the children in the menu (defaults to
true).
|
void |
setFocusOnShow(boolean focusOnShow)
True to set the focus on the menu when it is displayed.
|
void |
setMaxHeight(int maxHeight)
Sets the max height of the menu (defaults to -1).
|
void |
setMinWidth(int minWidth)
Sets he minimum width of the menu in pixels (defaults to 120).
|
void |
setSubMenuAlign(String subMenuAlign)
The
XElement.alignTo(com.google.gwt.dom.client.Element, com.sencha.gxt.core.client.Style.AnchorAlignment, int[]) anchor position value to use for submenus of
this menu (defaults to "tl-tr-?"). |
void |
show(Element elem,
Style.AnchorAlignment alignment)
Displays this menu relative to another element.
|
void |
show(Element elem,
Style.AnchorAlignment alignment,
int[] offsets)
Displays this menu relative to another element.
|
void |
show(Widget widget)
Displays this menu relative to the widget using the default alignment.
|
void |
showAt(int x,
int y)
Displays this menu at a specific xy position.
|
insert, insertadd, add, addAddHandler, addBeforeAddHandler, addBeforeRemoveHandler, addContainerHandler, addRemoveHandler, clear, findWidget, getItemByItemId, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, iterator, remove, remove, removeaddBeforeHideHandler, 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, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, mask, mask, 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, waitfireEventaddaddgetWidgetIndexgetWidget, getWidgetCount, getWidgetIndex, removepublic Menu()
public Menu(Menu.MenuAppearance appearance)
public HandlerRegistration addBeforeSelectionHandler(BeforeSelectionHandler<Item> handler)
addBeforeSelectionHandler in interface HasBeforeSelectionHandlers<Item>public HandlerRegistration addSelectionHandler(SelectionHandler<Item> handler)
addSelectionHandler in interface HasSelectionHandlers<Item>public String getDefaultAlign()
public int getMaxHeight()
public int getMinWidth()
public Item getParentItem()
public String getSubMenuAlign()
public void hide(boolean deep)
deep - true to close all parent menuspublic boolean isConstrainViewport()
public boolean isEnableScrolling()
public boolean isFocusOnShow()
public boolean isVisible()
isVisible in interface HasVisibilityisVisible in class Componentpublic void onBrowserEvent(Event event)
onBrowserEvent in interface EventListeneronBrowserEvent in class Componentpublic void setActiveItem(Widget widget, boolean autoExpand)
Item to be
activated. All other types are ignored.widget - the widget to set activeautoExpand - true to auto expand the itempublic void setConstrainViewport(boolean constrainViewport)
showAt(int, int).constrainViewport - true to constrainpublic void setDefaultAlign(String defaultAlign)
XElement.alignTo(com.google.gwt.dom.client.Element, com.sencha.gxt.core.client.Style.AnchorAlignment, int[]) anchor position value for this
menu relative to its element of origin (defaults to "tl-bl?").defaultAlign - the default alignpublic void setEnableScrolling(boolean enableScrolling)
enableScrolling - true to for scrollingpublic void setFocusOnShow(boolean focusOnShow)
focusOnShow - true to focuspublic void setMaxHeight(int maxHeight)
setEnableScrolling(boolean) is set to true.maxHeight - the max heightpublic void setMinWidth(int minWidth)
minWidth - the minimum widthpublic void setSubMenuAlign(String subMenuAlign)
XElement.alignTo(com.google.gwt.dom.client.Element, com.sencha.gxt.core.client.Style.AnchorAlignment, int[]) anchor position value to use for submenus of
this menu (defaults to "tl-tr-?").subMenuAlign - the sub alignmentpublic void show(Element elem, Style.AnchorAlignment alignment)
elem - the element to align toalignment - the XElement.alignTo(com.google.gwt.dom.client.Element, com.sencha.gxt.core.client.Style.AnchorAlignment, int[]) anchor position to use in
aligning to the element (defaults to defaultAlign)public void show(Element elem, Style.AnchorAlignment alignment, int[] offsets)
elem - the element to align toalignment - the XElement.alignTo(com.google.gwt.dom.client.Element, com.sencha.gxt.core.client.Style.AnchorAlignment, int[]) anchor position to use in
aligning to the element (defaults to defaultAlign)offsets - the menu align offsetspublic void show(Widget widget)
widget - the align widgetpublic void showAt(int x,
int y)
x - the x coordinatey - the y coordinateCopyright © 2012. All Rights Reserved.