|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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,
String key)
|
|
MenuItemImpl(PluginInterface _pi,
String menuID,
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. |
Object |
getData()
Get the current data value associated with the menu: Boolean for CHECK style |
Graphic |
getGraphic()
get the menu's graphic |
MenuItem |
getItem(String key)
Get the child item with the given resource key. |
MenuItem[] |
getItems()
Get all child items currently associated with this MenuItem. |
String |
getMenuID()
Retrieve the menu ID that the menu item belongs to |
MenuItem |
getParent()
Retrieve the parent MenuItem. |
String |
getResourceKey()
Retrieve the resource key ("name") of this menu item |
int |
getStyle()
Get the type of the menu item |
MenuBuilder |
getSubmenuBuilder()
|
String |
getText()
Gets the text to display for this menu item. |
void |
invokeListenersMulti(Object[] rows)
|
protected void |
invokeListenersOnList(CopyOnWriteList listeners_to_notify,
Object target)
|
void |
invokeMenuWillBeShownListeners(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(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(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, String menuID, String key)
public MenuItemImpl(MenuItemImpl ti, String key)
Method Detail |
---|
public String getResourceKey()
MenuItem
getResourceKey
in interface MenuItem
public String getMenuID()
MenuItem
getMenuID
in interface MenuItem
MenuManager
.MENU_ constant.public int getStyle()
MenuItem
getStyle
in interface MenuItem
public void setStyle(int _style)
MenuItem
setStyle
in interface MenuItem
public Object getData()
MenuItem
getData
in interface MenuItem
public void setData(Object _data)
MenuItem
setData
in interface MenuItem
public boolean isEnabled()
MenuItem
isEnabled
in interface MenuItem
public void setEnabled(boolean _enabled)
MenuItem
setEnabled
in interface MenuItem
public void setGraphic(Graphic _graphic)
MenuItem
setGraphic
in interface MenuItem
public Graphic getGraphic()
MenuItem
getGraphic
in interface MenuItem
public void invokeMenuWillBeShownListeners(Object target)
public void addFillListener(MenuItemFillListener listener)
MenuItem
addFillListener
in interface MenuItem
public void removeFillListener(MenuItemFillListener listener)
removeFillListener
in interface MenuItem
public void invokeListenersMulti(Object[] rows)
public void addMultiListener(MenuItemListener l)
MenuItem
MenuItem.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 MenuItem
l
- listener to be notified when user has selected the menu item.public void removeMultiListener(MenuItemListener l)
MenuItem
MenuItem.addMultiListener(MenuItemListener)
.
removeMultiListener
in interface MenuItem
l
- listener to removepublic void addListener(MenuItemListener l)
MenuItem
addListener
in interface MenuItem
l
- listener to be notified when user has selected the menu item.public void removeListener(MenuItemListener l)
MenuItem
removeListener
in interface MenuItem
l
- listener to removepublic MenuItem getParent()
MenuItem
getParent
in interface MenuItem
public MenuItem[] getItems()
MenuItem
getItems
in interface MenuItem
public MenuItem getItem(String key)
MenuItem
getItem
in interface MenuItem
public String getText()
MenuItem
getText
in interface MenuItem
public void setText(String text)
MenuItem
setText
in interface MenuItem
protected void invokeListenersOnList(CopyOnWriteList listeners_to_notify, Object target)
protected void removeWithEvents(int root_menu_event, int sub_menu_event)
public void remove()
MenuItem
remove
in interface MenuItem
public void removeAllChildItems()
MenuItem
removeAllChildItems
in interface MenuItem
public boolean isVisible()
MenuItem
isVisible
in interface MenuItem
public void setVisible(boolean visible)
MenuItem
setVisible
in interface MenuItem
public boolean isSelected()
MenuItem
isSelected
in interface MenuItem
public void setContext(MenuContextImpl context)
public void setSubmenuBuilder(MenuBuilder builder)
MenuItem
MenuItem.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 MenuItem
public MenuBuilder getSubmenuBuilder()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |