Package net.i2p.app
Interface MenuService
- All Known Implementing Classes:
ExternalMain
,Main
public interface MenuService
A service to provide a menu to users.
This service is currently provided by desktopgui (when supported and enabled).
Other applications may support this interface in the future.
This API is independent of any particular UI framework, e.g. AWT or Swing.
Example usage:
ClientAppManager cmgr = _context.clientAppManager(); if (cmgr != null) { MenuService ms = (MenuService) cmgr.getRegisteredApp("desktopgui"); if (ms != null) ms.addMenuHandle(_t("foo"), new Callback()); }
- Since:
- 0.9.59
-
Method Summary
Modifier and TypeMethodDescriptionaddMenu
(String message, MenuCallback callback) Menu will start out shown and enabled, in the root menuaddMenu
(String message, MenuCallback callback, MenuHandle parent) Menu will start out enabled, as a submenuvoid
disableMenu
(MenuHandle item) void
enableMenu
(MenuHandle item) void
hideMenu
(MenuHandle item) void
removeMenu
(MenuHandle item) void
showMenu
(MenuHandle item) void
updateMenu
(String message, MenuHandle item)
-
Method Details
-
addMenu
Menu will start out shown and enabled, in the root menu- Parameters:
message
- for the menu, translatedcallback
- fired on click- Returns:
- null on error
-
addMenu
Menu will start out enabled, as a submenu- Parameters:
message
- for the menu, translatedcallback
- fired on clickparent
- the parent menu this will be a submenu of, or null for top level- Returns:
- null on error
-
removeMenu
-
showMenu
-
hideMenu
-
enableMenu
-
disableMenu
-
updateMenu
-