com.sencha.gxt.widget.core.client.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.sencha.gxt.widget.core.client.Component
              extended by com.sencha.gxt.widget.core.client.menu.Item
All Implemented Interfaces:
HasAttachHandlers, HasBeforeSelectionHandlers<Item>, HasResizeHandlers, HasSelectionHandlers<Item>, HasHandlers, EventListener, HasEnabled, HasVisibility, IsWidget, ActivateEvent.HasActivateHandlers<Item>, BeforeHideEvent.HasBeforeHideHandlers, BeforeShowContextMenuEvent.HasBeforeShowContextMenuHandler, BeforeShowEvent.HasBeforeShowHandlers, BlurEvent.HasBlurHandlers, DeactivateEvent.HasDeactivateHandlers<Item>, DisableEvent.HasDisableHandlers, EnableEvent.HasEnableHandlers, FocusEvent.HasFocusHandlers, HideEvent.HasHideHandlers, MoveEvent.HasMoveHandlers, ShowContextMenuEvent.HasShowContextMenuHandler, ShowEvent.HasShowHandlers, HasFocusSupport, HasItemId
Direct Known Subclasses:
AdapterMenuItem, HeaderMenuItem, MenuItem, SeparatorMenuItem

public abstract class Item
extends Component
implements HasSelectionHandlers<Item>, ActivateEvent.HasActivateHandlers<Item>, DeactivateEvent.HasDeactivateHandlers<Item>, HasBeforeSelectionHandlers<Item>

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


Nested Class Summary
static interface Item.ItemAppearance
           
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
Item()
           
Item(Item.ItemAppearance appearance)
           
 
Method Summary
 HandlerRegistration addActivateHandler(ActivateEvent.ActivateHandler<Item> handler)
          Adds a ActivateEvent handler.
 HandlerRegistration addBeforeSelectionHandler(BeforeSelectionHandler<Item> handler)
           
 HandlerRegistration addDeactivateHandler(DeactivateEvent.DeactivateHandler<Item> handler)
          Adds a DeactivateEvent handler.
 HandlerRegistration addSelectionHandler(SelectionHandler<Item> handler)
           
 boolean getHideOnClick()
          Returns the hide on click state.
 boolean isCanActivate()
          Returns true if the widget can be activated.
 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).
 
Methods inherited from class com.sencha.gxt.widget.core.client.Component
addBeforeHideHandler, 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, 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, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

Item

public Item()

Item

public Item(Item.ItemAppearance appearance)
Method Detail

addActivateHandler

public HandlerRegistration addActivateHandler(ActivateEvent.ActivateHandler<Item> handler)
Description copied from interface: ActivateEvent.HasActivateHandlers
Adds a ActivateEvent handler.

Specified by:
addActivateHandler in interface ActivateEvent.HasActivateHandlers<Item>
Parameters:
handler - the handler
Returns:
the registration for the event

addDeactivateHandler

public HandlerRegistration addDeactivateHandler(DeactivateEvent.DeactivateHandler<Item> handler)
Description copied from interface: DeactivateEvent.HasDeactivateHandlers
Adds a DeactivateEvent handler.

Specified by:
addDeactivateHandler in interface DeactivateEvent.HasDeactivateHandlers<Item>
Parameters:
handler - the handler
Returns:
the registration for the event

addSelectionHandler

public HandlerRegistration addSelectionHandler(SelectionHandler<Item> handler)
Specified by:
addSelectionHandler in interface HasSelectionHandlers<Item>

addBeforeSelectionHandler

public HandlerRegistration addBeforeSelectionHandler(BeforeSelectionHandler<Item> handler)
Specified by:
addBeforeSelectionHandler in interface HasBeforeSelectionHandlers<Item>

getHideOnClick

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

Returns:
the hide on click state

isCanActivate

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

Returns:
true if can be activated

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


Copyright © 2012. All Rights Reserved.