|
|||||||||
| 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.Widget
com.extjs.gxt.ui.client.widget.Component
com.extjs.gxt.ui.client.widget.BoxComponent
com.extjs.gxt.ui.client.widget.Container<Component>
com.extjs.gxt.ui.client.widget.menu.Menu
public class Menu
A menu component.
BaseEvent.setCancelled(boolean).BaseEvent.setCancelled(boolean).BaseEvent.setCancelled(boolean).BaseEvent.setCancelled(boolean).
| 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 | |
|---|---|
protected Item |
activeItem
|
protected BaseEventPreview |
eventPreview
|
protected KeyNav<ComponentEvent> |
keyNav
|
protected Item |
parentItem
|
protected boolean |
plain
|
protected boolean |
showSeparator
|
protected El |
ul
|
| Fields inherited from class com.extjs.gxt.ui.client.widget.Container |
|---|
attachChildren, enableLayout, layoutExecuted, layoutNeeded, layoutOnAttach, layoutOnChange |
| Fields inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
|---|
adjustSize, cacheSizes, ensureVisibilityOnSizing, height, lastSize, layer, shim, width |
| Fields inherited from class com.extjs.gxt.ui.client.widget.Component |
|---|
afterRender, attachables, baseStyle, disabled, disabledStyle, disableTextSelection, dummy, focusable, hidden, mask, maskMessage, maskMessageStyleName, monitorWindowResize, rendered, resizeHandler, setElementRender, stateId, swallowEvents, toolTip, windowResizeDelay, windowResizeTask |
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
Menu()
Creates a new menu. |
|
| Method Summary | |
|---|---|
boolean |
add(Component item)
Adds a item to the menu. |
protected void |
afterRender()
Called after the component has been rendered and is attached for the first time. |
protected void |
constrainScroll(int y)
|
protected ComponentEvent |
createComponentEvent(com.google.gwt.user.client.Event event)
|
protected ContainerEvent<Menu,Component> |
createContainerEvent(Component item)
|
protected void |
createScrollers()
|
protected void |
deactiveActiveItem()
|
protected void |
doAutoSize()
|
java.lang.String |
getDefaultAlign()
Returns the default alignment. |
El |
getLayoutTarget()
Returns the container's layout target. |
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. |
java.lang.String |
getSubMenuAlign()
Returns the sub menu alignment. |
void |
hide()
Hides the menu. |
Menu |
hide(boolean deep)
Hides this menu and optionally all parent menus |
boolean |
insert(Component item,
int index)
Inserts an item into the menu. |
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()
Returns true if the component is visible. |
protected boolean |
onAutoHide(PreviewEvent pe)
|
protected void |
onClick(ComponentEvent ce)
|
void |
onComponentEvent(ComponentEvent ce)
Any events a component receives will be forwarded to this method. |
protected void |
onDetach()
|
protected void |
onEscape(PreviewEvent pe)
|
protected void |
onHide()
|
protected void |
onInsert(Component item,
int index)
|
protected void |
onKeyDown(ComponentEvent ce)
|
protected void |
onKeyUp(ComponentEvent ce)
|
protected void |
onLayoutExcecuted(Layout layout)
|
protected void |
onMouseMove(ComponentEvent ce)
|
protected void |
onMouseOut(ComponentEvent ce)
|
protected void |
onMouseOver(ComponentEvent ce)
|
protected void |
onRemove(Component item)
|
protected void |
onRender(com.google.gwt.user.client.Element target,
int index)
Subclasses must override and ensure setElement is called for lazy rendered components. |
protected void |
onScroll(ClickRepeaterEvent ce)
|
protected void |
onScrollerIn(El t)
|
protected void |
onScrollerOut(El t)
|
protected void |
onWindowResize(int width,
int height)
|
boolean |
remove(Component item)
Removes a item from the menu. |
protected void |
scrollMenu(boolean top)
|
void |
setActiveItem(Component c,
boolean autoExpand)
Sets the active item. |
void |
setConstrainViewport(boolean constrainViewport)
Sets whether the menu should be constrained to the viewport when shown. |
void |
setDefaultAlign(java.lang.String defaultAlign)
Sets the default El.alignTo(com.google.gwt.user.client.Element, java.lang.String, 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(java.lang.String subMenuAlign)
The El.alignTo(com.google.gwt.user.client.Element, java.lang.String, int[]) anchor position value to use for submenus of this
menu (defaults to "tl-tr-?"). |
void |
show(com.google.gwt.user.client.Element elem,
java.lang.String pos)
Displays this menu relative to another element. |
void |
show(com.google.gwt.user.client.Element elem,
java.lang.String pos,
int[] offsets)
Displays this menu relative to another element. |
void |
show(com.google.gwt.user.client.ui.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. |
protected Item |
tryActivate(int start,
int step)
|
| Methods inherited from class com.extjs.gxt.ui.client.widget.Container |
|---|
adjustIndex, adopt, disable, doAttachChildren, doDetachChildren, doLayout, doLayout, enable, findItem, getItem, getItemByItemId, getItemCount, getItems, getLayout, getWidget, indexOf, isLayoutNeeded, iterator, layout, layout, notifyHide, notifyShow, onAfterLayout, onAttach, onBeforeLayoutExcecuted, orphan, remove, removeAll, removeAll, scrollIntoView, setLayout, setLayoutNeeded, setLayoutOnChange, wrapWidget |
| Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
|---|
adjustPosition, adjustSize, getBounds, getHeight, getHeight, getPosition, getPositionEl, getResizeEl, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, hideShadow, hideShim, hideUnders, isAutoHeight, isAutoWidth, isDeferHeight, isShim, onPosition, onResize, onShow, onUnload, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, setLayoutData |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, resolvePotentialElement, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected KeyNav<ComponentEvent> keyNav
protected Item parentItem
protected BaseEventPreview eventPreview
protected boolean plain
protected boolean showSeparator
protected El ul
protected Item activeItem
| Constructor Detail |
|---|
public Menu()
| Method Detail |
|---|
public boolean add(Component item)
add in class Container<Component>item - the new itempublic java.lang.String getDefaultAlign()
public El getLayoutTarget()
Container
getLayoutTarget in class Container<Component>public int getMaxHeight()
public int getMinWidth()
public Item getParentItem()
public java.lang.String getSubMenuAlign()
public void hide()
hide in class Componentpublic Menu hide(boolean deep)
deep - true to close all parent menus
public boolean insert(Component item,
int index)
insert in class Container<Component>item - the item to insertindex - the insert locationpublic boolean isConstrainViewport()
public boolean isEnableScrolling()
public boolean isFocusOnShow()
public boolean isVisible()
Componenttrue if the component is visible.
isVisible in interface com.google.gwt.user.client.ui.HasVisibilityisVisible in class Componentpublic void onComponentEvent(ComponentEvent ce)
ComponentComponent.onBrowserEvent(com.google.gwt.user.client.Event) method
should not be overridden or modified.
onComponentEvent in class Componentce - the base eventpublic boolean remove(Component item)
remove in class Container<Component>item - the menu to remove
true if the item was removed
public void setActiveItem(Component c,
boolean autoExpand)
Item to be
activated. All other types are ignored.
c - the component to set activeautoExpand - true to auto expand the itempublic void setConstrainViewport(boolean constrainViewport)
showAt(int, int).
constrainViewport - true to constrainpublic void setDefaultAlign(java.lang.String defaultAlign)
El.alignTo(com.google.gwt.user.client.Element, java.lang.String, 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 min widthpublic void setSubMenuAlign(java.lang.String subMenuAlign)
El.alignTo(com.google.gwt.user.client.Element, java.lang.String, int[]) anchor position value to use for submenus of this
menu (defaults to "tl-tr-?").
subMenuAlign - the sub alignment
public void show(com.google.gwt.user.client.Element elem,
java.lang.String pos)
elem - the element to align topos - the El.alignTo(com.google.gwt.user.client.Element, java.lang.String, int[]) anchor position to use in aligning to the
element (defaults to defaultAlign)
public void show(com.google.gwt.user.client.Element elem,
java.lang.String pos,
int[] offsets)
elem - the element to align topos - the El.alignTo(com.google.gwt.user.client.Element, java.lang.String, int[]) anchor position to use in aligning to the
element (defaults to defaultAlign)offsets - the menu align offsetspublic void show(com.google.gwt.user.client.ui.Widget widget)
widget - the align widget
public void showAt(int x,
int y)
x - the x coordinatey - the y coordinateprotected void afterRender()
Component
afterRender in class BoxComponentprotected void constrainScroll(int y)
protected ComponentEvent createComponentEvent(com.google.gwt.user.client.Event event)
createComponentEvent in class BoxComponentprotected ContainerEvent<Menu,Component> createContainerEvent(Component item)
createContainerEvent in class Container<Component>protected void createScrollers()
protected void deactiveActiveItem()
protected void doAutoSize()
protected boolean onAutoHide(PreviewEvent pe)
protected void onClick(ComponentEvent ce)
protected void onDetach()
onDetach in class Componentprotected void onEscape(PreviewEvent pe)
protected void onHide()
onHide in class BoxComponent
protected void onInsert(Component item,
int index)
onInsert in class Container<Component>protected void onKeyDown(ComponentEvent ce)
protected void onKeyUp(ComponentEvent ce)
protected void onLayoutExcecuted(Layout layout)
onLayoutExcecuted in class Container<Component>protected void onMouseMove(ComponentEvent ce)
protected void onMouseOut(ComponentEvent ce)
protected void onMouseOver(ComponentEvent ce)
protected void onRemove(Component item)
onRemove in class Container<Component>
protected void onRender(com.google.gwt.user.client.Element target,
int index)
Component
onRender in class Componenttarget - the target elementindex - the insert locationprotected void onScroll(ClickRepeaterEvent ce)
protected void onScrollerIn(El t)
protected void onScrollerOut(El t)
protected void onWindowResize(int width,
int height)
onWindowResize in class Componentprotected void scrollMenu(boolean top)
protected Item tryActivate(int start,
int step)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||