public class NavHelper extends Object implements NavService, ClientApp
Constructor and Description |
---|
NavHelper() |
Modifier and Type | Method and Description |
---|---|
byte[] |
getBinary(String name)
Retrieve binary icon for a plugin
|
Map<String,String> |
getClientAppLinks()
Translated string is loaded by PluginStarter
|
List<App> |
getClientApps(I2PAppContext ctx)
For HomeHelper.
|
String |
getDisplayName()
The display name of the ClientApp, used in user interfaces.
|
static NavHelper |
getInstance() |
static NavHelper |
getInstance(I2PAppContext ctx) |
String |
getName()
The generic name of the ClientApp, used for registration,
e.g.
|
ClientAppState |
getState()
The current state of the ClientApp.
|
void |
registerApp(String appName,
String displayName,
String path,
String tooltip,
String iconpath)
To register a new client application so that it shows up on the router
console's nav bar, it should be registered with this singleton.
|
void |
setBinary(String name,
byte[] arr)
Store binary icon for a plugin
|
void |
shutdown(String[] args)
Do not take a long time.
|
void |
startup()
Do not take a long time.
|
void |
unregisterApp(String name) |
public void registerApp(String appName, String displayName, String path, String tooltip, String iconpath)
registerApp
in interface NavService
appName
- standard name for the app (plugin)displayName
- translated name the app will be called in the link
warning, this is the display name aka ConsoleLinkName, not the plugin namepath
- full path pointing to the application's root
(e.g. /i2ptunnel/index.jsp), non-nulltooltip
- HTML escaped text or nulliconpath
- path-only URL starting with /, HTML escaped, or nullpublic void unregisterApp(String name)
unregisterApp
in interface NavService
name
- standard name for the apppublic byte[] getBinary(String name)
name
- plugin namepublic void setBinary(String name, byte[] arr)
name
- plugin namepublic Map<String,String> getClientAppLinks()
public List<App> getClientApps(I2PAppContext ctx)
ctx
- unusedpublic static NavHelper getInstance()
public static NavHelper getInstance(I2PAppContext ctx)
public void startup()
ClientApp
public void shutdown(String[] args)
ClientApp
public ClientAppState getState()
ClientApp
public String getName()
ClientApp
public String getDisplayName()
ClientApp
getDisplayName
in interface ClientApp