use of javax.help.HelpBroker in project zaproxy by zaproxy.
the class ExtensionFactory method unloadHelpSet.
private static void unloadHelpSet(Extension ext) {
HelpBroker hb = ExtensionHelp.getHelpBroker();
if (hb == null) {
return;
}
URL helpSetUrl = getExtensionHelpSetUrl(ext);
if (helpSetUrl != null) {
HelpSet baseHelpSet = hb.getHelpSet();
Enumeration<?> helpSets = baseHelpSet.getHelpSets();
while (helpSets.hasMoreElements()) {
HelpSet extensionHelpSet = (HelpSet) helpSets.nextElement();
if (helpSetUrl.equals(extensionHelpSet.getHelpSetURL())) {
baseHelpSet.remove(extensionHelpSet);
break;
}
}
}
}
use of javax.help.HelpBroker in project zaproxy by zaproxy.
the class ExtensionFactory method intitializeHelpSet.
/**
* If there are help files within the extension, they are loaded and merged
* with existing help files if the core help was correctly loaded.
* @param ext the extension being initialised
*/
private static void intitializeHelpSet(Extension ext) {
HelpBroker hb = ExtensionHelp.getHelpBroker();
if (hb == null) {
return;
}
URL helpSetUrl = getExtensionHelpSetUrl(ext);
if (helpSetUrl != null) {
try {
log.debug("Load help files for extension '" + ext.getName() + "' and merge with core help.");
HelpSet extHs = new HelpSet(ext.getClass().getClassLoader(), helpSetUrl);
hb.getHelpSet().add(extHs);
} catch (HelpSetException e) {
log.error("An error occured while adding help file of extension '" + ext.getName() + "': " + e.getMessage(), e);
}
}
}
Aggregations