Creating context-sensitive JavaHelp is a collaborative effort between authors and developers. JavaHelp supports context-sensitive Help, but all of the code to make it work properly must be written and customized by your developer.
Your developer manually adds the string to the application code so the Help can be invoked. The Java application "calls" the context sensitive Help using the string.
The JavaHelp equivalent of the .HH file for context-sensitive Help is the .JHM file. It is a good idea to print a copy of the .JHM file for your application developer to use while working on context-sensitive Help.
The example below shows one way to invoke a JavaHelp Help set:
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;
}
}