Package net.i2p.desktopgui
Class Main
java.lang.Object
net.i2p.desktopgui.Main
- All Implemented Interfaces:
ClientApp
,MenuService
,NotificationService
,RouterApp
The main class of the application.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddMenu
(String message, MenuCallback callback) Menu will start out shown and enabled, in the root menuaddMenu
(String message, MenuCallback callback, MenuHandle parent) Menu will start out enabled, as a submenuboolean
cancel
(int id) Cancel a notification if possible.void
disableMenu
(MenuHandle item) void
enableMenu
(MenuHandle item) The display name of the ClientApp, used in user interfaces.getName()
The generic name of the ClientApp, used for registration, e.g.getState()
The current state of the ClientApp.void
hideMenu
(MenuHandle item) static void
int
Send a notification to the user.void
removeMenu
(MenuHandle item) void
showMenu
(MenuHandle item) void
Do not take a long time.void
startup()
Do not take a long time.boolean
Update the text of a notification if possible.void
updateMenu
(String message, MenuHandle item)
-
Field Details
-
PROP_ENABLE
- See Also:
-
-
Constructor Details
-
Main
- Since:
- 0.9.26
-
Main
public Main()- Since:
- 0.9.26
-
-
Method Details
-
main
-
notify
public int notify(String source, String category, int priority, String title, String message, String path) Send a notification to the user.- Specified by:
notify
in interfaceNotificationService
- Parameters:
source
- unsupportedcategory
- unsupportedpriority
- unsupportedtitle
- for the popup, translatedmessage
- translatedpath
- unsupported- Returns:
- 0, or -1 on failure
-
cancel
public boolean cancel(int id) Cancel a notification if possible. Unsupported.- Specified by:
cancel
in interfaceNotificationService
- Parameters:
id
- as received from notify()- Returns:
- false always
-
update
Update the text of a notification if possible. Unsupported.- Specified by:
update
in interfaceNotificationService
- Parameters:
id
- as received from notify()title
- for the popup, translatedmessage
- translatedpath
- in console starting with /, must be URL-escaped, or null- Returns:
- false always
-
addMenu
Menu will start out shown and enabled, in the root menu- Specified by:
addMenu
in interfaceMenuService
- Parameters:
message
- for the menu, translatedcallback
- fired on click- Returns:
- null on error
- Since:
- 0.9.59
-
addMenu
Menu will start out enabled, as a submenu- Specified by:
addMenu
in interfaceMenuService
- Parameters:
message
- for the menu, translatedcallback
- fired on clickparent
- the parent menu this will be a submenu of, or null for top level- Returns:
- null on error
- Since:
- 0.9.59
-
removeMenu
- Specified by:
removeMenu
in interfaceMenuService
- Since:
- 0.9.59
-
showMenu
- Specified by:
showMenu
in interfaceMenuService
- Since:
- 0.9.59
-
hideMenu
- Specified by:
hideMenu
in interfaceMenuService
- Since:
- 0.9.59
-
enableMenu
- Specified by:
enableMenu
in interfaceMenuService
- Since:
- 0.9.59
-
disableMenu
- Specified by:
disableMenu
in interfaceMenuService
- Since:
- 0.9.59
-
updateMenu
- Specified by:
updateMenu
in interfaceMenuService
- Since:
- 0.9.59
-
startup
public void startup()Description copied from interface:ClientApp
Do not take a long time. Do not block. Start threads here if necessary. Client must call ClientAppManager.notify() at least once within this method to change the state from INITIALIZED to something else. Will not be called multiple times on the same object. -
shutdown
Description copied from interface:ClientApp
Do not take a long time. Do not block. Use a thread if necessary. If previously running, client must call ClientAppManager.notify() at least once within this method to change the state to STOPPING or STOPPED. May be called multiple times on the same object, in any state. -
getState
Description copied from interface:ClientApp
The current state of the ClientApp. -
getName
Description copied from interface:ClientApp
The generic name of the ClientApp, used for registration, e.g. "console". Do not translate. -
getDisplayName
Description copied from interface:ClientApp
The display name of the ClientApp, used in user interfaces. The app must translate.- Specified by:
getDisplayName
in interfaceClientApp
- Returns:
- non-null
- Since:
- 0.9.26
-