From d7443dba0678331ca7194ec554ded3fa0a644f62 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Wed, 11 Jul 2007 17:18:12 +0000 Subject: Added getSubApplet() from JOGLAppletLauncher to enable scripting. Updated documentation. Deleted copy of loadLibraryInternal accidentally introduced into code. --- .../jdesktop/applet/util/JNLPAppletLauncher.java | 40 +++++++++------------- www/index.html | 9 +++++ 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/src/org/jdesktop/applet/util/JNLPAppletLauncher.java b/src/org/jdesktop/applet/util/JNLPAppletLauncher.java index bbb8372..af4d282 100644 --- a/src/org/jdesktop/applet/util/JNLPAppletLauncher.java +++ b/src/org/jdesktop/applet/util/JNLPAppletLauncher.java @@ -37,8 +37,8 @@ * intended for use in the design, construction, operation or * maintenance of any nuclear facility. * - * $Revision: 1.13 $ - * $Date: 2007/07/05 16:06:47 $ + * $Revision: 1.14 $ + * $Date: 2007/07/11 17:18:12 $ * $State: Exp $ */ @@ -310,6 +310,15 @@ import org.xml.sax.helpers.DefaultHandler; * potentially document the need to try restarting the browser in case * of instability. * + *

Scripting Support

+ * + *

+ * + * The JNLPAppletLauncher supports interaction with the sub-applet via + * the getSubApplet() method. Calling this method from + * JavaScript will return the subordinate applet with which you can + * then interact via JavaScript. + * *

Examples

* *

@@ -567,27 +576,6 @@ import org.xml.sax.helpers.DefaultHandler; public class JNLPAppletLauncher extends Applet { - private static void loadLibraryInternal(String libraryName) { - String sunAppletLauncher = System.getProperty("sun.jnlp.applet.launcher"); - boolean usingJNLPAppletLauncher = - Boolean.valueOf(sunAppletLauncher).booleanValue(); - - if (usingJNLPAppletLauncher) { - try { - Class jnlpAppletLauncherClass = - Class.forName("org.jdesktop.applet.util.JNLPAppletLauncher"); - Method jnlpLoadLibraryMethod = - jnlpAppletLauncherClass.getDeclaredMethod("loadLibrary", - new Class[] { String.class }); - jnlpLoadLibraryMethod.invoke(null, new Object[] { libraryName }); - } catch (Exception e) { - throw new RuntimeException(e); - } - } else { - System.loadLibrary(libraryName); - } - } - private static final boolean VERBOSE = false; private static final boolean DEBUG = true; @@ -852,6 +840,12 @@ public class JNLPAppletLauncher extends Applet { } + /** Helper method to make it easier to call methods on the + sub-applet from JavaScript. */ + public Applet getSubApplet() { + return subApplet; + } + /** * This method is called by the static initializer to create / initialize * the temp root directory that will hold the temp directories for this diff --git a/www/index.html b/www/index.html index a2f2ef3..96beedf 100644 --- a/www/index.html +++ b/www/index.html @@ -233,6 +233,15 @@ potentially document the need to try restarting the browser in case of instability. +

Scripting Support

+ +

+ + The JNLPAppletLauncher supports interaction with the sub-applet via + the getSubApplet() method. Calling this method from + JavaScript will return the subordinate applet with which you can + then interact via JavaScript. +

Examples

-- cgit v1.2.3