abstract class TrayManager extends Object
Modifier and Type | Field and Description |
---|---|
protected I2PAppContext |
_appContext |
protected JMenuItem |
_jnotificationItem1 |
protected JMenuItem |
_jnotificationItem2 |
protected MenuItem |
_notificationItem1 |
protected MenuItem |
_notificationItem2 |
protected boolean |
_showNotifications |
protected boolean |
_useSwing |
protected static String |
PROP_NOTIFICATIONS |
protected SystemTray |
tray |
protected TrayIcon |
trayIcon |
Modifier | Constructor and Description |
---|---|
protected |
TrayManager(I2PAppContext ctx,
boolean useSwing)
Instantiate tray manager.
|
Modifier and Type | Method and Description |
---|---|
protected String |
_t(String s) |
protected String |
_t(String s,
Object o) |
MenuHandle |
addMenu(String message,
MenuCallback callback,
MenuHandle p) |
protected void |
configureNotifications(boolean enable)
Does not save.
|
void |
disableMenu(MenuHandle item) |
int |
displayMessage(int priority,
String title,
String message,
String path)
Send a notification to the user.
|
void |
enableMenu(MenuHandle item) |
protected abstract PopupMenu |
getMainMenu()
Build a popup menu, adding callbacks to the different items.
|
protected abstract JPopupMenu |
getSwingMainMenu()
Build a popup menu, adding callbacks to the different items.
|
void |
hideMenu(MenuHandle item) |
protected void |
initializeJNotificationItems()
Initializes _jnotificationItem 1 and 2
|
protected void |
initializeNotificationItems()
Initializes _notificationItem 1 and 2
|
void |
languageChanged() |
void |
removeMenu(MenuHandle item) |
void |
showMenu(MenuHandle item) |
void |
startManager()
Add the tray icon to the system tray and start everything up.
|
void |
stopManager()
Remove the tray icon from the system tray
|
protected abstract void |
updateMenu()
Update the menu
|
void |
updateMenu(String message,
MenuHandle item) |
protected final I2PAppContext _appContext
protected final boolean _useSwing
protected SystemTray tray
protected TrayIcon trayIcon
protected volatile boolean _showNotifications
protected MenuItem _notificationItem1
protected MenuItem _notificationItem2
protected JMenuItem _jnotificationItem1
protected JMenuItem _jnotificationItem2
protected static final String PROP_NOTIFICATIONS
protected TrayManager(I2PAppContext ctx, boolean useSwing)
public void startManager() throws AWTException
AWTException
public void stopManager()
public void languageChanged()
protected abstract PopupMenu getMainMenu()
protected abstract JPopupMenu getSwingMainMenu()
protected abstract void updateMenu()
public int displayMessage(int priority, String title, String message, String path)
title
- for the popup, translatedmessage
- translatedpath
- unsupportedprotected void configureNotifications(boolean enable)
protected void initializeNotificationItems()
protected void initializeJNotificationItems()
public MenuHandle addMenu(String message, MenuCallback callback, MenuHandle p)
public void removeMenu(MenuHandle item)
public void showMenu(MenuHandle item)
public void hideMenu(MenuHandle item)
public void enableMenu(MenuHandle item)
public void disableMenu(MenuHandle item)
public void updateMenu(String message, MenuHandle item)