Class MenuManagerImpl
- java.lang.Object
-
- com.biglybt.pifimpl.local.ui.menus.MenuManagerImpl
-
- All Implemented Interfaces:
MenuManager
public class MenuManagerImpl extends java.lang.Object implements MenuManager
-
-
Field Summary
Fields Modifier and Type Field Description private UIManagerImpl
ui_manager
-
Fields inherited from interface com.biglybt.pif.ui.menus.MenuManager
MENU_DOWNLOAD_BAR, MENU_DOWNLOAD_CONTEXT, MENU_FILE_CONTEXT, MENU_MENUBAR, MENU_MENUBAR_TOOLS, MENU_SYSTRAY, MENU_TABLE, MENU_TAG_CONTEXT, MENU_TORRENT_MENU, MENU_TRANSFERSBAR
-
-
Constructor Summary
Constructors Constructor Description MenuManagerImpl(UIManagerImpl _ui_manager)
-
Method Summary
All Methods Instance Methods Concrete 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
-
ui_manager
private UIManagerImpl ui_manager
-
-
Constructor Detail
-
MenuManagerImpl
public MenuManagerImpl(UIManagerImpl _ui_manager)
-
-
Method Detail
-
addMenuItem
public MenuItem addMenuItem(java.lang.String menuID, java.lang.String resource_key)
Description copied from interface:MenuManager
Creates a menu item for the appropriate menu.On plugin unload, use
MenuItem.remove()
orMenuItem.removeAllChildItems()
- Specified by:
addMenuItem
in interfaceMenuManager
- 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
public MenuItem addMenuItem(MenuContext context, java.lang.String resource_key)
Description copied from interface:MenuManager
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()
- Specified by:
addMenuItem
in interfaceMenuManager
- 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.
-
addMenuItem
public MenuItem addMenuItem(MenuItem parent, java.lang.String resource_key)
Description copied from interface:MenuManager
Creates a menu item as a sub-item of the given menu item.On plugin unload, use
MenuItem.remove()
orMenuItem.removeAllChildItems()
- Specified by:
addMenuItem
in interfaceMenuManager
- 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
public java.util.List<MenuItem> getMenuItems(java.lang.String menu_id, java.lang.String resource_key)
- Specified by:
getMenuItems
in interfaceMenuManager
-
-