|
|||||||||
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.menu.Item
com.extjs.gxt.ui.client.widget.menu.AdapterMenuItem
public class AdapterMenuItem
Allows any widget to be placed in a menu. As of 2.0, any component can be added directly to a Menu therefore reducing the need for this class. AdapterMenuItem allows arbitrary widgets to be added to Menu and also configured as Items.
For example, when adding a ComboBox to a Menu, the Menu will be closed when a item from the combo drop down list is clicked if the combo is added directly to the Menu. To stop the menu from being closed, an AdapterMenuItem can be used so that @linkItem.setHideOnClick(boolean)
can be called.
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 boolean |
manageFocus
|
protected com.google.gwt.user.client.ui.Widget |
widget
The wrapped widget. |
Fields inherited from class com.extjs.gxt.ui.client.widget.menu.Item |
---|
canActivate, hideOnClick, parentMenu |
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 | |
---|---|
AdapterMenuItem(com.google.gwt.user.client.ui.Widget widget)
Creates a new adapter. |
Method Summary | |
---|---|
com.google.gwt.user.client.Element |
getElement()
|
com.google.gwt.user.client.ui.Widget |
getWidget()
Returns the wrapped widget. |
boolean |
isAttached()
|
boolean |
isManageFocus()
Returns true if the adapter manages focus for the wrapped widget. |
boolean |
isNeedsIndent()
Returns true if the widget will be indented. |
protected void |
onAttach()
|
void |
onBrowserEvent(com.google.gwt.user.client.Event event)
Components delegate event handling to Component.onComponentEvent(ComponentEvent) . |
protected void |
onClick(ComponentEvent be)
|
protected void |
onDetach()
|
protected void |
onDisable()
|
protected void |
onEnable()
|
protected boolean |
onEscape()
|
protected void |
onRender(com.google.gwt.user.client.Element target,
int index)
Subclasses must override and ensure setElement is called for lazy rendered components. |
void |
setManageFocus(boolean manageFocus)
True to move focus to wrapped widget when the enter key is pressed and remove focus of wrapped widget when escape is pressed (defaults to false). |
void |
setNeedsIndent(boolean needsIndent)
True to indent the widget to account for the icon space (defaults to true). |
Methods inherited from class com.extjs.gxt.ui.client.widget.menu.Item |
---|
activate, addSelectionListener, deactivate, expandMenu, getActiveStyle, getHideOnClick, getParentMenu, handleClick, isCanActivate, removeSelectionListener, setActiveStyle, setCanActivate, setHideOnClick, shouldDeactivate |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onUnload, 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, 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 com.google.gwt.user.client.ui.Widget widget
protected boolean manageFocus
Constructor Detail |
---|
public AdapterMenuItem(com.google.gwt.user.client.ui.Widget widget)
widget
- the widget to be adaptedMethod Detail |
---|
public com.google.gwt.user.client.Element getElement()
getElement
in class Component
public com.google.gwt.user.client.ui.Widget getWidget()
public boolean isAttached()
isAttached
in class com.google.gwt.user.client.ui.Widget
public boolean isNeedsIndent()
public void onBrowserEvent(com.google.gwt.user.client.Event event)
Component
Component.onComponentEvent(ComponentEvent)
. Subclasses should not override.
onBrowserEvent
in interface com.google.gwt.user.client.EventListener
onBrowserEvent
in class Component
event
- the dom eventpublic void setNeedsIndent(boolean needsIndent)
needsIndent
- true to indentprotected void onAttach()
onAttach
in class Component
protected void onClick(ComponentEvent be)
onClick
in class Item
protected void onDetach()
onDetach
in class Component
protected void onDisable()
onDisable
in class Item
public boolean isManageFocus()
public void setManageFocus(boolean manageFocus)
manageFocus
- true to manage focusprotected void onEnable()
onEnable
in class Item
protected boolean onEscape()
onEscape
in class Item
protected void onRender(com.google.gwt.user.client.Element target, int index)
Component
onRender
in class Component
target
- the target elementindex
- the insert location
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |