Package com.biglybt.pif.ui.menus
Interface MenuManager
-
- All Known Implementing Classes:
MenuManagerImpl
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
- See Also:
TableManager
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MENU_DOWNLOAD_BAR
The menu used on download bars.static java.lang.String
MENU_DOWNLOAD_CONTEXT
All menus which areDownload
specific, such as download bars, the Torrent menu, torrent tables etc.static java.lang.String
MENU_FILE_CONTEXT
All menus which areDiskManagerFileInfo
specific, such as the Files tab in Torrent Details view, or the file row within the library viewstatic java.lang.String
MENU_MENUBAR
The "Plugins" menu on the menu bar.static java.lang.String
MENU_MENUBAR_TOOLS
The "Tools" menu on the menu bar.static java.lang.String
MENU_SYSTRAY
The menu used for the system tray icon.static java.lang.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 java.lang.String
MENU_TAG_CONTEXT
static java.lang.String
MENU_TORRENT_MENU
The "Torrents" menu.static java.lang.String
MENU_TRANSFERSBAR
The "transfers bar".
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MenuItem
addMenuItem(MenuContext context, java.lang.String resource_key)
Creates a menu item in a particular context.MenuItem
addMenuItem(MenuItem parent, java.lang.String resource_key)
Creates a menu item as a sub-item of the given menu item.MenuItem
addMenuItem(java.lang.String menuID, java.lang.String resource_key)
Creates a menu item for the appropriate menu.java.util.List<MenuItem>
getMenuItems(java.lang.String menu_id, java.lang.String resource_key)
-
-
-
Field Detail
-
MENU_TABLE
static final java.lang.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 java.lang.String MENU_SYSTRAY
The menu used for the system tray icon.- See Also:
- Constant Field Values
-
MENU_DOWNLOAD_BAR
static final java.lang.String MENU_DOWNLOAD_BAR
The menu used on download bars.- See Also:
- Constant Field Values
-
MENU_MENUBAR
static final java.lang.String MENU_MENUBAR
The "Plugins" menu on the menu bar.- See Also:
- Constant Field Values
-
MENU_MENUBAR_TOOLS
static final java.lang.String MENU_MENUBAR_TOOLS
The "Tools" menu on the menu bar.- See Also:
- Constant Field Values
-
MENU_TRANSFERSBAR
static final java.lang.String MENU_TRANSFERSBAR
The "transfers bar".- Since:
- 3.0.1.3
- See Also:
- Constant Field Values
-
MENU_TORRENT_MENU
static final java.lang.String MENU_TORRENT_MENU
The "Torrents" menu.- Since:
- 3.0.2
- See Also:
- Constant Field Values
-
MENU_DOWNLOAD_CONTEXT
static final java.lang.String MENU_DOWNLOAD_CONTEXT
All menus which areDownload
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 java.lang.String MENU_FILE_CONTEXT
All menus which areDiskManagerFileInfo
specific, such as the Files tab in Torrent Details view, or the file row within the library viewdata 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 java.lang.String MENU_TAG_CONTEXT
- Since:
- 5.6
- See Also:
- Constant Field Values
-
-
Method Detail
-
addMenuItem
MenuItem addMenuItem(java.lang.String menuID, java.lang.String resource_key)
Creates a menu item for the appropriate menu.On plugin unload, use
MenuItem.remove()
orMenuItem.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, java.lang.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
, callUISWTStatusEntry#getMenuContext()
to get the MenuContext, and then pass it into this function.On plugin unload, use
MenuItem.remove()
orMenuItem.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, java.lang.String resource_key)
Creates a menu item as a sub-item of the given menu item.On plugin unload, use
MenuItem.remove()
orMenuItem.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.
-
getMenuItems
java.util.List<MenuItem> getMenuItems(java.lang.String menu_id, java.lang.String resource_key)
-
-