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

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
                  extended by com.extjs.gxt.ui.client.widget.menu.MenuItem
All Implemented Interfaces:
Observable, com.google.gwt.user.client.EventListener
Direct Known Subclasses:
CheckMenuItem

public class MenuItem
extends Item

A base class for all menu items that require menu-related functionality (like sub-menus) and are not static display items. Item extends the base functionality of Item by adding menu-specific activation and click handling.


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
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
MenuItem()
          Creates a new item.
MenuItem(java.lang.String text)
          Creates a new item with the given text.
MenuItem(java.lang.String text, SelectionListener listener)
          Creates a new item.
MenuItem(java.lang.String text, java.lang.String iconStyle)
          Creates a new item.
MenuItem(java.lang.String text, java.lang.String iconStyle, SelectionListener listener)
          Creates a new item.
 
Method Summary
 void expandMenu()
          Expands the item's sub menu.
 java.lang.String getIconStyle()
          Returns the item's icon style.
 Menu getSubMenu()
          Returns the item's sub menu.
 java.lang.String getText()
          Returns the item's text.
 void setIconStyle(java.lang.String iconStyle)
          Sets the item's icon style.
 void setSubMenu(Menu menu)
          Sets the item's sub menu.
 void setText(java.lang.String text)
          Sets the item's text.
 
Methods inherited from class com.extjs.gxt.ui.client.widget.menu.Item
addSelectionListener, getActiveStyle, getHideOnClick, getParentMenu, removeSelectionListener, setActiveStyle, setHideOnClick
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addListener, addStyleName, addWidgetListener, disable, disableEvents, disableTextSelection, el, enable, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, getBaseStyle, getBorders, getData, getData, getElement, getId, getItemId, getModel, getState, getToolTip, hide, hideToolTip, isEnabled, isRendered, isVisible, onBrowserEvent, onComponentEvent, recalculate, removeAllListeners, removeFromParent, removeListener, removeStyleName, removeWidgetListener, render, render, saveState, setBorders, setData, setData, setElement, setEnabled, setEnableState, setHeight, setId, setIntStyleAttribute, setItemId, setPixelSize, setSize, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, setWidth, show, toString
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MenuItem

public MenuItem()
Creates a new item.


MenuItem

public MenuItem(java.lang.String text)
Creates a new item with the given text.

Parameters:
text - the item's text

MenuItem

public MenuItem(java.lang.String text,
                SelectionListener listener)
Creates a new item.

Parameters:
text - the item text
listener - the selection listenor

MenuItem

public MenuItem(java.lang.String text,
                java.lang.String iconStyle)
Creates a new item.

Parameters:
text - the item's text
iconStyle - the item's icon style

MenuItem

public MenuItem(java.lang.String text,
                java.lang.String iconStyle,
                SelectionListener listener)
Creates a new item.

Parameters:
text - the item's text
iconStyle - the item's icon style
listener - the selection listener
Method Detail

expandMenu

public void expandMenu()
Expands the item's sub menu.


getIconStyle

public java.lang.String getIconStyle()
Returns the item's icon style.

Returns:
the icon style

getSubMenu

public Menu getSubMenu()
Returns the item's sub menu.

Returns:
the sub menu

getText

public java.lang.String getText()
Returns the item's text.

Returns:
the text

setIconStyle

public void setIconStyle(java.lang.String iconStyle)
Sets the item's icon style.

Parameters:
iconStyle - the icon style

setSubMenu

public void setSubMenu(Menu menu)
Sets the item's sub menu.

Parameters:
menu - the sub menu

setText

public void setText(java.lang.String text)
Sets the item's text.

Parameters:
text - the text