Using Screen-Level Context-Sensitive Help

You should now have a TypeFacer application in which the user can open the HelpSet Viewer to a default help topic. You can enhance the help system by using screen-level context-sensitive help. You need to program the help system to know the user’s current location within the application. The help system then displays a relevant topic when the user calls for help.

The TypeFacer application has two screens through which the user sets text and background properties. Figure 7.3 shows these Typeface View and Color View screens.

Typeface Tester’s two screens

Figure 7-3. Typeface Tester’s two screens

Other applications might have similar modes (for example, “edit mode” and “outline mode”) or might have separate screens for different application tasks. Either way, the active mode or screen serves as a good indicator of which help topics the user might need. Rather than starting with the HelpSet’s default help topic, you can go directly to the help topic for the active mode or screen.

Programming Screen-Level Context-Sensitive Help

Programming context-sensitive help is straightforward using the JavaHelp API’s CSH (context-sensitive help) class. You don’t change how the HelpSet is loaded; you simply connect a help topic to each combination of a screen context (Typefaces screen or Colors screen) and a help activator (menu item, button, or function key).

Use the following steps to make ...

Get Creating Effective JavaHelp now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.