2012年7月25日 星期三

Java HelpSet


[In application ]
ClassLoader loader;
HelpSet hs;
loader = IMenuBar.class.getClassLoader();
URL url = HelpSet.findHelpSet(loader, "iMarkerHelpSet");

try{
hs = new HelpSet(loader, url);
}catch( HelpSetException e){
System.err.println("Error loading HelpSet");
return;
}

HelpBroker helpbroker = hs.createHelpBroker("iMarkerHelp");
//HelpBroker helpbroker = hs.createHelpBroker("iViewerHelp");

helpbroker.enableHelpOnButton(menuitemHelpManual, "overview", hs);
----------------------------

where iMarkerHelpSet is a helpset file (iMarkerHelpSet.hs) which is the main configuration file of the help menu.
All files referenced by this helpset file need to be in place. for example:
1. iMarkerMap.jhm - All mapping of target to url are defined here.
2. iMarkerGlossary.xml - define the items shown in glossary
3. iMarkerTOC.xml - specifying the toc hierarchy using mapID

沒有留言:

張貼留言