Package docking.help
Class HelpManager
- java.lang.Object
-
- docking.help.HelpManager
-
- All Implemented Interfaces:
HelpService
- Direct Known Subclasses:
GhidraHelpService,TestHelpService
public class HelpManager extends java.lang.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
HelpLocationthat will get flagged as invalid. Examples of this usage are theDockingActionIfand theComponentProviderbase classes.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSHOW_AID_KEY-
Fields inherited from interface docking.help.HelpService
DUMMY_HELP_SET_NAME
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedHelpManager(java.net.URL url)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHelpSet(java.net.URL url, GHelpClassLoader classLoader)Add the help set for the given URL.voidclearHelp(java.lang.Object helpObject)Removes this object from the help system.voidexcludeFromHelp(java.lang.Object helpObject)Signals to the help system to ignore the given object when searching for and validating help.HelpLocationgetHelpLocation(java.lang.Object helpObj)Returns the registered (viaHelpService.registerHelp(Object, HelpLocation)help location for the given object; null if there is no registered help.java.util.Map<java.lang.Object,HelpLocation>getInvalidHelpLocations(TaskMonitor monitor)GHelpSetgetMasterHelpSet()Returns the master help set (the one into which all other help sets are merged).booleanhelpExists()Returns true if the help system has been initialized properly; false if help does not exist or is not working.booleanisExcludedFromHelp(java.lang.Object helpObject)Returns true if the given object is meant to be ignored by the help systemprotected voidmergePendingHelpSets()protected voidregisterHelp()voidregisterHelp(java.lang.Object helpObject, HelpLocation location)Register help for a specific object.voidshowHelp(HelpLocation loc)Display the help page for the given help location.voidshowHelp(java.lang.Object helpObj, boolean infoOnly, java.awt.Component owner)Display the Help content identified by the help object.voidshowHelp(java.net.URL url)Display the help page for the given URL.
-
-
-
Field Detail
-
SHOW_AID_KEY
public static final java.lang.String SHOW_AID_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
registerHelp
protected void registerHelp()
-
helpExists
public boolean helpExists()
Description copied from interface:HelpServiceReturns true if the help system has been initialized properly; false if help does not exist or is not working.- Specified by:
helpExistsin interfaceHelpService- Returns:
- true if the help system has found the applications help content and has finished initializing
-
addHelpSet
public void addHelpSet(java.net.URL url, GHelpClassLoader classLoader) throws javax.help.HelpSetExceptionAdd the help set for the given URL.- Parameters:
url- url for the HelpSet (.hs) fileclassLoader- 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.
-
excludeFromHelp
public void excludeFromHelp(java.lang.Object helpObject)
Description copied from interface:HelpServiceSignals 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:
excludeFromHelpin interfaceHelpService- Parameters:
helpObject- the object to exclude from the help system.
-
isExcludedFromHelp
public boolean isExcludedFromHelp(java.lang.Object helpObject)
Description copied from interface:HelpServiceReturns true if the given object is meant to be ignored by the help system- Specified by:
isExcludedFromHelpin interfaceHelpService- Parameters:
helpObject- the object to check- Returns:
- true if ignored
- See Also:
HelpService.excludeFromHelp(Object)
-
clearHelp
public void clearHelp(java.lang.Object helpObject)
Description copied from interface:HelpServiceRemoves this object from the help system. This method is useful, for example, when a single JavaComponentwill have different help locations assigned over its lifecycle.- Specified by:
clearHelpin interfaceHelpService- Parameters:
helpObject- the object for which to clear help
-
registerHelp
public void registerHelp(java.lang.Object helpObject, HelpLocation location)Description copied from interface:HelpServiceRegister help for a specific object.Do not call this method will a
nullhelp location. Instead, to signal that an item has no help, callHelpService.excludeFromHelp(Object).- Specified by:
registerHelpin interfaceHelpService- Parameters:
helpObject- the object to associate the specified help location withlocation- help content location
-
getHelpLocation
public HelpLocation getHelpLocation(java.lang.Object helpObj)
Description copied from interface:HelpServiceReturns the registered (viaHelpService.registerHelp(Object, HelpLocation)help location for the given object; null if there is no registered help.- Specified by:
getHelpLocationin interfaceHelpService- Parameters:
helpObj- The object for which to find a registered HelpLocation.- Returns:
- the registered HelpLocation
- See Also:
HelpService.registerHelp(Object, HelpLocation)
-
getMasterHelpSet
public GHelpSet getMasterHelpSet()
Returns the master help set (the one into which all other help sets are merged).- Returns:
- the help set
-
showHelp
public void showHelp(java.net.URL url)
Description copied from interface:HelpServiceDisplay 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 callingHelpService.showHelp(Object, boolean, Component).- Specified by:
showHelpin interfaceHelpService- Parameters:
url- the URL to display- See Also:
HelpService.showHelp(Object, boolean, Component)
-
showHelp
public void showHelp(HelpLocation loc)
Description copied from interface:HelpServiceDisplay the help page for the given help location.- Specified by:
showHelpin interfaceHelpService- Parameters:
loc- the location to display.- See Also:
HelpService.showHelp(Object, boolean, Component)
-
showHelp
public void showHelp(java.lang.Object helpObj, boolean infoOnly, java.awt.Component owner)Description copied from interface:HelpServiceDisplay the Help content identified by the help object.- Specified by:
showHelpin interfaceHelpService- Parameters:
helpObj- the object to which help was previously registeredinfoOnly- displayHelpLocationinformation only, not the help UIowner- requesting component- See Also:
HelpService.registerHelp(Object, HelpLocation)
-
getInvalidHelpLocations
public java.util.Map<java.lang.Object,HelpLocation> getInvalidHelpLocations(TaskMonitor monitor) throws CancelledException
- Throws:
CancelledException
-
mergePendingHelpSets
protected void mergePendingHelpSets()
-
-