Using help sets for context sensitive help

As described in 'Using help sets in a Java application', JavaHelp help sets can be used from Java applications quite well. Another way of using a help set in Java applications is to provide context sensitive help with it.

If there is an element in an application such as a dialog for instance, a help button could be placed on that dialog to show information about the dialogs usage.

Finding the identifier for a help topic

HelpExpert automatically maintains a directory mapping all topics of a documentation project to unique identifiers (the map file). The identifiers can be used to directly address help topics from out of an application.

To find out the identifier of a particular help topic within HelpExpert

The map target ID is a unique String identifier such as 'item52' which is created for each help topic by HelpExpert automatically.

Providing context sensitive help

To provide context sensitive help

This will display the chosen topic in the common help set viewer.

Code Example

The following Java code example documents, how a help set can be called directly from out of an application.

try {

URL hsUrl = new URL("jar:file:/c:/programs/myapp/myapp.jar!/myappHelp.hs");

HelpSet hs = new HelpSet(null, hsUrl);

DefaultHelpBroker hb = new DefaultHelpBroker(hs);

hb.setCurrentID("item52");

hb.setActivationWindow(this);

hb.setDisplayed(true);

}

catch (Exception e) {

System.out.println("HelpSet could not be opened");

}

See also

Using help sets in a Java application