org.gudy.azureus2.plugins.ui.menus
Interface MenuManager


public interface MenuManager

Helper class to allow plugins to register their own menus. If you want to add menus to be available in tables, you should use the TableManager class.

To get an instance of MenuManager, use UIManager.getMenuManager()

Since:
3.0.0.7
Author:
amc1
See Also:
TableManager

Field Summary
static String MENU_DOWNLOAD_BAR
          The menu used on download bars.
static String MENU_DOWNLOAD_CONTEXT
          All menus which are Download specific, such as download bars, the Torrent menu, torrent tables etc.
static String MENU_FILE_CONTEXT
          All menus which are DiskManagerFileInfo specific, such as the Files tab in Torrent Details view, or the file row within the library view
static String MENU_MENUBAR
          The "Plugins" menu on the menu bar.
static String MENU_SYSTRAY
          The menu used for the system tray icon.
static String MENU_TABLE
          The menu used for tables - this value cannot be used directly to create menus used by tables, you need to use the TableManager class to create such menu items.
static String MENU_TAG_CONTEXT
           
static String MENU_TORRENT_MENU
          The "Torrents" menu.
static String MENU_TRANSFERSBAR
          The "transfers bar".
 
Method Summary
 MenuItem addMenuItem(MenuContext context, String resource_key)
          Creates a menu item in a particular context.
 MenuItem addMenuItem(MenuItem parent, String resource_key)
          Creates a menu item as a sub-item of the given menu item.
 MenuItem addMenuItem(String menuID, String resource_key)
          Creates a menu item for the appropriate menu.
 

Field Detail

MENU_TABLE

static final String MENU_TABLE
The menu used for tables - this value cannot be used directly to create menus used by tables, you need to use the TableManager class to create such menu items.

See Also:
TableManager, Constant Field Values

MENU_SYSTRAY

static final String MENU_SYSTRAY
The menu used for the system tray icon.

See Also:
Constant Field Values

MENU_DOWNLOAD_BAR

static final String MENU_DOWNLOAD_BAR
The menu used on download bars.

See Also:
Constant Field Values

MENU_MENUBAR

static final String MENU_MENUBAR
The "Plugins" menu on the menu bar.

See Also:
Constant Field Values

MENU_TRANSFERSBAR

static final String MENU_TRANSFERSBAR
The "transfers bar".

Since:
3.0.1.3
See Also:
Constant Field Values

MENU_TORRENT_MENU

static final String MENU_TORRENT_MENU
The "Torrents" menu.

Since:
3.0.2
See Also:
Constant Field Values

MENU_DOWNLOAD_CONTEXT

static final String MENU_DOWNLOAD_CONTEXT
All menus which are Download specific, such as download bars, the Torrent menu, torrent tables etc.

data or target parameter in listener triggers will be an array of Download

Since:
3.0.2
See Also:
Constant Field Values

MENU_FILE_CONTEXT

static final String MENU_FILE_CONTEXT
All menus which are DiskManagerFileInfo specific, such as the Files tab in Torrent Details view, or the file row within the library view

data or target parameter in listener triggers will be an array of DiskManagerFileInfo

Since:
5.6
See Also:
Constant Field Values

MENU_TAG_CONTEXT

static final String MENU_TAG_CONTEXT
Since:
5.6
See Also:
Constant Field Values
Method Detail

addMenuItem

MenuItem addMenuItem(String menuID,
                     String resource_key)
Creates a menu item for the appropriate menu.

On plugin unload, use MenuItem.remove() or MenuItem.removeAllChildItems()

Parameters:
menuID - The MENU_ identifier as defined above.
resource_key - ID of the menu, which is also used to retrieve the textual name from the plugin language file.
Returns:
The newly created menu item.

addMenuItem

MenuItem addMenuItem(MenuContext context,
                     String resource_key)
Creates a menu item in a particular context. MenuContext instances can be retrieved from some plugin objects that support menu items to be added to it.

Example: When adding menus to UISWTStatusEntry, call UISWTStatusEntry#getMenuContext() to get the MenuContext, and then pass it into this function.

On plugin unload, use MenuItem.remove() or MenuItem.removeAllChildItems()

Parameters:
context - The menu context object which represents the place to add a menu item.
resource_key - ID of the menu, which is also used to retrieve the textual name from the plugin language file.
Returns:
The newly created menu item.
Since:
3.0.5.3

addMenuItem

MenuItem addMenuItem(MenuItem parent,
                     String resource_key)
Creates a menu item as a sub-item of the given menu item.

On plugin unload, use MenuItem.remove() or MenuItem.removeAllChildItems()

Parameters:
parent - The MenuItem to add this new item to. The parent MenuItem must have its style attribute to be set to "menu".
resource_key - ID of the menu, which is also used to retrieve the textual name from the plugin language file.
Returns:
The newly created menu item.