|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.gudy.azureus2.pluginsimpl.local.ui.menus.MenuItemImpl
public class MenuItemImpl
amc1: This class was largely derived from TableContextMenuImpl.
| Field Summary |
|---|
| Fields inherited from interface org.gudy.azureus2.plugins.ui.menus.MenuItem |
|---|
STYLE_CHECK, STYLE_MENU, STYLE_PUSH, STYLE_RADIO, STYLE_SEPARATOR |
| Constructor Summary | |
|---|---|
MenuItemImpl(MenuItemImpl ti,
java.lang.String key)
|
|
MenuItemImpl(PluginInterface _pi,
java.lang.String menuID,
java.lang.String key)
|
|
| Method Summary | |
|---|---|
void |
addFillListener(MenuItemFillListener listener)
Adds a listener to be notified when the menu item is about to be displayed. |
void |
addListener(MenuItemListener l)
Adds a selection listener for this menu item. |
void |
addMultiListener(MenuItemListener l)
Adds a selection listener for this menu item. |
java.lang.Object |
getData()
Get the current data value associated with the menu: Boolean for CHECK style |
Graphic |
getGraphic()
get the menu's graphic |
MenuItem |
getItem(java.lang.String key)
Get the child item with the given resource key. |
MenuItem[] |
getItems()
Get all child items currently associated with this MenuItem. |
java.lang.String |
getMenuID()
Retrieve the menu ID that the menu item belongs to |
MenuItem |
getParent()
Retrieve the parent MenuItem. |
java.lang.String |
getResourceKey()
Retrieve the resource key ("name") of this menu item |
int |
getStyle()
Get the type of the menu item |
MenuBuilder |
getSubmenuBuilder()
|
java.lang.String |
getText()
Gets the text to display for this menu item. |
void |
invokeListenersMulti(java.lang.Object[] rows)
|
protected void |
invokeListenersOnList(CopyOnWriteList listeners_to_notify,
java.lang.Object target)
|
void |
invokeMenuWillBeShownListeners(java.lang.Object target)
|
boolean |
isEnabled()
Whether or not this item is enabled or not |
boolean |
isSelected()
Returns whether the menu item is selected or not. |
boolean |
isVisible()
Returns whether the menu item is visible or not. |
void |
remove()
Removes the menu item. |
void |
removeAllChildItems()
Removes all child menu items from this menu (if any exist). |
void |
removeFillListener(MenuItemFillListener listener)
|
void |
removeListener(MenuItemListener l)
Removes a selection listener from this menu item. |
void |
removeMultiListener(MenuItemListener l)
Removes a selection listener from this menu item. |
protected void |
removeWithEvents(int root_menu_event,
int sub_menu_event)
|
void |
setContext(MenuContextImpl context)
|
void |
setData(java.lang.Object _data)
Set the current data value associated with the menu: Boolean for CHECK style |
void |
setEnabled(boolean _enabled)
Set the enabled status of the menu item |
void |
setGraphic(Graphic _graphic)
set the menu item's icon |
void |
setStyle(int _style)
Set the style of the menu item (see STYLE_ constants) |
void |
setSubmenuBuilder(MenuBuilder builder)
For MenuItem.STYLE_MENU, builder is called when user wants to see the
submenu items. |
void |
setText(java.lang.String text)
Sets the text to display for this menu item. |
void |
setVisible(boolean visible)
Sets whether the menu item is visible or not. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MenuItemImpl(PluginInterface _pi,
java.lang.String menuID,
java.lang.String key)
public MenuItemImpl(MenuItemImpl ti,
java.lang.String key)
| Method Detail |
|---|
public java.lang.String getResourceKey()
MenuItem
getResourceKey in interface MenuItempublic java.lang.String getMenuID()
MenuItem
getMenuID in interface MenuItemMenuManager.MENU_ constant.public int getStyle()
MenuItem
getStyle in interface MenuItempublic void setStyle(int _style)
MenuItem
setStyle in interface MenuItempublic java.lang.Object getData()
MenuItem
getData in interface MenuItempublic void setData(java.lang.Object _data)
MenuItem
setData in interface MenuItempublic boolean isEnabled()
MenuItem
isEnabled in interface MenuItempublic void setEnabled(boolean _enabled)
MenuItem
setEnabled in interface MenuItempublic void setGraphic(Graphic _graphic)
MenuItem
setGraphic in interface MenuItempublic Graphic getGraphic()
MenuItem
getGraphic in interface MenuItempublic void invokeMenuWillBeShownListeners(java.lang.Object target)
public void addFillListener(MenuItemFillListener listener)
MenuItem
addFillListener in interface MenuItempublic void removeFillListener(MenuItemFillListener listener)
removeFillListener in interface MenuItempublic void invokeListenersMulti(java.lang.Object[] rows)
public void addMultiListener(MenuItemListener l)
MenuItemMenuItem.addListener(MenuItemListener), in that the
target object which will be passed to the listener will be an
array of objects, rather than just a single object.
addMultiListener in interface MenuIteml - listener to be notified when user has selected the menu item.public void removeMultiListener(MenuItemListener l)
MenuItemMenuItem.addMultiListener(MenuItemListener).
removeMultiListener in interface MenuIteml - listener to removepublic void addListener(MenuItemListener l)
MenuItem
addListener in interface MenuIteml - listener to be notified when user has selected the menu item.public void removeListener(MenuItemListener l)
MenuItem
removeListener in interface MenuIteml - listener to removepublic MenuItem getParent()
MenuItem
getParent in interface MenuItempublic MenuItem[] getItems()
MenuItem
getItems in interface MenuItempublic MenuItem getItem(java.lang.String key)
MenuItem
getItem in interface MenuItempublic java.lang.String getText()
MenuItem
getText in interface MenuItempublic void setText(java.lang.String text)
MenuItem
setText in interface MenuItem
protected void invokeListenersOnList(CopyOnWriteList listeners_to_notify,
java.lang.Object target)
protected void removeWithEvents(int root_menu_event,
int sub_menu_event)
public void remove()
MenuItem
remove in interface MenuItempublic void removeAllChildItems()
MenuItem
removeAllChildItems in interface MenuItempublic boolean isVisible()
MenuItem
isVisible in interface MenuItempublic void setVisible(boolean visible)
MenuItem
setVisible in interface MenuItempublic boolean isSelected()
MenuItem
isSelected in interface MenuItempublic void setContext(MenuContextImpl context)
public void setSubmenuBuilder(MenuBuilder builder)
MenuItemMenuItem.STYLE_MENU, builder is called when user wants to see the
submenu items. Setting a builder will force clear all submenu items.
setSubmenuBuilder in interface MenuItempublic MenuBuilder getSubmenuBuilder()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||