|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WWidget
eu.webtoolkit.jwt.WCompositeWidget
eu.webtoolkit.jwt.WPopupMenuItem
public class WPopupMenuItem
An item in a popup menu.
An item may have a text, icon, and can be checkable or lead to a submenu.
When the mouse hovers over the item, its class is changed from "Wt-item" to "Wt-selected".
WPopupMenu| Constructor Summary | |
|---|---|
WPopupMenuItem(java.lang.CharSequence text)
Creates a new item with given text. |
|
WPopupMenuItem(java.lang.String iconPath,
java.lang.CharSequence text)
Creates a new item with given icon and text. |
|
| Method Summary | |
|---|---|
java.lang.Object |
getData()
Returns additional data of the item. |
java.lang.String |
getIcon()
Returns the item icon path. |
WLink |
getLink()
Returns the associated link. |
AnchorTarget |
getLinkTarget()
Returns the link target. |
WPopupMenu |
getPopupMenu()
Returns the sub menu. |
WString |
getText()
Returns the item text. |
boolean |
isCheckable()
Returns whether the item is checkable. |
boolean |
isChecked()
Returns the checked state. |
boolean |
isSelectable()
Returns whether the menu item can be selected. |
void |
load()
Loads content just before the widget is used. |
void |
remove()
Destructor. |
void |
setCheckable(boolean checkable)
Sets if the item is checkable. |
void |
setChecked(boolean checked)
Sets the checked state. |
void |
setData(java.lang.Object data)
Sets associated additional data with the item. |
void |
setDisabled(boolean disabled)
Sets whether the widget is disabled. |
void |
setIcon(java.lang.String path)
Sets the item icon path. |
void |
setLink(WLink link)
Associates a link with the item. |
void |
setLinkTarget(AnchorTarget target)
Sets the link target. |
void |
setPopupMenu(WPopupMenu menu)
Sets a sub menu for the item. |
void |
setSelectable(boolean selectable)
Sets whether the menu item can be selected. |
void |
setText(java.lang.CharSequence text)
Sets the item text. |
Signal1<WPopupMenuItem> |
triggered()
Signal emitted when an item is activated. |
| Methods inherited from class eu.webtoolkit.jwt.WWidget |
|---|
acceptDrops, acceptDrops, addCssRule, addCssRule, addStyleClass, animateHide, animateShow, containsExposed, disable, dropEvent, enable, getDrop, getJsRef, getParent, hide, htmlText, isLayoutSizeAware, isRendered, layoutSizeChanged, positionAt, positionAt, removeStyleClass, resize, setClearSides, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr |
| Methods inherited from class eu.webtoolkit.jwt.WObject |
|---|
addChild, getObjectName, setObjectName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WPopupMenuItem(java.lang.CharSequence text)
WPopupMenu.addItem(CharSequence text)
public WPopupMenuItem(java.lang.String iconPath,
java.lang.CharSequence text)
The icon is displayed left to the text.
Note: The icon should have a width of 16 pixels.
WPopupMenu.addItem(String iconPath, CharSequence text)| Method Detail |
|---|
public void remove()
remove in class WCompositeWidgetWContainerWidget.removeWidget(WWidget widget)public void setText(java.lang.CharSequence text)
setIcon(String path)public WString getText()
setText(CharSequence text)public void setIcon(java.lang.String path)
The icon should have a width of 16 pixels.
setText(CharSequence text)public java.lang.String getIcon()
setIcon(String path)public void setCheckable(boolean checkable)
When an item is checkable, a checkbox is displayed to the left of the item text (instead of an icon).
setChecked(boolean checked),
isChecked()public boolean isCheckable()
setCheckable(boolean checkable)public void setLink(WLink link)
You may turn the item into an anchor by specifying an link for it. The link may point to a URL, a resource, or an internal path.
The default link is a null link, which disables the
anchor-like functionality.
public WLink getLink()
setLink(WLink link)public void setLinkTarget(AnchorTarget target)
setLink(WLink link)public AnchorTarget getLinkTarget()
setLinkTarget(AnchorTarget target)public void setPopupMenu(WPopupMenu menu)
Sets a submenu for the item. Ownership of the submenu is transferred to the item.
getPopupMenu()public WPopupMenu getPopupMenu()
setPopupMenu(WPopupMenu menu)public void setChecked(boolean checked)
This is only used when isCheckable()
== true.
setCheckable(boolean checkable),
isCheckable()public boolean isChecked()
This is only used when isCheckable()
== true.
setChecked(boolean checked),
isCheckable()public void setSelectable(boolean selectable)
Only a menu item that can be selected can be the result of a popup menu selection.
The default value is true for a normal menu item, and
false for a menu item that has a submenu.
An item that is selectable but is disabled can still not be selected.
setSelectable in class WCompositeWidgetpublic boolean isSelectable()
setSelectable(boolean selectable)public void setData(java.lang.Object data)
public java.lang.Object getData()
public Signal1<WPopupMenuItem> triggered()
Returns this item as argument.
WPopupMenu.triggered()public void load()
WWidgetWhen the widget is inserted in the widget hierarchy, this method is called. Widgets that get inserted in the widget hierarchy will be rendered. Visible widgets are rendered immediately, and invisible widgets in the back-ground (or not for a plain HTML session). This method is called when the widget is directly or indirectly inserted into the widget tree.
The default implementation simply propagates the load signal to its children. You may want to override this method to delay loading of resource-intensive contents.
During the life-time of a widget, this method may be called multiple times, so you should make sure that you do a deferred initializiation only once.
load in class WCompositeWidgetpublic void setDisabled(boolean disabled)
WWidgetEnables or disables the widget (including all its descendant widgets). setDisabled(false) will enable this widget and all descendant widgets that are not disabled. A widget is only enabled if it and all its ancestors in the widget tree are disabled.
Typically, a disabled form widget will not allow changing the value, and disabled widgets will not react to mouse click events.
setDisabled in class WCompositeWidgetWWidget.disable(),
WWidget.enable()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||