com.extjs.gxt.ui.client.widget.menu
Class Item

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.menu.Item
All Implemented Interfaces:
Observable, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.IsWidget
Direct Known Subclasses:
AdapterMenuItem, HeaderMenuItem, MenuItem, SeparatorMenuItem

public abstract class Item
extends Component

The base class for all items that render into menus. BaseItem provides default rendering, activated state management.


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 canActivate
          True if this item can be visually activated (defaults to false).
protected  boolean hideOnClick
          True to hide the containing menu after this item is clicked (defaults to true).
protected  Menu parentMenu
          The item's containing menu.
 
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
Item()
           
 
Method Summary
protected  void activate(boolean autoExpand)
           
 void addSelectionListener(SelectionListener<? extends MenuEvent> listener)
          Adds a selection listener.
protected  void deactivate()
           
protected  void expandMenu(boolean autoActivate)
           
 java.lang.String getActiveStyle()
          Returns the active style.
 boolean getHideOnClick()
          Returns the hide on click state.
 Menu getParentMenu()
          Returns the item's containing menu.
protected  void handleClick(ComponentEvent be)
           
 boolean isCanActivate()
          Returns true if the component can be activated.
protected  void onClick(ComponentEvent be)
           
protected  void onDisable()
           
protected  void onEnable()
           
protected  boolean onEscape()
           
 void removeSelectionListener(SelectionListener<? extends ComponentEvent> listener)
          Removes a previously added listener.
 void setActiveStyle(java.lang.String activeStyle)
          The CSS class to use when the item becomes activated (defaults to "x-menu-item-active").
 void setCanActivate(boolean canActivate)
          Sets whether the item can be activated (defaults to false).
 void setHideOnClick(boolean hideOnClick)
          True to hide the containing menu after this item is clicked (defaults to true).
protected  boolean shouldDeactivate(ComponentEvent ce)
           
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addAttachable, addListener, addPlugin, addStyleName, addStyleOnOver, addWidgetListener, afterRender, applyState, assertAfterRender, assertPreRender, beforeRender, blur, clearState, createComponentEvent, createObservable, createStyles, disable, disableContextMenu, disableEvents, disableTextSelection, doAttachChildren, doDetachChildren, el, enable, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, frame, getAriaSupport, getBaseStyle, getBorders, getContextMenu, getData, getElement, getFocusEl, getFocusSupport, getHideMode, getId, getItemId, getListeners, getModel, getObservable, getPlugins, getState, getStateId, getTabIndex, getTitle, getToolTip, getWindowResizeDelay, hasListeners, hasListeners, hide, hideToolTip, initState, isDisabledEvents, isDisableTextSelection, isEnabled, isMasked, isMonitorWindowResize, isRendered, isStateful, isVisible, isVisible, mask, mask, mask, notifyHide, notifyShow, onAttach, onBrowserEvent, onComponentEvent, onDetach, onDetachHelper, onEnsureDebugId, onHide, onHideContextMenu, onLoad, onRender, onRightClick, onShow, onShowContextMenu, onWindowResize, previewEvent, recalculate, removeAllListeners, removeAttachagle, removeFromParent, removeListener, removeStyleName, removeStyleOnOver, removeSwallow, removeToolTip, removeWidgetListener, render, render, repaint, saveState, setAriaRole, setAriaState, setAriaSupport, setBorders, setContextMenu, setData, setEl, setElement, setElement, setEnabled, setFiresEvents, setHeight, setHideMode, setId, setIntStyleAttribute, setItemId, setModel, setMonitorWindowResize, setParent, setPixelSize, setSize, setStateful, setStateId, setStyleAttribute, setStyleName, setTabIndex, setTitle, setToolTip, setToolTip, setVisible, setWidth, setWindowResizeDelay, setZIndex, show, sinkEvents, swallowEvent, swallowEvent, toString, unframe, unmask
 
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, 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

canActivate

protected boolean canActivate
True if this item can be visually activated (defaults to false).


hideOnClick

protected boolean hideOnClick
True to hide the containing menu after this item is clicked (defaults to true).


parentMenu

protected Menu parentMenu
The item's containing menu.

Constructor Detail

Item

public Item()
Method Detail

addSelectionListener

public void addSelectionListener(SelectionListener<? extends MenuEvent> listener)
Adds a selection listener.

Parameters:
listener - the listener to add

getActiveStyle

public java.lang.String getActiveStyle()
Returns the active style.

Returns:
the style

getHideOnClick

public boolean getHideOnClick()
Returns the hide on click state.

Returns:
the hide on click state

getParentMenu

public Menu getParentMenu()
Returns the item's containing menu.

Returns:
the menu

isCanActivate

public boolean isCanActivate()
Returns true if the component can be activated.

Returns:
true if can be activated

removeSelectionListener

public void removeSelectionListener(SelectionListener<? extends ComponentEvent> listener)
Removes a previously added listener.

Parameters:
listener - the listener to be removed

setActiveStyle

public void setActiveStyle(java.lang.String activeStyle)
The CSS class to use when the item becomes activated (defaults to "x-menu-item-active").

Parameters:
activeStyle - the active style

setCanActivate

public void setCanActivate(boolean canActivate)
Sets whether the item can be activated (defaults to false).

Parameters:
canActivate - true to activate

setHideOnClick

public void setHideOnClick(boolean hideOnClick)
True to hide the containing menu after this item is clicked (defaults to true).

Parameters:
hideOnClick - true to hide, otherwise false

activate

protected void activate(boolean autoExpand)

onEscape

protected boolean onEscape()

deactivate

protected void deactivate()

expandMenu

protected void expandMenu(boolean autoActivate)

handleClick

protected void handleClick(ComponentEvent be)

onClick

protected void onClick(ComponentEvent be)

onDisable

protected void onDisable()
Overrides:
onDisable in class Component

onEnable

protected void onEnable()
Overrides:
onEnable in class Component

shouldDeactivate

protected boolean shouldDeactivate(ComponentEvent ce)