Invocation Mechanisms

Users invoke online help from within applications in a number of ways. This section describes invocation methods available through the JavaHelp system.

Menus and Buttons

Online help is often invoked when a user chooses an item from a Help menu or clicks on a Help button in an application GUI.

The JavaHelp system provides a simple interface by which an application requests that a topic ID be displayed. The JavaHelp system then associates the topic ID with the appropriate URL and displays it. IDs are mapped to URLs in a JavaHelp system metadata file called the map file.

For example, when coding a file chooser dialog box, a developer requests that the topic ID fc_help be displayed when the Help button at the bottom of the dialog box is clicked. In the map file the ID fc_help is defined to be a file named FileChooser.html using the following XML syntax:

<mapID target="fc_help" url="html/help/FileChooser.html" />

Separating the specification of file names (or URLs) from the program code provides content authors the freedom to control the information that is associated with the topic ID.

Tooltips

A tooltip is a brief message presented to the user when the cursor remains over a button for an interval longer than a given threshold.

Although tooltip information could be included in the JavaHelp system data, it will usually be delivered as part of the application and will be co-located with the code. Tooltip functionality is provided as a component in Swing.

Context-Sensitive Help

The JavaHelp system provides the ability to invoke online help that describes graphical components in an application GUI. The user makes gestures that activate context-sensitive help and then specifies the component in question. The ID associated with the component is displayed.

Viewer Initiated Help

You can display help topics from a TOC or index navigator or from the content pane of the main window. By default, an index entry and a TOC entry display help in the main window's content viewer. You can also define an entry that displays help in a popup or a secondary window. In the content pane, you can define an <object> tag that displays help in a separate popup or secondary window. If you use a standard HTML link in the content pane, the linked help topic replaces the current one in the content pane.

System Initiated Context-Sensitive Help

The following invocation would display system-initiated help in a main window.

mainHelpBroker.setCurrentID(helpID); 

Next Overview Topic: Presentation and Deployment