Class NavHelper

    • Constructor Detail

      • NavHelper

        public NavHelper()
    • Method Detail

      • 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:
        registerApp in interface NavService
        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 name
        path - full path pointing to the application's root (e.g. /i2ptunnel/index.jsp), non-null
        tooltip - HTML escaped text or null
        iconpath - path-only URL starting with /, HTML escaped, or null
        Since:
        0.9.20 added iconpath parameter
      • unregisterApp

        public void unregisterApp​(String name)
        Specified by:
        unregisterApp in interface NavService
        Parameters:
        name - standard name for the app
      • getBinary

        public byte[] getBinary​(String name)
        Retrieve binary icon for a plugin
        Parameters:
        name - plugin name
        Returns:
        null if not found
        Since:
        0.9.25
      • setBinary

        public void setBinary​(String name,
                              byte[] arr)
        Store binary icon for a plugin
        Parameters:
        name - plugin name
        Since:
        0.9.25
      • getClientAppLinks

        public Map<String,​String> getClientAppLinks()
        Translated string is loaded by PluginStarter
        Returns:
        map of translated name to HTML string, or null if none
      • getClientApps

        public List<App> getClientApps​(I2PAppContext ctx)
        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

        public static NavHelper getInstance()
        Since:
        0.9.56
      • 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.
        Specified by:
        startup in interface ClientApp
        Since:
        0.9.56
      • 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.
        Specified by:
        shutdown in interface ClientApp
        Parameters:
        args - generally null but could be stopArgs from clients.config
        Since:
        0.9.56
      • getState

        public ClientAppState getState()
        Description copied from interface: ClientApp
        The current state of the ClientApp.
        Specified by:
        getState in interface ClientApp
        Returns:
        non-null
        Since:
        0.9.56
      • getName

        public String getName()
        Description copied from interface: ClientApp
        The generic name of the ClientApp, used for registration, e.g. "console". Do not translate.
        Specified by:
        getName in interface ClientApp
        Returns:
        non-null
        Since:
        0.9.56
      • 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 interface ClientApp
        Returns:
        non-null
        Since:
        0.9.56