Permalink
Browse files

fix failure to bring up help window under Webstart

  • Loading branch information...
1 parent f2952f1 commit 76d2374d2b5dce2f01d0fa5ddca886ad0d3c764f @cpesch committed Oct 15, 2012
@@ -155,6 +155,7 @@ private static ResourceBundle tryToLoadBundleFor(Class<?> clazz) {
String helpSetUrl = bundle.getString("help-set");
if (helpSetUrl != null)
ctx.setHelpBrokerUrl(helpSetUrl);
+ ctx.setHelpBrokerClassLoader(applicationClass.getClassLoader());
return application;
}
@@ -42,6 +42,7 @@
private UndoManager undoManager = new UndoManager();
private JMenuBar menuBar = null;
private String helpBrokerUrl = null;
+ private ClassLoader helpBrokerClassLoader = null;
private HelpBroker broker = null;
public ResourceBundle getBundle() {
@@ -70,8 +71,8 @@ void setMenuBar(JMenuBar menuBar) {
public HelpBroker getHelpBroker() throws HelpSetException {
if (broker == null) {
- URL url = HelpSet.findHelpSet(null, helpBrokerUrl);
- HelpSet helpSet = new HelpSet(null, url);
+ URL url = HelpSet.findHelpSet(helpBrokerClassLoader, helpBrokerUrl);
+ HelpSet helpSet = new HelpSet(helpBrokerClassLoader, url);
broker = helpSet.createHelpBroker();
}
return broker;
@@ -80,4 +81,8 @@ public HelpBroker getHelpBroker() throws HelpSetException {
public void setHelpBrokerUrl(String helpBrokerUrl) {
this.helpBrokerUrl = helpBrokerUrl;
}
+
+ public void setHelpBrokerClassLoader(ClassLoader helpBrokerClassLoader) {
+ this.helpBrokerClassLoader = helpBrokerClassLoader;
+ }
}
@@ -44,6 +44,7 @@ public void run() {
HelpBroker broker = Application.getInstance().getContext().getHelpBroker();
new CSH.DisplayHelpFromFocus(broker).actionPerformed(getEvent());
} catch (Exception e) {
+ e.printStackTrace();
String message = "Could not initialize help: " + e.getLocalizedMessage();
log.severe(message);
JOptionPane.showMessageDialog(null, message, "Error", ERROR_MESSAGE);

0 comments on commit 76d2374

Please sign in to comment.