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 Details

    • addMenu

      MenuHandle addMenu(String message, MenuCallback callback)
      Menu will start out shown and enabled, in the root menu
      Parameters:
      message - for the menu, translated
      callback - fired on click
      Returns:
      null on error
    • addMenu

      MenuHandle addMenu(String message, MenuCallback callback, MenuHandle parent)
      Menu will start out enabled, as a submenu
      Parameters:
      message - for the menu, translated
      callback - fired on click
      parent - the parent menu this will be a submenu of, or null for top level
      Returns:
      null on error
    • removeMenu

      void removeMenu(MenuHandle item)
    • showMenu

      void showMenu(MenuHandle item)
    • hideMenu

      void hideMenu(MenuHandle item)
    • enableMenu

      void enableMenu(MenuHandle item)
    • disableMenu

      void disableMenu(MenuHandle item)
    • updateMenu

      void updateMenu(String message, MenuHandle item)