Package net.i2p.desktopgui
Class TrayManager
java.lang.Object
net.i2p.desktopgui.TrayManager
- Direct Known Subclasses:
ExternalTrayManager,InternalTrayManager
Manages the tray icon life.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final I2PAppContextprotected JMenuItemprotected JMenuItemprotected MenuItemprotected MenuItemprotected booleanprotected final booleanprotected static final Stringprotected SystemTrayprotected TrayIcon -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTrayManager(I2PAppContext ctx, boolean useSwing) Instantiate tray manager. -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected StringaddMenu(String message, MenuCallback callback, MenuHandle p) protected voidconfigureNotifications(boolean enable) Does not save.voiddisableMenu(MenuHandle item) intdisplayMessage(int priority, String title, String message, String path) Send a notification to the user.voidenableMenu(MenuHandle item) protected abstract PopupMenuBuild a popup menu, adding callbacks to the different items.protected abstract JPopupMenuBuild a popup menu, adding callbacks to the different items.voidhideMenu(MenuHandle item) protected voidInitializes _jnotificationItem 1 and 2protected voidInitializes _notificationItem 1 and 2voidvoidremoveMenu(MenuHandle item) voidshowMenu(MenuHandle item) voidAdd the tray icon to the system tray and start everything up.voidRemove the tray icon from the system trayprotected abstract voidUpdate the menuvoidupdateMenu(String message, MenuHandle item)
-
Field Details
-
_appContext
-
_useSwing
protected final boolean _useSwing -
tray
-
trayIcon
-
_showNotifications
protected volatile boolean _showNotifications -
_notificationItem1
-
_notificationItem2
-
_jnotificationItem1
-
_jnotificationItem2
-
PROP_NOTIFICATIONS
- See Also:
-
-
Constructor Details
-
TrayManager
Instantiate tray manager.
-
-
Method Details
-
startManager
Add the tray icon to the system tray and start everything up.- Throws:
AWTException
-
stopManager
public void stopManager()Remove the tray icon from the system tray- Since:
- 0.9.26
-
languageChanged
public void languageChanged() -
getMainMenu
Build a popup menu, adding callbacks to the different items.- Returns:
- popup menu
-
getSwingMainMenu
Build a popup menu, adding callbacks to the different items.- Returns:
- popup menu
- Since:
- 0.9.26
-
updateMenu
protected abstract void updateMenu()Update the menu- Since:
- 0.9.26
-
displayMessage
Send a notification to the user.- Parameters:
title- for the popup, translatedmessage- translatedpath- unsupported- Returns:
- 0, or -1 on failure
-
configureNotifications
protected void configureNotifications(boolean enable) Does not save. See InternalTrayManager.- Since:
- 0.9.58 moved up from InternalTrayManager
-
initializeNotificationItems
protected void initializeNotificationItems()Initializes _notificationItem 1 and 2- Since:
- 0.9.58 pulled out of InternalTrayManager
-
initializeJNotificationItems
protected void initializeJNotificationItems()Initializes _jnotificationItem 1 and 2- Since:
- 0.9.58 pulled out of InternalTrayManager
-
addMenu
- Since:
- 0.9.59
-
removeMenu
- Since:
- 0.9.59
-
showMenu
- Since:
- 0.9.59
-
hideMenu
- Since:
- 0.9.59
-
enableMenu
- Since:
- 0.9.59
-
disableMenu
- Since:
- 0.9.59
-
updateMenu
- Since:
- 0.9.59
-
_t
-
_t
- Since:
- 0.9.26
-