java.lang.Object
net.i2p.desktopgui.TrayManager
net.i2p.desktopgui.ExternalTrayManager
Tray manager for external use without router context access. Provides minimal I2P management when started before the router. Limited to starting I2P and basic notification controls. Not fully supported - use
InternalTrayManager when possible.Field Summary
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
ConstructorsConstructorDescriptionExternalTrayManager(I2PAppContext ctx, boolean useSwing) Create a new ExternalTrayManager.Method Summary
Public MethodsModifier and TypeMethodDescriptionBuild an AWT popup menu with start and notification controls.Build a Swing popup menu with notification controls.protected voidUpdate the menu.Methods inherited from class TrayManager
_t, _t, configureNotifications, displayMessage, initializeJNotificationItems, initializeNotificationItems, languageChanged, startManager, stopManagerModifier and TypeMethodDescriptionprotected StringTranslate a string.protected StringTranslate a string with one parameter.protected voidconfigureNotifications(boolean enable) Does not save.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.voidAdd the tray icon to the system tray and start everything up.voidRemove the tray icon from the system tray.
Constructor Details
ExternalTrayManager
Create a new ExternalTrayManager.- Parameters:
ctx- the I2P application contextuseSwing- true to use Swing components, false for AWT
Method Details
getMainMenu
Build an AWT popup menu with start and notification controls.- Specified by:
getMainMenuin classTrayManager- Returns:
- the AWT popup menu
getSwingMainMenu
Build a Swing popup menu with notification controls.- Specified by:
getSwingMainMenuin classTrayManager- Returns:
- the Swing popup menu
updateMenu