|
|||||||||
| 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 java.lang.String |
html
|
protected com.google.gwt.user.client.ui.AbstractImagePrototype |
icon
|
protected java.lang.String |
itemStyle
|
protected Menu |
subMenu
|
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 html)
Creates a new item with the given text. |
|
MenuItem(java.lang.String html,
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)
|
java.lang.String |
getHtml()
Returns the item's text. |
com.google.gwt.user.client.ui.AbstractImagePrototype |
getIcon()
Returns the item's icon style. |
Menu |
getSubMenu()
Returns the item's sub menu. |
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 |
setHtml(java.lang.String html)
Sets the item's text as HTML. |
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, unsinkEvents |
| 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, resolvePotentialElement, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent |
| 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 html
protected com.google.gwt.user.client.ui.Widget widget
| Constructor Detail |
|---|
public MenuItem()
public MenuItem(java.lang.String html)
html - the item's text as HTML
public MenuItem(java.lang.String html,
com.google.gwt.user.client.ui.AbstractImagePrototype icon)
html - the item's text as HTMLicon - the item's icon
public 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 listener
public MenuItem(java.lang.String text,
SelectionListener<? extends MenuEvent> listener)
text - the item textlistener - the selection listener| Method Detail |
|---|
public void expandMenu()
public com.google.gwt.user.client.ui.AbstractImagePrototype getIcon()
getIcon in interface IconSupportpublic Menu getSubMenu()
public java.lang.String getHtml()
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 IconSupporticon - the iconpublic void setIconStyle(java.lang.String icon)
IconSupport
setIconStyle in interface IconSupporticon - a CSS style namepublic void setSubMenu(Menu menu)
menu - the sub menupublic void setText(java.lang.String text)
text - the textpublic void setHtml(java.lang.String html)
html - the text as HTMLpublic void setWidget(com.google.gwt.user.client.ui.Widget widget)
widget - the widgetprotected void activate(boolean autoExpand)
activate in class Itemprotected void afterRender()
Component
afterRender in class Componentprotected void deactivate()
deactivate in class Itemprotected void doAttachChildren()
doAttachChildren in class Componentprotected void doDetachChildren()
doDetachChildren in class Componentprotected void expandMenu(boolean autoActivate)
expandMenu in class Itemprotected void onDisable()
onDisable in class Itemprotected void onEnable()
onEnable in class Item
protected void onRender(com.google.gwt.user.client.Element target,
int index)
Component
onRender in class Componenttarget - 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 | ||||||||