Oracle Help for Java Developer's Guide | ![]() Contents | ![]() Previous | ![]() Next |
---|
A "context-sensitive" help topic is one that is associated with a context in a product's user interface and which can be launched from that context. For example, a context-sensitive help system may contain topics that describe the product's menus and dialog boxes. When a user requests help for one of those controls, the appropriate topic for that control is displayed.
Oracle Help for Java provides mechanisms for associating help topics with user interface controls and for launching context-sensitive help when the user presses the F1 key or selects Help from a right-click context menu. OHJ also provides an API for explicitly displaying the help topic associated with a component.
To provide context-sensitive help for an application, the help system source must include one or more map files and you have to add the appropriate help code to your application code, as described in these sections:
A context-sensitive help system must include one or more map files that map topic IDs to help topics. (Projects differ, but this map file is often created by the help author, not the programmer.) OHJ supports two kinds of map files:
When an OHJ system is implemented using a HelpBook
, the map file must use the "OHT" file format. (HelpBook
s and OHT files are legacies from early versions of OHJ and are no longer recommended, but they are still supported by OHJ.)
When an OHJ system is implemented using a HelpSet
, the map file must use the newer XML file format, which is now the recommended format for Oracle Help systems. For more information about this map file, see Map File.
For information about HelpSets
and HelpBooks
, see Adding OHJ to Your Application.
You may want to define a set of Java constants in your application code that map to topic IDs in the map file. When using OHJ methods that require topic IDs (such as Help.showTopic()
), you can use the constant variable names instead of using explicit topic IDs from the map file. This helps you avoid changing code in several places if topic IDs in the map file are changed later. This is particularly useful when help authors are responsible for maintaining map files.
The standard Java toolkits (AWT and Swing) do not include built-in mechanisms for associating help topics with components. However, OHJ provides a generic way to implement context-sensitive help in Java applications, using the OHJ CSHManager
(Context-Sensitive Help Manager) class. This help manager provides a way to associate help topics with user interface components and to enable F1 and right-click context-sensitive help.
For instructions on how to use CSHManager
, see Using CSHManager
to Implement Context-Sensitive Help.
Copyright © 1996, 2004, Oracle. All rights reserved.