From fef61ddc786960015c6fc416d4ad2d5d0f2048d1 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 13 Nov 2008 20:56:23 +0000 Subject: bugfix openwindow blocked bugfix helpTopic always hashdataviewer git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@168 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 2 +- .../bku/online/applet/DefaultHelpListener.java | 38 +++++----------------- 2 files changed, 9 insertions(+), 31 deletions(-) (limited to 'BKUApplet/src/main/java/at/gv/egiz') diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index b4407b22..4b49c5d5 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -90,7 +90,7 @@ public class BKUApplet extends JApplet implements AppletParameterProvider { try { URL helpURL = getURLParameter(HELP_URL); //, getAppletParameter(SESSION_ID)); // helpListener = new BrowserHelpListener(getAppletContext(), helpURL, getLocale()); - helpListener = new DefaultHelpListener(helpURL, getLocale()); + helpListener = new DefaultHelpListener(getAppletContext(), helpURL, getLocale()); } catch (MalformedURLException ex) { log.warn("failed to load help URL, disabling help: " + ex.getMessage()); } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java index 9876ef7e..6eec5665 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java @@ -16,49 +16,28 @@ */ package at.gv.egiz.bku.online.applet; +import at.gv.egiz.bku.gui.HelpViewer; import at.gv.egiz.bku.gui.AbstractHelpListener; -import at.gv.egiz.bku.gui.ViewerDialog; -import java.io.InputStream; +import java.applet.AppletContext; import java.net.URL; -import java.net.URLConnection; import java.util.Locale; import javax.swing.SwingUtilities; /** - * This class depends on BKU utils, and therefore is not part of BKUCommonGUI * * @author Clemens Orthacker */ public class DefaultHelpListener extends AbstractHelpListener { - public DefaultHelpListener(URL helpURL, Locale locale) { + protected AppletContext ctx; + + public DefaultHelpListener(AppletContext ctx, URL helpURL, Locale locale) { super(helpURL, locale); + this.ctx = ctx; } @Override - public void showDocument(URL helpURL, final String helpTopic) throws Exception { - log.debug("open connection " + helpURL); - URLConnection conn = helpURL.openConnection(); - - log.debug("show help document " + conn.getContentType()); // + ";" + conn.getContentEncoding()); - -// Charset cs; -// if (conn.getContentEncoding() == null) { -// cs = Charset.forName("UTF-8"); -// } else { -// try { -// cs = Charset.forName(conn.getContentEncoding()); -// } catch (Exception ex) { -// log.debug("charset " + conn.getContentEncoding() + " not supported, assuming UTF-8: " + ex.getMessage()); -// cs = Charset.forName("UTF-8"); -// } -// } - -// InputStreamReader isr = new InputStreamReader(conn.getInputStream(), cs); -// final Reader content = new BufferedReader(isr); - final InputStream content = conn.getInputStream(); - final String mimeType = conn.getContentType(); - + public void showDocument(final URL helpURL, final String helpTopic) throws Exception { log.debug("schedule help dialog"); SwingUtilities.invokeLater(new Runnable() { @@ -68,10 +47,9 @@ public class DefaultHelpListener extends AbstractHelpListener { log.debug("show help dialog"); - ViewerDialog.showHelp(null, helpTopic, content, mimeType, messages); + HelpViewer.showHelpDialog(ctx, helpURL, helpTopic, messages); } }); -// gui.showHelpDialog(helpDocument.getStream(), mimetype, encoding); } } -- cgit v1.2.3