From b1c8641a63a67e3c64d948f9e8dce5c01e11e2dd Mon Sep 17 00:00:00 2001 From: mcentner Date: Wed, 5 May 2010 15:29:01 +0000 Subject: Merged feature branch mocca-1.2.13-id@r724 back to trunk. git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@725 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/gui/SwitchFocusListener.java | 98 ++++++++++++---------- 1 file changed, 54 insertions(+), 44 deletions(-) (limited to 'BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SwitchFocusListener.java') diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SwitchFocusListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SwitchFocusListener.java index 48b641e2..171d24b8 100644 --- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SwitchFocusListener.java +++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SwitchFocusListener.java @@ -1,44 +1,54 @@ -package at.gv.egiz.bku.gui; - -import java.applet.AppletContext; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.net.MalformedURLException; -import java.net.URL; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * - * @author Thomas Zefferer - */ -public class SwitchFocusListener implements ActionListener { - - protected final static Log log = LogFactory.getLog(SwitchFocusListener.class); - - protected AppletContext ctx; - protected String javascriptFunction; - - public SwitchFocusListener(AppletContext ctx, String javascriptFunction) { - - this.ctx = ctx; - this.javascriptFunction = javascriptFunction; - } - - @Override - public void actionPerformed(ActionEvent e) { - - try { - ctx.showDocument - (new URL("javascript:" + javascriptFunction)); - } - catch (MalformedURLException me) { - - log.warn("Unable to call external javascript function.", me); - } - - - } - -} +package at.gv.egiz.bku.gui; + +import java.applet.AppletContext; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.net.MalformedURLException; +import java.net.URL; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author Thomas Zefferer + */ +public class SwitchFocusListener implements ActionListener { + + private final Logger log = LoggerFactory.getLogger(SwitchFocusListener.class); + + protected String functionName; + protected AppletContext ctx; + protected String javascriptFunction; + + public SwitchFocusListener(AppletContext ctx, String javascriptFunctionName) { + + this.ctx = ctx; + this.functionName = javascriptFunctionName; + buildJSFunction(); + } + + @Override + public void actionPerformed(ActionEvent e) { + + log.debug("SwitchFocusListener fires!"); + + try { + ctx.showDocument + (new URL("javascript:" + javascriptFunction)); + } + catch (MalformedURLException me) { + + log.warn("Unable to call external javascript function.", me); + } + + + } + + protected void buildJSFunction() { + + this.javascriptFunction = functionName + "()"; + + } + +} -- cgit v1.2.3