Package net.i2p.router.web
Class NavHelper
java.lang.Object
net.i2p.router.web.NavHelper
- All Implemented Interfaces:
ClientApp,NavService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Retrieve binary icon for a pluginTranslated string is loaded by PluginStarterFor HomeHelper.The display name of the ClientApp, used in user interfaces.static NavHelperstatic NavHelpergetInstance(I2PAppContext ctx) getName()The generic name of the ClientApp, used for registration, e.g.getState()The current state of the ClientApp.voidTo register a new client application so that it shows up on the router console's nav bar, it should be registered with this singleton.voidStore binary icon for a pluginvoidDo not take a long time.voidstartup()Do not take a long time.voidunregisterApp(String name)
-
Constructor Details
-
NavHelper
public NavHelper()
-
-
Method Details
-
registerApp
public 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.- Specified by:
registerAppin interfaceNavService- Parameters:
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 null- Since:
- 0.9.20 added iconpath parameter
-
unregisterApp
- Specified by:
unregisterAppin interfaceNavService- Parameters:
name- standard name for the app
-
getBinary
Retrieve binary icon for a plugin- Parameters:
name- plugin name- Returns:
- null if not found
- Since:
- 0.9.25
-
setBinary
Store binary icon for a plugin- Parameters:
name- plugin name- Since:
- 0.9.25
-
getClientAppLinks
Translated string is loaded by PluginStarter- Returns:
- map of translated name to HTML string, or null if none
-
getClientApps
For HomeHelper. 32x32 icon paths.- Parameters:
ctx- unused- Returns:
- non-null, possibly empty, unsorted
- Since:
- 0.9, public since 0.9.33, was package private
-
getInstance
- Since:
- 0.9.56
-
getInstance
- Since:
- 0.9.56
-
startup
public void startup()Description copied from interface:ClientAppDo 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:ClientAppDo 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:ClientAppThe current state of the ClientApp. -
getName
Description copied from interface:ClientAppThe generic name of the ClientApp, used for registration, e.g. "console". Do not translate. -
getDisplayName
Description copied from interface:ClientAppThe display name of the ClientApp, used in user interfaces. The app must translate.- Specified by:
getDisplayNamein interfaceClientApp- Returns:
- non-null
- Since:
- 0.9.56
-