Methods Summary |
---|
public void | addFillListener(MenuItemFillListener listener)Adds a listener to be notified when the menu item is about to be
displayed. The "context" object provided is always going to be either
be null (if there is no context) or an array of objects
(such as an array of TableRows or an array of Download objects).
|
public void | addListener(MenuItemListener l)Adds a selection listener for this menu item.
|
public void | addMultiListener(MenuItemListener l)Adds a selection listener for this menu item.
This differs from {@link #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.
|
public java.lang.Object | getData()Get the current data value associated with the menu: Boolean for CHECK style
|
public org.gudy.azureus2.plugins.ui.Graphic | getGraphic()get the menu's graphic
|
public org.gudy.azureus2.plugins.ui.menus.MenuItem | getItem(java.lang.String key_id)Get the child item with the given resource key.
|
public org.gudy.azureus2.plugins.ui.menus.MenuItem[] | getItems()Get all child items currently associated with this MenuItem.
|
public java.lang.String | getMenuID()Retrieve the menu ID that the menu item belongs to
|
public org.gudy.azureus2.plugins.ui.menus.MenuItem | getParent()Retrieve the parent MenuItem.
|
public java.lang.String | getResourceKey()Retrieve the resource key ("name") of this menu item
|
public int | getStyle()Get the type of the menu item
|
public java.lang.String | getText()Gets the text to display for this menu item.
|
public boolean | isEnabled()Whether or not this item is enabled or not
|
public boolean | isSelected()Returns whether the menu item is selected or not.
This method should only be called if the menu is of type STYLE_RADIO or
type STYLE_CHECK and if the menu item has already had a selected or
deselected state assigned to it.
|
public boolean | isVisible()Returns whether the menu item is visible or not.
|
public void | remove()Removes the menu item.
Calling this will remove the item from the menus, as well as removing all
listeners and removing all child menu items (if any exist).
The behaviour of this object is undefined after this method has been called.
If you need to interact with this object when you are about to destroy it,
you should do it before you call the remove method.
|
public void | removeAllChildItems()Removes all child menu items from this menu (if any exist).
|
public void | removeFillListener(MenuItemFillListener listener)
|
public void | removeListener(MenuItemListener l)Removes a selection listener from this menu item.
|
public void | removeMultiListener(MenuItemListener l)Removes a selection listener from this menu item.
You only use this method to remove a listener added via
{@link #addMultiListener(MenuItemListener)}.
|
public void | setData(java.lang.Object data)Set the current data value associated with the menu: Boolean for CHECK style
|
public void | setEnabled(boolean enabled)Set the enabled status of the menu item
|
public void | setGraphic(org.gudy.azureus2.plugins.ui.Graphic graphic)set the menu item's icon
|
public void | setStyle(int style)Set the style of the menu item (see STYLE_ constants)
|
public void | setText(java.lang.String text)Sets the text to display for this menu item. You can also
pass null to revert back to the default behaviour.
|
public void | setVisible(boolean visible)Sets whether the menu item is visible or not.
|