|
|||||||||
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.MenuItem
public class MenuItem
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 | |
---|---|
protected com.google.gwt.user.client.ui.AbstractImagePrototype |
icon
|
protected java.lang.String |
itemStyle
|
protected Menu |
subMenu
|
protected java.lang.String |
text
|
protected com.google.gwt.user.client.ui.Widget |
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 | |
---|---|
MenuItem()
Creates a new item. |
|
MenuItem(java.lang.String text)
Creates a new item with the given text. |
|
MenuItem(java.lang.String text,
com.google.gwt.user.client.ui.AbstractImagePrototype icon)
Creates a new item. |
|
MenuItem(java.lang.String text,
com.google.gwt.user.client.ui.AbstractImagePrototype icon,
SelectionListener<? extends MenuEvent> listener)
Creates a new item. |
|
MenuItem(java.lang.String text,
SelectionListener<? extends MenuEvent> listener)
Creates a new item. |
Method Summary | |
---|---|
protected void |
activate(boolean autoExpand)
|
protected void |
afterRender()
Called after the component has been rendered and is attached for the first time. |
protected void |
deactivate()
|
protected void |
doAttachChildren()
|
protected void |
doDetachChildren()
|
void |
expandMenu()
Expands the item's sub menu. |
protected void |
expandMenu(boolean autoActivate)
|
com.google.gwt.user.client.ui.AbstractImagePrototype |
getIcon()
Returns the item's icon style. |
Menu |
getSubMenu()
Returns the item's sub menu. |
java.lang.String |
getText()
Returns the item's text. |
com.google.gwt.user.client.ui.Widget |
getWidget()
Returns the item's widget. |
protected void |
onDisable()
|
protected void |
onEnable()
|
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 |
setIcon(com.google.gwt.user.client.ui.AbstractImagePrototype icon)
Sets the item's icon style. |
void |
setIconStyle(java.lang.String icon)
Sets the icon style. |
void |
setSubMenu(Menu menu)
Sets the item's sub menu. |
void |
setText(java.lang.String text)
Sets the item's text. |
void |
setWidget(com.google.gwt.user.client.ui.Widget widget)
Sets the item's widget. |
protected boolean |
shouldDeactivate(ComponentEvent ce)
|
Methods inherited from class com.extjs.gxt.ui.client.widget.menu.Item |
---|
addSelectionListener, getActiveStyle, getHideOnClick, getParentMenu, handleClick, isCanActivate, onClick, onEscape, removeSelectionListener, setActiveStyle, setCanActivate, setHideOnClick |
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 |
---|
protected Menu subMenu
protected java.lang.String itemStyle
protected com.google.gwt.user.client.ui.AbstractImagePrototype icon
protected java.lang.String text
protected com.google.gwt.user.client.ui.Widget widget
Constructor Detail |
---|
public MenuItem()
public MenuItem(java.lang.String text)
text
- the item's textpublic MenuItem(java.lang.String text, com.google.gwt.user.client.ui.AbstractImagePrototype icon)
text
- the item's texticon
- the item's iconpublic MenuItem(java.lang.String text, com.google.gwt.user.client.ui.AbstractImagePrototype icon, SelectionListener<? extends MenuEvent> listener)
text
- the item's texticon
- the item's iconlistener
- the selection listenerpublic MenuItem(java.lang.String text, SelectionListener<? extends MenuEvent> listener)
text
- the item textlistener
- the selection listenerMethod Detail |
---|
public void expandMenu()
public com.google.gwt.user.client.ui.AbstractImagePrototype getIcon()
getIcon
in interface IconSupport
public Menu getSubMenu()
public java.lang.String getText()
public com.google.gwt.user.client.ui.Widget getWidget()
public void setIcon(com.google.gwt.user.client.ui.AbstractImagePrototype icon)
<code> .my-icon { background: url(images/icons/my-icon.png) no-repeat center left !important; } </code>
setIcon
in interface IconSupport
icon
- the iconpublic void setIconStyle(java.lang.String icon)
IconSupport
setIconStyle
in interface IconSupport
icon
- a CSS style namepublic void setSubMenu(Menu menu)
menu
- the sub menupublic void setText(java.lang.String text)
text
- the textpublic void setWidget(com.google.gwt.user.client.ui.Widget widget)
widget
- the widgetprotected void activate(boolean autoExpand)
activate
in class Item
protected void afterRender()
Component
afterRender
in class Component
protected void deactivate()
deactivate
in class Item
protected void doAttachChildren()
doAttachChildren
in class Component
protected void doDetachChildren()
doDetachChildren
in class Component
protected void expandMenu(boolean autoActivate)
expandMenu
in class Item
protected void onDisable()
onDisable
in class Item
protected void onEnable()
onEnable
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 locationprotected boolean shouldDeactivate(ComponentEvent ce)
shouldDeactivate
in class Item
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |