diff options
author | Kenneth Russel <[email protected]> | 2007-07-11 17:18:12 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2007-07-11 17:18:12 +0000 |
commit | d7443dba0678331ca7194ec554ded3fa0a644f62 (patch) | |
tree | 7100aafc6cbe404ce37d9e5d5d6d9ee7cf46d37e | |
parent | a027cd43c351a71064f1763b795abc7c598643b4 (diff) |
Added getSubApplet() from JOGLAppletLauncher to enable scripting.
Updated documentation. Deleted copy of loadLibraryInternal
accidentally introduced into code.
-rw-r--r-- | src/org/jdesktop/applet/util/JNLPAppletLauncher.java | 40 | ||||
-rw-r--r-- | 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. * + * <h2>Scripting Support</h2> + * + * <p> + * + * The JNLPAppletLauncher supports interaction with the sub-applet via + * the <code>getSubApplet()</code> method. Calling this method from + * JavaScript will return the subordinate applet with which you can + * then interact via JavaScript. + * * <h2><a name="EXAMPLES">Examples</a></h2> * * <p> @@ -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. + <h2>Scripting Support</h2> + + <p> + + The JNLPAppletLauncher supports interaction with the sub-applet via + the <code>getSubApplet()</code> method. Calling this method from + JavaScript will return the subordinate applet with which you can + then interact via JavaScript. + <h2><a name="EXAMPLES">Examples</a></h2> <p> |