/hg/icedtea-web: 3 new changesets
dlila at icedtea.classpath.org
dlila at icedtea.classpath.org
Thu Mar 31 11:13:55 PDT 2011
changeset 93fe9a7cb5ab in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=93fe9a7cb5ab
author: Denis Lila <dlila at redhat.com>
date: Thu Mar 31 09:53:15 2011 -0400
Remove race conditions in PluginObjectStore.java.
changeset 12065cfb29e1 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=12065cfb29e1
author: Denis Lila <dlila at redhat.com>
date: Thu Mar 31 13:54:45 2011 -0400
merge
changeset a5cd63b3367c in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=a5cd63b3367c
author: Denis Lila <dlila at redhat.com>
date: Thu Mar 31 14:01:04 2011 -0400
Make PluginDebug a bit lazier.
diffstat:
ChangeLog | 97 +++
Makefile.am | 98 +++-
configure.ac | 2 +
netx/javaws.1 | 2 +-
netx/net/sourceforge/jnlp/DefaultLaunchHandler.java | 18 +-
netx/net/sourceforge/jnlp/GuiLaunchHandler.java | 123 ++++
netx/net/sourceforge/jnlp/LaunchHandler.java | 18 +
netx/net/sourceforge/jnlp/Launcher.java | 22 +-
netx/net/sourceforge/jnlp/resources/Messages.properties | 6 +-
netx/net/sourceforge/jnlp/runtime/Boot.java | 2 +-
netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 9 +-
netx/net/sourceforge/jnlp/util/BasicExceptionDialog.java | 129 ++++
plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java | 2 +-
plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java | 4 +-
plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java | 2 +-
plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java | 50 +-
plugin/icedteanp/java/sun/applet/PluginAppletViewer.java | 74 +-
plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java | 2 +-
plugin/icedteanp/java/sun/applet/PluginDebug.java | 9 +-
plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java | 10 +-
plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java | 10 +-
plugin/icedteanp/java/sun/applet/PluginObjectStore.java | 109 ++-
plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java | 2 +-
plugin/icedteanp/java/sun/applet/PluginProxySelector.java | 6 +-
plugin/icedteanp/java/sun/applet/PluginStreamHandler.java | 12 +-
plugin/icedteanp/java/sun/applet/RequestQueue.java | 2 +-
plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java | 2 +-
tests/junit-runner/CommandLine.java | 51 +
tests/junit-runner/LessVerboseTextListener.java | 51 +
tests/junit-runner/README | 3 +
tests/netx/unit/net/sourceforge/jnlp/ParserBasic.java | 282 ++++++++++
tests/netx/unit/net/sourceforge/jnlp/ParserCornerCases.java | 91 +++
tests/netx/unit/net/sourceforge/jnlp/ParserMalformedXml.java | 94 +++
tests/netx/unit/net/sourceforge/jnlp/basic.jnlp | 47 +
34 files changed, 1273 insertions(+), 168 deletions(-)
diffs (truncated from 2232 to 500 lines):
diff -r 3bbc4314e02c -r a5cd63b3367c ChangeLog
--- a/ChangeLog Tue Mar 29 10:24:31 2011 -0400
+++ b/ChangeLog Thu Mar 31 14:01:04 2011 -0400
@@ -1,3 +1,100 @@
+2011-03-31 Denis Lila <dlila at redhat.com>
+
+ * plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java
+ * plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java
+ * plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java
+ * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
+ * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
+ * plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java
+ * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java
+ * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java
+ * plugin/icedteanp/java/sun/applet/PluginObjectStore.java
+ * plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java
+ * plugin/icedteanp/java/sun/applet/PluginProxySelector.java
+ * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java
+ * plugin/icedteanp/java/sun/applet/RequestQueue.java
+ * plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java:
+ Change all instances of PluginDebug.debug(arg1 + arg2 + ...)
+ to PluginDebug.debug(arg1, arg2, ...).
+ * plugin/icedteanp/java/sun/applet/PluginDebug.java:
+ Change debug from "void debug(String)" to "void debug(Object...)".
+
+2011-03-31 Denis Lila <dlila at redhat.com>
+
+ * plugin/icedteanp/java/sun/applet/PluginObjectStore.java
+ (wrapped, lock): New static variables.
+ (getNextID, checkNeg): New functions.
+ (reference): Using getNextID and synchronized.
+ (dump): Improve iteration and synchronized.
+ (unreference, getObject, getIdentifier, contains(Object),
+ contains(int)): Synchronized.
+
+2011-03-31 Omair Majid <omajid at redhat.com>
+
+ Add unit tests for the parser
+ * Makefile.am: Add TESTS_DIR,TESTS_SRCDIR, NETX_UNIT_TEST_DIR,
+ and NETX_UNIT_TEST_SRCDIR, JUNIT_RUNNER_DIR, JUNIT_RUNNER_SRCDIR, and
+ JUNIT_RUNNER_JAR. Conditionally define RHINO_TESTS and UNIT_TESTS.
+ (clean-local): Use RHINO_TESTS and UNIT_TESTS.
+ (clean-tests): Depend on clean-netx-tests. Delete directory.
+ (junit-runner-source-files.txt, $(JUNIT_RUNNER_JAR)),
+ (next-unit-tests-sources-files.txt stamps/netx-unit-tests-compile.stamp),
+ (run-netx-unit-tests, clean-netx-tests, clean-junit-runner)
+ (clean-netx-unit-tests): New targets.
+ * configure.ac: Add new optional dependency on junit.
+ * tests/junit-runner/CommandLine.java,
+ * tests/junit-runner/LessVerboseTextListener.java,
+ * tests/junit-runner/README,
+ * tests/netx/unit/net/sourceforge/jnlp/ParserBasicTests.java,
+ * tests/netx/unit/net/sourceforge/jnlp/ParserCornerCaseTests.java,
+ * tests/netx/unit/net/sourceforge/jnlp/ParserMalformedXmlTests.java,
+ * tests/netx/unit/net/sourceforge/jnlp/basic.jnlp: New files.
+
+2011-03-30 Omair Majid <omajid at redhat.com>
+
+ * Makefile.am: Fix comment explaining reasons for setting
+ JDK_UPDATE_VERSION.
+
+2011-03-30 Omair Majid <omajid at redhat.com>
+
+ * netx/net/sourceforge/jnlp/resources/Messages.properties: Fix typo in
+ RCantRename.
+
+2011-03-30 Omair Majid <omajid at redhat.com>
+
+ * Makefile.am: Document reason for using bootclasspath.
+
+2011-03-30 Omair Majid <omajid at redhat.com>
+
+ * netx/javaws.1: Fix FILES section to point to
+ ~/.icedtea/deployment.properties.
+
+2011-03-30 Omair Majid <omajid at redhat.com>
+
+ * netx/net/sourceforge/jnlp/LaunchHandler.java
+ (launchInitialized, launchStarting): New methods.
+ * netx/net/sourceforge/jnlp/DefaultLaunchHandler.java
+ (launchInitialized, launchStarting): New methods. No-op
+ implementation.
+ (printMessage): Make it static.
+ * netx/net/sourceforge/jnlp/GuiLaunchHandler.java: New file.
+ (launchCompleted, launchError, launchStarting, launchInitialized),
+ (launchWarning, validationError): New methods.
+ * netx/net/sourceforge/jnlp/Launcher.java (launchApplication):
+ Invoke handler.launchInitialized and handler.launchStarting instead
+ of showing a splash screen directly.
+ * netx/net/sourceforge/jnlp/resources/Messages.properties: Add
+ ButShowDetails, ButHideDetails and Error.
+ * netx/net/sourceforge/jnlp/runtime/Boot.java (run): Do not exit on
+ error.
+ * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java
+ (initialize): Set handler to GuiLaunchHandler if not running in
+ headless mode.
+ * netx/net/sourceforge/jnlp/util/BasicExceptionDialog.java: New
+ file.
+ (exceptionToString, show): New methods.
+
+>>>>>>> /tmp/ChangeLog~other.ZwCGJe
2011-03-29 Denis Lila <dlila at redhat.com>
* netx/net/sourceforge/jnlp/JNLPFile.java
diff -r 3bbc4314e02c -r a5cd63b3367c Makefile.am
--- a/Makefile.am Tue Mar 29 10:24:31 2011 -0400
+++ b/Makefile.am Thu Mar 31 14:01:04 2011 -0400
@@ -6,6 +6,17 @@
NETX_EXTRA_DIR=$(abs_top_srcdir)/extra/net/sourceforge/javaws/about/resources
NETX_EXTRA_DIST_DIR=$(abs_top_builddir)/extra-lib/net/sourceforge/javaws/about/resources
+TESTS_SRCDIR=$(abs_top_srcdir)/tests
+TESTS_DIR=$(abs_top_builddir)/tests.build
+
+NETX_UNIT_TEST_SRCDIR=$(TESTS_SRCDIR)/netx/unit
+NETX_UNIT_TEST_DIR=$(TESTS_DIR)/netx/unit
+
+JUNIT_RUNNER_DIR=$(TESTS_DIR)/junit-runner
+JUNIT_RUNNER_SRCDIR=$(TESTS_SRCDIR)/junit-runner
+
+JUNIT_RUNNER_JAR=$(abs_top_builddir)/junit-runner.jar
+
# Build directories
BOOT_DIR = $(abs_top_builddir)/bootstrap/jdk1.6.0
@@ -25,12 +36,19 @@
IT_CLASS_TARGET_VERSION=6
IT_JAVACFLAGS=$(IT_JAVAC_SETTINGS) -source $(IT_LANGUAGE_SOURCE_VERSION) -target $(IT_CLASS_TARGET_VERSION)
+#
+# We need the jars in bootclasspath for a couple of reasons
+# - we use classes (in the sun.applet package) loaded by the bootclassloader
+# using another classloader to load classes from the same package causes an
+# IllegalAccessException
+# - we want full privileges
+#
JRE='"$(SYSTEM_JDK_DIR)/jre"'
LAUNCHER_BOOTCLASSPATH="-Xbootclasspath/a:$(datadir)/$(PACKAGE_NAME)/netx.jar$(RHINO_RUNTIME)"
PLUGIN_BOOTCLASSPATH='"-Xbootclasspath/a:$(datadir)/$(PACKAGE_NAME)/netx.jar:$(datadir)/$(PACKAGE_NAME)/plugin.jar$(RHINO_RUNTIME)"'
-# Fake update version to shut up the plugin detector hosted by Oracle.
-# If Oracle ever release a JDK update greater than 50, this needs to be increased.
+# Fake update version to work with the Deployment Toolkit script used by Oracle
+# http://download.oracle.com/javase/tutorial/deployment/deploymentInDepth/depltoolkit_index.html
JDK_UPDATE_VERSION=50
# Sources list
@@ -73,6 +91,19 @@
endif
endif
+if WITH_RHINO
+ RHINO_TESTS=check-pac-functions
+else
+ RHINO_TESTS=
+endif
+
+if WITH_JUNIT
+ JUNIT_TESTS=run-netx-unit-tests
+else
+ JUNIT_TESTS=
+endif
+
+
PLUGIN_VERSION = IcedTea-Web $(FULL_VERSION)
EXTRA_DIST = $(top_srcdir)/netx $(top_srcdir)/plugin javaws.png javaws.desktop.in extra launcher \
@@ -92,7 +123,7 @@
all-local: stamps/netx-dist.stamp extra-lib/about.jar stamps/plugin.stamp launcher.build/javaws \
javaws.desktop stamps/docs.stamp launcher.build/itweb-settings itweb-settings.desktop
-check-local: check-pac-functions
+check-local: $(RHINO_TESTS) $(JUNIT_TESTS)
clean-local: clean-netx clean-plugin clean-liveconnect clean-extra clean-bootstrap-directory \
clean-native-ecj clean-launchers clean-desktop-files clean-docs clean-tests
@@ -102,7 +133,8 @@
.PHONY: clean-IcedTeaPlugin clean-add-netx clean-add-netx-debug clean-add-plugin clean-add-plugin-debug \
clean-bootstrap-directory clean-native-ecj clean-desktop-files clean-netx-docs clean-docs clean-plugin-docs \
- clean-tests check-local clean-launchers
+ clean-tests check-local clean-launchers check-pac-functions run-netx-unit-tests clean-netx-tests \
+ clean-junit-runner clean-netx-unit-tests
install-exec-local:
${mkinstalldirs} $(DESTDIR)$(bindir) $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/ $(DESTDIR)$(libdir)
@@ -390,11 +422,67 @@
# check
# ==========================
+clean-tests: clean-netx-tests
+ if [ -e $(TESTS_DIR) ]; then \
+ rmdir $(TESTS_DIR) ; \
+ fi
+
check-pac-functions: stamps/bootstrap-directory.stamp
./jrunscript $(abs_top_srcdir)/tests/netx/pac/pac-funcs-test.js \
$$(readlink -f $(abs_top_srcdir)/netx/net/sourceforge/jnlp/runtime/pac-funcs.js)
-clean-tests:
+junit-runner-source-files.txt:
+ find $(JUNIT_RUNNER_SRCDIR) -name '*.java' | sort > $@
+
+$(JUNIT_RUNNER_JAR): junit-runner-source-files.txt
+ mkdir -p $(JUNIT_RUNNER_DIR) && \
+ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
+ -d $(JUNIT_RUNNER_DIR) \
+ -classpath $(JUNIT_JAR) \
+ @junit-runner-source-files.txt && \
+ $(BOOT_DIR)/bin/jar cf $@ -C $(JUNIT_RUNNER_DIR) .
+
+netx-unit-tests-source-files.txt:
+ find $(NETX_UNIT_TEST_SRCDIR) -name '*.java' | sort > $@
+
+stamps/netx-unit-tests-compile.stamp: stamps/netx.stamp \
+ netx-unit-tests-source-files.txt
+ mkdir -p $(NETX_UNIT_TEST_DIR) && \
+ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
+ -d $(NETX_UNIT_TEST_DIR) \
+ -classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar \
+ @netx-unit-tests-source-files.txt && \
+ mkdir -p stamps && \
+ touch $@
+
+run-netx-unit-tests: stamps/netx-unit-tests-compile.stamp \
+ $(JUNIT_RUNNER_JAR)
+ cp {$(NETX_UNIT_TEST_SRCDIR),$(NETX_UNIT_TEST_DIR)}/net/sourceforge/jnlp/basic.jnlp
+ cd $(NETX_UNIT_TEST_DIR) ; \
+ class_names= ; \
+ for test in `find -type f` ; do \
+ class_name=`echo $$test | sed -e 's|\.class$$||' -e 's|^\./||'` ; \
+ class_name=`echo $$class_name | sed -e 's|/|.|g' ` ; \
+ class_names="$$class_names $$class_name" ; \
+ done ; \
+ echo $$class_names ; \
+ CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):. \
+ $(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) CommandLine $$class_names
+
+clean-netx-tests: clean-netx-unit-tests clean-junit-runner
+ if [ -e $(TESTS_DIR)/netx ]; then \
+ rmdir $(TESTS_DIR)/netx ; \
+ fi
+
+clean-junit-runner:
+ rm -f junit-runner-source-files.txt
+ rm -rf $(JUNIT_RUNNER_DIR)
+ rm -f $(JUNIT_RUNNER_JAR)
+
+clean-netx-unit-tests:
+ rm -f netx-unit-tests-source-files.txt
+ rm -rf $(NETX_UNIT_TEST_DIR)
+ rm -f stamps/netx-unit-tests-compile.stamp
# plugin tests
diff -r 3bbc4314e02c -r a5cd63b3367c configure.ac
--- a/configure.ac Tue Mar 29 10:24:31 2011 -0400
+++ b/configure.ac Thu Mar 31 14:01:04 2011 -0400
@@ -85,6 +85,8 @@
IT_FIND_OPTIONAL_JAR([rhino], RHINO,
[/usr/share/java/js.jar /usr/share/rhino-1.6/lib/js.jar])
+IT_FIND_OPTIONAL_JAR([junit], JUNIT,
+ [/usr/share/java/junit4.jar])
AC_CONFIG_FILES([jrunscript], [chmod u+x jrunscript])
AC_CONFIG_FILES([build.properties])
diff -r 3bbc4314e02c -r a5cd63b3367c netx/javaws.1
--- a/netx/javaws.1 Tue Mar 29 10:24:31 2011 -0400
+++ b/netx/javaws.1 Thu Mar 31 14:01:04 2011 -0400
@@ -101,7 +101,7 @@
Print a help message and exit.
.SH FILES
-~/.netxrc specifies the location of the base directory
+~/.icedtea/deployment.properties specifies the settings used by javaws
.SH BUGS
There arent any known bugs. If you come across one, please file it at
diff -r 3bbc4314e02c -r a5cd63b3367c netx/net/sourceforge/jnlp/DefaultLaunchHandler.java
--- a/netx/net/sourceforge/jnlp/DefaultLaunchHandler.java Tue Mar 29 10:24:31 2011 -0400
+++ b/netx/net/sourceforge/jnlp/DefaultLaunchHandler.java Thu Mar 31 14:01:04 2011 -0400
@@ -76,7 +76,7 @@
/**
* Print a message to stdout.
*/
- protected void printMessage(LaunchException ex) {
+ protected static void printMessage(LaunchException ex) {
StringBuffer result = new StringBuffer();
result.append("netx: ");
result.append(ex.getCategory());
@@ -103,4 +103,20 @@
}
}
+ /**
+ * Do nothing on when initializing
+ */
+ @Override
+ public void launchInitialized(JNLPFile file) {
+ // do nothing
+ }
+
+ /**
+ * Do nothing when starting
+ */
+ @Override
+ public void launchStarting(ApplicationInstance application) {
+ // do nothing
+ }
+
}
diff -r 3bbc4314e02c -r a5cd63b3367c netx/net/sourceforge/jnlp/GuiLaunchHandler.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/netx/net/sourceforge/jnlp/GuiLaunchHandler.java Thu Mar 31 14:01:04 2011 -0400
@@ -0,0 +1,123 @@
+/* GuiLaunchHandler.java
+ Copyright (C) 2011 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package net.sourceforge.jnlp;
+
+import java.net.URL;
+
+import javax.swing.SwingUtilities;
+
+import net.sourceforge.jnlp.cache.ResourceTracker;
+import net.sourceforge.jnlp.cache.UpdatePolicy;
+import net.sourceforge.jnlp.runtime.ApplicationInstance;
+import net.sourceforge.jnlp.util.BasicExceptionDialog;
+
+/**
+ * A {@link LaunchHandler} that gives feedback to the user using GUI elements
+ * including splash screens and exception dialogs.
+ */
+public class GuiLaunchHandler implements LaunchHandler {
+
+ private JNLPSplashScreen splashScreen = null;
+ private UpdatePolicy policy = UpdatePolicy.ALWAYS;
+
+ @Override
+ public void launchCompleted(ApplicationInstance application) {
+ // do nothing
+ }
+
+ @Override
+ public void launchError(final LaunchException exception) {
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ BasicExceptionDialog.show(exception);
+ }
+ });
+ }
+
+ @Override
+ public void launchStarting(ApplicationInstance application) {
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ if (splashScreen != null) {
+ if (splashScreen.isSplashScreenValid()) {
+ splashScreen.setVisible(false);
+ }
+ splashScreen.dispose();
+ }
+ }
+ });
+ }
+
+ @Override
+ public void launchInitialized(final JNLPFile file) {
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ final int preferredWidth = 500;
+ final int preferredHeight = 400;
+
+ URL splashImageURL = file.getInformation().getIconLocation(
+ IconDesc.SPLASH, preferredWidth, preferredHeight);
+ if (splashImageURL != null) {
+ ResourceTracker resourceTracker = new ResourceTracker(true);
+ resourceTracker.addResource(splashImageURL, file.getFileVersion(), null, policy);
+ splashScreen = new JNLPSplashScreen(resourceTracker, null, null);
+ splashScreen.setSplashImageURL(splashImageURL);
+ if (splashScreen.isSplashScreenValid()) {
+ splashScreen.setVisible(true);
+ }
+ }
+ }
+ });
+ }
+
+ @Override
+ public boolean launchWarning(LaunchException warning) {
+ DefaultLaunchHandler.printMessage(warning);
+ return true;
+ }
+
+ @Override
+ public boolean validationError(LaunchException security) {
+ DefaultLaunchHandler.printMessage(security);
+ return true;
+ }
+
+}
diff -r 3bbc4314e02c -r a5cd63b3367c netx/net/sourceforge/jnlp/LaunchHandler.java
--- a/netx/net/sourceforge/jnlp/LaunchHandler.java Tue Mar 29 10:24:31 2011 -0400
+++ b/netx/net/sourceforge/jnlp/LaunchHandler.java Thu Mar 31 14:01:04 2011 -0400
@@ -56,6 +56,24 @@
// controller is in place.
/**
+ * Called when an application, applet or installer has been determined.
+ * We have some very basic information about the application at this point,
+ * but do not have everything required. This is a nice point to show the
+ * splash screen.
+ *
+ * @param application the application instance that is starting
+ */
+ public void launchInitialized(JNLPFile file);
+
+ /**
+ * Called when an application, applet or installer is ready to start.
+ * Good point to hide the splash screen.
+ *
+ * @param application the application instance that is ready
+ */
+ public void launchStarting(ApplicationInstance application);
+
+ /**
* Called when an application, applet, or installer has been
* launched successfully (the main method or applet start method
* returned normally).
diff -r 3bbc4314e02c -r a5cd63b3367c netx/net/sourceforge/jnlp/Launcher.java
--- a/netx/net/sourceforge/jnlp/Launcher.java Tue Mar 29 10:24:31 2011 -0400
+++ b/netx/net/sourceforge/jnlp/Launcher.java Thu Mar 31 14:01:04 2011 -0400
@@ -396,20 +396,7 @@
return null;
}
- final int preferredWidth = 500;
- final int preferredHeight = 400;
- JNLPSplashScreen splashScreen = null;
- URL splashImageURL = file.getInformation().getIconLocation(
- IconDesc.SPLASH, preferredWidth, preferredHeight);
- if (splashImageURL != null) {
- ResourceTracker resourceTracker = new ResourceTracker(true);
- resourceTracker.addResource(splashImageURL, file.getFileVersion(), null, updatePolicy);
- splashScreen = new JNLPSplashScreen(resourceTracker, null, null);
- splashScreen.setSplashImageURL(splashImageURL);
- if (splashScreen.isSplashScreenValid()) {
- splashScreen.setVisible(true);
- }
- }
+ handler.launchInitialized(file);
ApplicationInstance app = createApplication(file);
app.initialize();
@@ -446,12 +433,7 @@
setContextClassLoaderForAllThreads(app.getThreadGroup(), app.getClassLoader());
- if (splashScreen != null) {
- if (splashScreen.isSplashScreenValid()) {
- splashScreen.setVisible(false);
- }
More information about the distro-pkg-dev
mailing list