Package docking.help

# Class HelpManager

java.lang.Object
docking.help.HelpManager

All Implemented Interfaces:
  `HelpService`

Direct Known Subclasses:
  `GhidraHelpService`, `TestHelpService`

public class HelpManager extends Object implements HelpService
Class that uses JavaHelp browser to show context sensitive help.

Note: this manager will validate all registered help when in development mode. In order to catch items that have not registered help at all, we rely on those items to register a default `HelpLocation` that will get flagged as invalid. Examples of this usage are the `DockingActionIf` and the `ComponentProvider` base classes.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `SHOW_AID_KEY`

  ### Fields inherited from interface help.HelpService

  `DUMMY_HELP_SET_NAME`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `HelpManager(URL url)`
  Constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addHelpSet(URL url, GHelpClassLoader classLoader)`
  Add the help set for the given URL.
  `void`
  `clearHelp(Object helpObject)`
  Removes this object from the help system.
  `void`
  `excludeFromHelp(Object helpObject)`
  Signals to the help system to ignore the given object when searching for and validating help.
  `HelpLocation`
  `getHelpLocation(Object helpObj)`
  Returns the registered (via `HelpService.registerHelp(Object, HelpLocation)` help location for the given object; null if there is no registered help.
  `protected String`
  `getHomeId()`
  Returns the 'home id' to be used by all help sets in the system (as opposed to allowing each help set to define its own home id.
  `Map<Object,HelpLocation>`
  `getInvalidHelpLocations(TaskMonitor monitor)`
  `GHelpSet`
  `getMasterHelpSet()`
  Returns the master help set (the one into which all other help sets are merged).
  `boolean`
  `helpExists()`
  Returns true if the help system has been initialized properly; false if help does not exist or is not working.
  `boolean`
  `isExcludedFromHelp(Object helpObject)`
  Returns true if the given object is meant to be ignored by the help system
  `protected void`
  `mergePendingHelpSets()`
  `void`
  `registerDynamicHelp(Object helpObject, DynamicHelpLocation helpLocation)`
  Registers a provider of dynamic help.
  `protected void`
  `registerHelp()`
  `void`
  `registerHelp(Object helpObject, HelpLocation location)`
  Register help for a specific object.
  `void`
  `reload()`
  Called when a major system even happens, such as changing the system theme.
  `void`
  `showHelp(HelpLocation loc)`
  Display the help page for the given help location.
  `void`
  `showHelp(Object helpObj, boolean infoOnly, Component owner)`
  Display the Help content identified by the help object.
  `void`
  `showHelp(URL url)`
  Display the help page for the given URL.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### SHOW_AID_KEY

    public static final String SHOW_AID_KEY
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### HelpManager

    protected HelpManager(URL url) throws javax.help.HelpSetException
    Constructor.
    Parameters:
      `url` - url for the main HelpSet file for the application.
    Throws:
      `javax.help.HelpSetException` - if HelpSet could not be created

- ## Method Details

  - ### registerHelp

    protected void registerHelp()

  - ### helpExists

    public boolean helpExists()
    Description copied from interface: `HelpService`
    Returns true if the help system has been initialized properly; false if help does not exist or is not working.
    Specified by:
      `helpExists` in interface `HelpService`
    Returns:
      true if the help system has found the applications help content and has finished initializing

  - ### addHelpSet

    public void addHelpSet(URL url, GHelpClassLoader classLoader) throws javax.help.HelpSetException
    Add the help set for the given URL.
    Parameters:
      `url` - url for the HelpSet (.hs) file
      `classLoader` - the help classloader that knows how to find help modules in the classpath
    Throws:
      `javax.help.HelpSetException` - if the help set could not be created from the given URL.

  - ### getHomeId

    protected String getHomeId()
    Returns the 'home id' to be used by all help sets in the system (as opposed to allowing each help set to define its own home id.
    Returns:
      the home id

  - ### getMasterHelpSet

    public GHelpSet getMasterHelpSet()
    Returns the master help set (the one into which all other help sets are merged).
    Returns:
      the help set

  - ### excludeFromHelp

    public void excludeFromHelp(Object helpObject)
    Description copied from interface: `HelpService`
    Signals to the help system to ignore the given object when searching for and validating help. Once this method has been called, no help can be registered for the given object.
    Specified by:
      `excludeFromHelp` in interface `HelpService`
    Parameters:
      `helpObject` - the object to exclude from the help system.

  - ### isExcludedFromHelp

    public boolean isExcludedFromHelp(Object helpObject)
    Description copied from interface: `HelpService`
    Returns true if the given object is meant to be ignored by the help system
    Specified by:
      `isExcludedFromHelp` in interface `HelpService`
    Parameters:
      `helpObject` - the object to check
    Returns:
      true if ignored
    See Also:
      - `HelpService.excludeFromHelp(Object)`

  - ### clearHelp

    public void clearHelp(Object helpObject)
    Description copied from interface: `HelpService`
    Removes this object from the help system. This method is useful, for example, when a single Java `Component` will have different help locations assigned over its lifecycle.
    Specified by:
      `clearHelp` in interface `HelpService`
    Parameters:
      `helpObject` - the object for which to clear help

  - ### registerDynamicHelp

    public void registerDynamicHelp(Object helpObject, DynamicHelpLocation helpLocation)
    Description copied from interface: `HelpService`
    Registers a provider of dynamic help. See `DynamicHelpLocation` for more information.
    Specified by:
      `registerDynamicHelp` in interface `HelpService`
    Parameters:
      `helpObject` - the object to associate the specified help location with
      `helpLocation` - the dynamic help location

  - ### registerHelp

    public void registerHelp(Object helpObject, HelpLocation location)
    Description copied from interface: `HelpService`
    Register help for a specific object.

    Do not call this method will a `null` help location. Instead, to signal that an item has no help, call `HelpService.excludeFromHelp(Object)`.

    Specified by:
      `registerHelp` in interface `HelpService`
    Parameters:
      `helpObject` - the object to associate the specified help location with
      `location` - help content location

  - ### getHelpLocation

    public HelpLocation getHelpLocation(Object helpObj)
    Description copied from interface: `HelpService`
    Returns the registered (via `HelpService.registerHelp(Object, HelpLocation)` help location for the given object; null if there is no registered help.
    Specified by:
      `getHelpLocation` in interface `HelpService`
    Parameters:
      `helpObj` - The object for which to find a registered HelpLocation.
    Returns:
      the registered HelpLocation
    See Also:
      - `HelpService.registerHelp(Object, HelpLocation)`

  - ### reload

    public void reload()
    Description copied from interface: `HelpService`
    Called when a major system even happens, such as changing the system theme.
    Specified by:
      `reload` in interface `HelpService`

  - ### showHelp

    public void showHelp(URL url)
    Description copied from interface: `HelpService`
    Display the help page for the given URL. This is a specialty method for displaying help when a specific file is desired, like an introduction page. Showing help for objects within the system is accomplished by calling `HelpService.showHelp(Object, boolean, Component)`.
    Specified by:
      `showHelp` in interface `HelpService`
    Parameters:
      `url` - the URL to display
    See Also:
      - `HelpService.showHelp(Object, boolean, Component)`

  - ### showHelp

    public void showHelp(HelpLocation loc)
    Description copied from interface: `HelpService`
    Display the help page for the given help location.
    Specified by:
      `showHelp` in interface `HelpService`
    Parameters:
      `loc` - the location to display.
    See Also:
      - `HelpService.showHelp(Object, boolean, Component)`

  - ### showHelp

    public void showHelp(Object helpObj, boolean infoOnly, Component owner)
    Description copied from interface: `HelpService`
    Display the Help content identified by the help object.
    Specified by:
      `showHelp` in interface `HelpService`
    Parameters:
      `helpObj` - the object to which help was previously registered
      `infoOnly` - display `HelpLocation` information only, not the help UI
      `owner` - requesting component
    See Also:
      - `HelpService.registerHelp(Object, HelpLocation)`

  - ### getInvalidHelpLocations

    public Map<Object,HelpLocation> getInvalidHelpLocations(TaskMonitor monitor) throws CancelledException
    Throws:
      `CancelledException`

  - ### mergePendingHelpSets

    protected void mergePendingHelpSets()