
255
USING ROBOHELP HTML 9
Context-sensitive Help
Last updated 12/14/2011
Example:
public class ContextHelp
{
private HelpSet hs;
private HelpBroker hb;
public boolean ShowHelp(String strTopic, String strHelpSet){
if (hb == null) {
ClassLoader loader = getClass().getClassLoader();
URL url;
try {
url = HelpSet.findHelpSet(loader, strHelpSet);
hs = new HelpSet(loader, url);
}
catch (Exception e) {
return false;
}
hb = hs.createHelpBroker();
}
hb.setCurrentID(strTopic);
hb.setDisplayed(true);
return true;
}
}
Test context-sensitive JavaHelp
Testing context-sensitive JavaHelp involves authors and developers.
Compress The Project
Compile the project and create a .JAR file. Give the .JAR to your developer.
Test Context-Sensitive Topics
Test topics in the application to ensure they appear in the correct dialogs and windows.
Resolve Errors
Work with your developer to solve any problems.
Create context-sensitive Oracle Help
Note:
This information is for developers who need to connect context-sensitive Oracle Help topics to applications.
The context-sensitive Help API and support files let you call built-in functionality instead of having to create the
functions to display topics.
Oracle Help supports context-sensitive Help, but your developer must write and customize the code to make it work.
A working example of a Java application with context-sensitive Help is shown below. To run the example:
1
Ensure that you have the Oracle Help for Java components and the Sun Java 2 SDK or later.
2
Copy and paste the code below into a file called CSHDemo.java.
3
Compile the file (for example, javac CSHDemo.java).
4
Run the Java applet (for example, java .cSHDemo <Oracle Help Helpset file>). The Oracle Help helpset file
parameter is the fully-qualified path to the helpset file. As an example, if you create an Oracle Help helpset file named
"sample.hs" and saved it in "C:\myFiles," the command to run this application with your helpset file would be:
java CSHDemo C:\myFiles\Sample.hs