Package net.i2p.desktopgui
Class ExternalMain
- java.lang.Object
-
- net.i2p.desktopgui.ExternalMain
-
- All Implemented Interfaces:
ClientApp
,NotificationService
public class ExternalMain extends Object implements ClientApp, NotificationService
A simplified Main that does not require router.jar, for App Context only. Invokes ExternalTrayManager only. No state tracking, ClientAppManager doesn't care.- Since:
- 0.9.54
-
-
Constructor Summary
Constructors Constructor Description ExternalMain()
ExternalMain(I2PAppContext ctx, ClientAppManager mgr, String[] args)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
cancel(int id)
Cancel a notification if possible.String
getDisplayName()
The display name of the ClientApp, used in user interfaces.String
getName()
The generic name of the ClientApp, used for registration, e.g.ClientAppState
getState()
The current state of the ClientApp.static void
main(String[] args)
int
notify(String source, String category, int priority, String title, String message, String path)
Send a notification to the user.void
shutdown(String[] args)
Do not take a long time.void
startup()
Do not take a long time.boolean
update(int id, String title, String message, String path)
Update the text of a notification if possible.
-
-
-
Constructor Detail
-
ExternalMain
public ExternalMain(I2PAppContext ctx, ClientAppManager mgr, String[] args)
-
ExternalMain
public ExternalMain()
-
-
Method Detail
-
main
public static void main(String[] args)
-
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
public boolean update(int id, String title, String message, String path)
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
-
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
public void shutdown(String[] args)
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
public ClientAppState getState()
Description copied from interface:ClientApp
The current state of the ClientApp.
-
getName
public String getName()
Description copied from interface:ClientApp
The generic name of the ClientApp, used for registration, e.g. "console". Do not translate.
-
getDisplayName
public String 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
-
-