java.lang.Object
net.i2p.desktopgui.TrayManager
net.i2p.desktopgui.InternalTrayManager
Tray manager for internal use with full router context access. Provides comprehensive I2P management through system tray including restart, shutdown, browser launch, and configuration options. Requires
router.jar for complete functionality.Field Summary
FieldsModifier and TypeFieldDescriptionprivate MenuItemMenu items of the tray popup.private MenuItemMenu items of the tray popup.private MenuItemMenu items of the tray popup.private final RouterContextThe router context.private JMenuItemMenu items of the Java menu bar.private JMenuItemMenu items of the Java menu bar.private JMenuItemMenu items of the Java menu bar.private JMenuItemMenu items of the Java menu bar.private JMenuItemMenu items of the Java menu bar.private JMenuItemMenu items of the Java menu bar.private JMenuItemMenu items of the Java menu bar.private JMenuItemMenu items of the Java menu bar.private final MainThe main application object.private MenuItemMenu items of the tray popup.private MenuItemMenu items of the tray popup.private MenuItemMenu items of the tray popup.private MenuItemMenu items of the tray popup.private static final StringBundle holding the translated console strings.private static final booleanTrue if the desktop console can be opened.private final LogLogger for the tray menu.Fields inherited from class TrayManager
_appContext, _jnotificationItem1, _jnotificationItem2, _notificationItem1, _notificationItem2, _showNotifications, _useSwing, PROP_NOTIFICATIONS, tray, trayIconModifier and TypeFieldDescriptionprotected final I2PAppContextThe router context the tray manager runs in.protected JMenuItem_jnotificationItem1.protected JMenuItem_jnotificationItem2.protected MenuItem_notificationItem1.protected MenuItem_notificationItem2.protected booleanWhether tray notifications are currently shown, defaults to true.protected final booleanTrue to build Swing menu items, false for plain AWT.protected static final StringConfig key holding the tray notification preference.protected SystemTrayThe tray area, or null if unsupportedprotected TrayIconOur tray icon, or null if unsupportedConstructor Summary
ConstructorsConstructorDescriptionInternalTrayManager(RouterContext ctx, Main main, boolean useSwing) Create a new InternalTrayManager with full router context access.Method Summary
Modifier and TypeMethodDescriptionprivate voidconfigureDesktopgui(boolean enable) Configure whether the desktop GUI is enabled.protected voidconfigureNotifications(boolean enable) Configure notification settings and save to router config.Build an AWT popup menu with router management controls.Build a Swing popup menu with router management controls.private voidBuild the console URL with info from the port mapper, and launch the browser at it.voidCreate the system tray icon and menu.protected voidUpdate the menu.Methods inherited from class TrayManager
_t, _t, displayMessage, initializeJNotificationItems, initializeNotificationItems, languageChanged, stopManagerModifier and TypeMethodDescriptionprotected StringTranslate a string.protected StringTranslate a string with one parameter.intdisplayMessage(int priority, String title, String message, String path) Send a notification to the user.protected voidInitializes _jnotificationItem 1 and 2.protected voidInitializes _notificationItem 1 and 2.voidUpdate the tray menu when the language changes.voidRemove the tray icon from the system tray.
Field Details
_context
The router context.log
Logger for the tray menu._main
The main application object._browserItem
Menu items of the tray popup._configItem
Menu items of the tray popup._restartItem
Menu items of the tray popup._stopItem
Menu items of the tray popup._restartHardItem
Menu items of the tray popup._stopHardItem
Menu items of the tray popup._cancelItem
Menu items of the tray popup._jstatusItem
Menu items of the Java menu bar._jbrowserItem
Menu items of the Java menu bar._jconfigItem
Menu items of the Java menu bar._jrestartItem
Menu items of the Java menu bar._jstopItem
Menu items of the Java menu bar._jrestartHardItem
Menu items of the Java menu bar._jstopHardItem
Menu items of the Java menu bar._jcancelItem
Menu items of the Java menu bar.CONSOLE_ENABLED
private static final boolean CONSOLE_ENABLEDTrue if the desktop console can be opened.CONSOLE_BUNDLE_NAME
Bundle holding the translated console strings.- See Also:
Constructor Details
InternalTrayManager
Create a new InternalTrayManager with full router context access.- Parameters:
ctx- the router contextmain- the main application instanceuseSwing- true to use Swing components, false for AWT
Method Details
startManager
Create the system tray icon and menu.- Overrides:
startManagerin classTrayManager- Throws:
AWTException- if the system tray is not supported
getMainMenu
Build an AWT popup menu with router management controls.- Specified by:
getMainMenuin classTrayManager- Returns:
- the AWT popup menu
getSwingMainMenu
Build a Swing popup menu with router management controls.- Specified by:
getSwingMainMenuin classTrayManager- Returns:
- the Swing popup menu
updateMenu
configureDesktopgui
private void configureDesktopgui(boolean enable) Configure whether the desktop GUI is enabled.- Parameters:
enable- true to enable, false to disable
configureNotifications
protected void configureNotifications(boolean enable) Configure notification settings and save to router config.- Overrides:
configureNotificationsin classTrayManager- Parameters:
enable- true to enable notifications, false to disable
launchBrowser
private void launchBrowser()Build the console URL with info from the port mapper, and launch the browser at it. Modified from I2PTunnelHTTPClientBase.