abstract class TrayManager extends Object
| Modifier and Type | Field and Description |
|---|---|
protected I2PAppContext | _appContext_appContext. |
protected JMenuItem | _jnotificationItem1_jnotificationItem1. |
protected JMenuItem | _jnotificationItem2_jnotificationItem2. |
protected MenuItem | _notificationItem1_notificationItem1. |
protected MenuItem | _notificationItem2_notificationItem2. |
protected boolean | _showNotifications_showNotifications. |
protected boolean | _useSwing_useSwing. |
protected static String | PROP_NOTIFICATIONSPROP_NOTIFICATIONS. |
protected SystemTray | traytray. |
protected TrayIcon | trayIcontrayIcon. |
| Modifier | Constructor and Description |
|---|---|
protected | TrayManager(I2PAppContext ctx,
boolean useSwing)Create a new tray manager. |
| Modifier and Type | Method and Description |
|---|---|
protected String | _t(String s)Translate a string. |
protected String | _t(String s,
Object o)Translate a string with one parameter. |
protected void | configureNotifications(boolean enable)Does not save. |
int | displayMessage(int priority,
String title,
String message,
String path)Send a notification to the user. |
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. |
protected void | initializeJNotificationItems()Initializes _jnotificationItem 1 and 2 |
protected void | initializeNotificationItems()Initializes _notificationItem 1 and 2 |
void | languageChanged()Update the tray menu when the language changes. |
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 |
protected final I2PAppContext _appContext
protected JMenuItem _jnotificationItem1
protected JMenuItem _jnotificationItem2
protected MenuItem _notificationItem1
protected MenuItem _notificationItem2
protected volatile boolean _showNotifications
protected final boolean _useSwing
protected static final String PROP_NOTIFICATIONS
protected SystemTray tray
protected TrayIcon trayIcon
protected TrayManager(I2PAppContext ctx, boolean useSwing)
ctx - the I2P application contextuseSwing - true to use Swing components, false for AWTprotected String _t(String s)
s - the string to translateprotected String _t(String s, Object o)
s - the string to translateo - the parameter to insertprotected void configureNotifications(boolean enable)
public int displayMessage(int priority,
String title,
String message,
String path)title - for the popup, translatedmessage - translatedpath - unsupportedprotected abstract PopupMenu getMainMenu()
protected abstract JPopupMenu getSwingMainMenu()
protected void initializeJNotificationItems()
protected void initializeNotificationItems()
public void languageChanged()
public void startManager()
throws AWTExceptionAWTException - if the system tray is not supportedpublic void stopManager()
protected abstract void updateMenu()