Console: Make NavHelper non-static

add NavService interface
hang off ClientAppManager
i2psnark: register additional instances with NavService
This commit is contained in:
zzz
2022-10-19 15:33:53 -04:00
parent f83f467b28
commit 0224a0f03b
9 changed files with 116 additions and 19 deletions

View File

@ -0,0 +1,29 @@
package net.i2p.app;
/**
* Service to put links on the console.
* Here so webapps can use it without dependency on console.
*
* @since 0.9.56 adapted from console NavHelper
*/
public interface NavService {
/**
* 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.
*
* @param appName standard name for the app (plugin)
* @param displayName translated name the app will be called in the link
* warning, this is the display name aka ConsoleLinkName, not the plugin name
* @param path full path pointing to the application's root
* (e.g. /i2ptunnel/index.jsp), non-null
* @param tooltip HTML escaped text or null
* @param iconpath path-only URL starting with /, HTML escaped, or null
*/
public void registerApp(String appName, String displayName, String path, String tooltip, String iconpath);
/**
* @param name standard name for the app
*/
public void unregisterApp(String name);
}