changeset 10903:345376202d2b

8199357: Remove references to applets and Java Web Start from FX Reviewed-by: prr, aghaisas
author kcr
date Fri, 13 Apr 2018 15:43:59 -0700
parents f7e879441509
children b9915cc91652
files apps/samples/samples_readme.txt modules/javafx.graphics/src/main/java/com/sun/javafx/application/HostServicesDelegate.java modules/javafx.graphics/src/main/java/com/sun/javafx/application/LauncherImpl.java modules/javafx.graphics/src/main/java/com/sun/javafx/application/PlatformImpl.java modules/javafx.graphics/src/main/java/com/sun/javafx/css/StyleManager.java modules/javafx.graphics/src/main/java/javafx/application/Application.java modules/javafx.graphics/src/main/java/javafx/application/HostServices.java modules/javafx.graphics/src/main/java/javafx/application/Platform.java modules/javafx.graphics/src/main/java/javafx/application/Preloader.java modules/javafx.graphics/src/main/java/javafx/concurrent/Task.java modules/javafx.graphics/src/main/java/javafx/stage/Stage.java modules/javafx.graphics/src/main/java/javafx/stage/Window.java
diffstat 12 files changed, 31 insertions(+), 199 deletions(-) [+]
line wrap: on
line diff
--- a/apps/samples/samples_readme.txt	Fri Apr 13 20:16:45 2018 +0530
+++ b/apps/samples/samples_readme.txt	Fri Apr 13 15:43:59 2018 -0700
@@ -6,7 +6,6 @@
 What do I need to set up my environment?
 How do I run the prebuilt samples?
 How do I run the sample projects in NetBeans IDE?
-What are the other ways I can package the samples?
 Sample Descriptions
 
 
@@ -48,7 +47,7 @@
 - A supported version** of the JDK.
 - A supported version** of NetBeans IDE.
 
-**To find information about the supported versions of operating system and browser
+**To find information about the supported versions of operating system
 for a particular Java release, see
 http://www.oracle.com/technetwork/java/javase/downloads/index.html
 
@@ -77,16 +76,6 @@
    the project and choose Run.
 
 
-==================================================
-What are the other ways I can package the samples?
-==================================================
-
-You can also package any of the samples as an applet, JNLP, or native bundle 
-that includes an installer and a copy of the JRE for execution in an environment
-that does not have JavaFX installed. See https://docs.oracle.com/javafx for 
-additional information about deploying JavaFX application.
-
-
 ===================
 Sample Descriptions
 ===================
@@ -138,4 +127,4 @@
 
 
 --------------------------------------------------------------------
-Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
--- a/modules/javafx.graphics/src/main/java/com/sun/javafx/application/HostServicesDelegate.java	Fri Apr 13 20:16:45 2018 +0530
+++ b/modules/javafx.graphics/src/main/java/com/sun/javafx/application/HostServicesDelegate.java	Fri Apr 13 15:43:59 2018 -0700
@@ -27,50 +27,13 @@
 
 import java.awt.Desktop;
 import java.io.File;
-import java.lang.reflect.Method;
 import java.net.URI;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
 import javafx.application.Application;
 
 public abstract class HostServicesDelegate {
 
-    private static Method getInstanceMeth = null;
-
     public static HostServicesDelegate getInstance(final Application app) {
-        // Call into the deploy code to get the delegate class
-        HostServicesDelegate instance = null;
-        try {
-            instance = AccessController.doPrivileged(
-                    (PrivilegedExceptionAction<HostServicesDelegate>) () -> {
-                        if (getInstanceMeth == null) {
-                            try {
-                                final String factoryClassName =
-                                        "com.sun.deploy.uitoolkit.impl.fx.HostServicesFactory";
-
-                                Class factoryClass = Class.forName(factoryClassName,
-                                        true,
-                                        HostServicesDelegate.class.getClassLoader());
-                                getInstanceMeth = factoryClass.getMethod(
-                                        "getInstance", Application.class);
-                            } catch (Exception ex) {
-                                return null;
-                            }
-                        }
-                        return (HostServicesDelegate)
-                                getInstanceMeth.invoke(null, app);
-                    }
-            );
-        } catch (PrivilegedActionException pae) {
-            System.err.println(pae.getException().toString());
-            return null;
-        }
-        if (instance == null) {
-            // in this case we are in standalone mode
-            instance = StandaloneHostService.getInstance(app);
-        }
-        return instance;
+        return StandaloneHostService.getInstance(app);
     }
 
     protected HostServicesDelegate() {
--- a/modules/javafx.graphics/src/main/java/com/sun/javafx/application/LauncherImpl.java	Fri Apr 13 20:16:45 2018 +0530
+++ b/modules/javafx.graphics/src/main/java/com/sun/javafx/application/LauncherImpl.java	Fri Apr 13 15:43:59 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -87,7 +87,6 @@
     private static final String MF_JAVAFX_MAIN = "JavaFX-Application-Class";
     private static final String MF_JAVAFX_PRELOADER = "JavaFX-Preloader-Class";
     private static final String MF_JAVAFX_CLASS_PATH = "JavaFX-Class-Path";
-    private static final String MF_JAVAFX_FEATURE_PROXY = "JavaFX-Feature-Proxy";
     private static final String MF_JAVAFX_ARGUMENT_PREFIX = "JavaFX-Argument-";
     private static final String MF_JAVAFX_PARAMETER_NAME_PREFIX = "JavaFX-Parameter-Name-";
     private static final String MF_JAVAFX_PARAMETER_VALUE_PREFIX = "JavaFX-Parameter-Value-";
@@ -246,7 +245,7 @@
         /*
          * For now, just open the jar and get JavaFX-Application-Class and
          * JavaFX-Preloader and pass them to launchApplication. In the future
-         * we'll need to load requested jar files and set up the proxy
+         * we'll need to load requested jar files
          */
         String mainClassName = null;
         String preloaderClassName = null;
@@ -282,12 +281,6 @@
                 }
             }
 
-            // Support JavaFX-Feature-Proxy (only supported setting is 'auto', anything else is ignored)
-            String proxySetting = jarAttrs.getValue(MF_JAVAFX_FEATURE_PROXY);
-            if (proxySetting != null && "auto".equals(proxySetting.toLowerCase())) {
-                trySetAutoProxy();
-            }
-
             // process arguments and parameters if no args have been passed by the launcher
             if (args.length == 0) {
                 appArgs = getAppArguments(jarAttrs);
@@ -581,66 +574,6 @@
         return null;
     }
 
-    private static void trySetAutoProxy() {
-        // if explicit proxy settings are proxided we will skip autoproxy
-        // Note: we only check few most popular settings.
-        if (System.getProperty("http.proxyHost") != null
-             || System.getProperty("https.proxyHost") != null
-             || System.getProperty("ftp.proxyHost") != null
-             || System.getProperty("socksProxyHost") != null) {
-           if (verbose) {
-               System.out.println("Explicit proxy settings detected. Skip autoconfig.");
-               System.out.println("  http.proxyHost=" + System.getProperty("http.proxyHost"));
-               System.out.println("  https.proxyHost=" + System.getProperty("https.proxyHost"));
-               System.out.println("  ftp.proxyHost=" + System.getProperty("ftp.proxyHost"));
-               System.out.println("  socksProxyHost=" + System.getProperty("socksProxyHost"));
-           }
-           return;
-        }
-        if (System.getProperty("javafx.autoproxy.disable") != null) {
-            if (verbose) {
-                System.out.println("Disable autoproxy on request.");
-            }
-            return;
-        }
-
-        try {
-            Class sm = Class.forName("com.sun.deploy.services.ServiceManager");
-            Class params[] = {Integer.TYPE};
-            Method setservice = sm.getDeclaredMethod("setService", params);
-            String osname = System.getProperty("os.name");
-
-            String servicename;
-            if (osname.startsWith("Win")) {
-                servicename = "STANDALONE_TIGER_WIN32";
-            } else if (osname.contains("Mac")) {
-                servicename = "STANDALONE_TIGER_MACOSX";
-            } else {
-                servicename = "STANDALONE_TIGER_UNIX";
-            }
-            Object values[] = new Object[1];
-            Class pt = Class.forName("com.sun.deploy.services.PlatformType");
-            values[0] = pt.getField(servicename).get(null);
-            setservice.invoke(null, values);
-
-            Class dps = Class.forName(
-                    "com.sun.deploy.net.proxy.DeployProxySelector");
-            Method m = dps.getDeclaredMethod("reset", new Class[0]);
-            m.invoke(null, new Object[0]);
-
-            if (verbose) {
-                System.out.println("Autoconfig of proxy is completed.");
-            }
-        } catch (Exception e) {
-            if (verbose) {
-                System.err.println("Failed to autoconfig proxy due to "+e);
-            }
-            if (trace) {
-                e.printStackTrace();
-            }
-        }
-    }
-
     private static String decodeBase64(String inp) throws IOException {
         return new String(Base64.getDecoder().decode(inp));
     }
@@ -975,15 +908,7 @@
             }
         } finally {
             PlatformImpl.removeListener(listener);
-            // Workaround until RT-13281 is implemented
-            // Don't call exit if we detect an error in javaws mode
-//            PlatformImpl.tkExit();
-            final boolean isJavaws = System.getSecurityManager() != null;
-            if (error && isJavaws) {
-                System.err.println("Workaround until RT-13281 is implemented: keep toolkit alive");
-            } else {
-                PlatformImpl.tkExit();
-            }
+            PlatformImpl.tkExit();
         }
     }
 
@@ -1025,36 +950,12 @@
         });
     }
 
-    private static Method notifyMethod = null;
-
     public static void notifyPreloader(Application app, final PreloaderNotification info) {
         if (launchCalled.get()) {
             // Standalone launcher mode
             notifyCurrentPreloader(info);
             return;
         }
-
-        synchronized (LauncherImpl.class) {
-            if (notifyMethod == null) {
-                final String fxPreloaderClassName =
-                        "com.sun.deploy.uitoolkit.impl.fx.FXPreloader";
-                try {
-                    Class fxPreloaderClass = Class.forName(fxPreloaderClassName);
-                    notifyMethod = fxPreloaderClass.getMethod(
-                            "notifyCurrentPreloader", PreloaderNotification.class);
-                } catch (Exception ex) {
-                    ex.printStackTrace();
-                    return;
-                }
-            }
-        }
-
-        try {
-            // Call using reflection: FXPreloader.notifyCurrentPreloader(pe)
-            notifyMethod.invoke(null, info);
-        } catch (Exception ex) {
-            ex.printStackTrace();
-        }
     }
 
     // Not an instantiable class.
--- a/modules/javafx.graphics/src/main/java/com/sun/javafx/application/PlatformImpl.java	Fri Apr 13 20:16:45 2018 +0530
+++ b/modules/javafx.graphics/src/main/java/com/sun/javafx/application/PlatformImpl.java	Fri Apr 13 15:43:59 2018 -0700
@@ -121,7 +121,7 @@
 
     /**
      * Sets the name of the this application based on the Application class.
-     * This method is called by the launcher or by the deploy code, and is not
+     * This method is called by the launcher, and is not
      * called from the FX Application Thread, so we need to do it in a runLater.
      * We do not need to wait for the result since it will complete before the
      * Application start() method is called regardless.
--- a/modules/javafx.graphics/src/main/java/com/sun/javafx/css/StyleManager.java	Fri Apr 13 20:16:45 2018 +0530
+++ b/modules/javafx.graphics/src/main/java/com/sun/javafx/css/StyleManager.java	Fri Apr 13 15:43:59 2018 -0700
@@ -950,7 +950,7 @@
 
             /*
             ** we got an access control exception, so
-            ** we could be running from an applet/jnlp/or with a security manager.
+            ** we could be running with a security manager.
             ** we'll allow the app to read a css file from our runtime jar,
             ** and give it one more chance.
             */
--- a/modules/javafx.graphics/src/main/java/javafx/application/Application.java	Fri Apr 13 20:16:45 2018 +0530
+++ b/modules/javafx.graphics/src/main/java/javafx/application/Application.java	Fri Apr 13 15:43:59 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -342,10 +342,9 @@
      * </p>
      *
      * @param primaryStage the primary stage for this application, onto which
-     * the application scene can be set. The primary stage will be embedded in
-     * the browser if the application was launched as an applet.
+     * the application scene can be set.
      * Applications may create other stages, if needed, but they will not be
-     * primary stages and will not be embedded in the browser.
+     * primary stages.
      * @throws java.lang.Exception if something goes wrong
      */
     public abstract void start(Stage primaryStage) throws Exception;
@@ -371,7 +370,7 @@
     /**
      * Gets the HostServices provider for this application. This provides
      * the ability to get the code base and document base for this application,
-     * and to access the enclosing web page.
+     * and to show a web page in a browser.
      *
      * @return the HostServices provider
      */
@@ -386,8 +385,7 @@
 
     /**
      * Retrieves the parameters for this Application, including any arguments
-     * passed on the command line and any parameters specified in a JNLP file
-     * for an applet or WebStart application.
+     * passed on the command line.
      *
      * <p>
      * NOTE: this method should not be called from the Application constructor,
@@ -429,8 +427,7 @@
 
     /**
      * Encapsulates the set of parameters for an application. This includes
-     * arguments passed on the command line, unnamed parameters specified
-     * in a JNLP file, and &lt;name,value&gt; pairs specified in a JNLP file.
+     * arguments passed on the command line.
      *
      * <p>
      * Note that the application and the preloader both get the same set
@@ -450,8 +447,8 @@
          * Retrieves a read-only list of the raw arguments. This list
          * may be empty, but is never null. In the case of a standalone
          * application, it is the ordered list of arguments specified on the
-         * command line. In the case of an applet or WebStart application,
-         * it includes unnamed parameters as well as named parameters. For
+         * command line.
+         * For
          * named parameters, each &lt;name,value&gt; pair is represented as
          * a single argument of the form: "--name=value".
          *
@@ -472,8 +469,7 @@
         /**
          * Retrieves a read-only map of the named parameters. It may be
          * empty, but is never null.
-         * Named parameters include those &lt;name,value&gt; pairs explicitly
-         * specified in a JNLP file. It also includes any command line
+         * Named parameters include any command line
          * arguments of the form: "--name=value".
          *
          * @return a read-only map of named parameters.
--- a/modules/javafx.graphics/src/main/java/javafx/application/HostServices.java	Fri Apr 13 20:16:45 2018 +0530
+++ b/modules/javafx.graphics/src/main/java/javafx/application/HostServices.java	Fri Apr 13 15:43:59 2018 -0700
@@ -51,9 +51,7 @@
 
     /**
      * Gets the code base URI for this application.
-     * If the application was launched via a JNLP file, this method returns
-     * the codebase parameter specified in the JNLP file.
-     * If the application was launched in standalone mode, this method returns
+     * This method returns
      * the directory containing the application jar file. If the
      * application is not packaged in a jar file, this method
      * returns the empty string.
@@ -66,12 +64,7 @@
 
     /**
      * Gets the document base URI for this application.
-     * If the application is embedded in a browser, this method returns the
-     * URI of the web page containing the application.
-     * If the application was launched in webstart mode, this method returns
-     * the the codebase parameter specified in the JNLP file (the document
-     * base and the code base are the same in this mode).
-     * If the application was launched in standalone mode, this method returns
+     * This method returns
      * the URI of the current directory.
      *
      * @return the document base URI for this application.
--- a/modules/javafx.graphics/src/main/java/javafx/application/Platform.java	Fri Apr 13 20:16:45 2018 +0530
+++ b/modules/javafx.graphics/src/main/java/javafx/application/Platform.java	Fri Apr 13 15:43:59 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -192,9 +192,6 @@
      * method, then the Application stop method may not be called.
      *
      * <p>This method may be called from any thread.</p>
-     *
-     * <p>Note: if the application is embedded in a browser, then this method
-     * may have no effect.
      */
     public static void exit() {
         PlatformImpl.exit();
--- a/modules/javafx.graphics/src/main/java/javafx/application/Preloader.java	Fri Apr 13 20:16:45 2018 +0530
+++ b/modules/javafx.graphics/src/main/java/javafx/application/Preloader.java	Fri Apr 13 15:43:59 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,8 +32,7 @@
  * Class that is extended to define an optional preloader for a
  * JavaFX Application.
  * An application may contain a preloader that is used
- * to improve the application loading experience, especially for applications
- * that are embedded in a browser or launched in webstart execution mode.
+ * to improve the application loading experience.
  *
  * <p>
  * A preloader is a small application that is started
@@ -76,12 +75,8 @@
  * Custom preloader implementations should follow these rules:
  * </p>
  * <ol>
- *  <li>there should be class extending Preloader</li>
- *  <li>classes needed for preloader need to be packaged in the separate jar.
- *      We recommend this jar to be unsigned.</li>
- *  <li>JNLP deployment descriptor should have preloader-class attribute
- *      with full name of the class as value in the javafx-desc element
- *      and jars needed for progress need to have download="progress" type</li>
+ *  <li>a custom preloader class should extend Preloader</li>
+ *  <li>classes needed for preloader need to be packaged in the separate jar.</li>
  * </ol>
  *
  * <p>
@@ -215,7 +210,7 @@
 
     /**
      * Preloader notification that reports an error.
-     * This is delivered to preloader in case of problem with applet startup.
+     * This is delivered to preloader in case of problem with application startup.
      * @since JavaFX 2.0
      */
     public static class ErrorNotification implements PreloaderNotification {
--- a/modules/javafx.graphics/src/main/java/javafx/concurrent/Task.java	Fri Apr 13 20:16:45 2018 +0530
+++ b/modules/javafx.graphics/src/main/java/javafx/concurrent/Task.java	Fri Apr 13 15:43:59 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1002,7 +1002,7 @@
     // Need to assert the modifyThread permission so an app can cancel
     // a task that it created (the default executor for the service runs in
     // its own thread group)
-    // Note that this is needed when running as an applet or a web start app.
+    // Note that this is needed when running with a security manager.
     private static final Permission modifyThreadPerm = new RuntimePermission("modifyThread");
 
     @Override public boolean cancel(boolean mayInterruptIfRunning) {
--- a/modules/javafx.graphics/src/main/java/javafx/stage/Stage.java	Fri Apr 13 20:16:45 2018 +0530
+++ b/modules/javafx.graphics/src/main/java/javafx/stage/Stage.java	Fri Apr 13 15:43:59 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -313,8 +313,7 @@
     }
 
     /*
-     * sets this stage to be the primary stage.
-     * When run as an applet, this stage will appear in the broswer
+     * Sets this stage to be the primary stage.
      */
     void setPrimary(boolean primary) {
         this.primary = primary;
@@ -322,7 +321,6 @@
 
     /*
      * Returns whether this stage is the primary stage.
-     * When run as an applet, the primary stage will appear in the broswer
      *
      * @return true if this stage is the primary stage for the application.
      */
--- a/modules/javafx.graphics/src/main/java/javafx/stage/Window.java	Fri Apr 13 20:16:45 2018 +0530
+++ b/modules/javafx.graphics/src/main/java/javafx/stage/Window.java	Fri Apr 13 15:43:59 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -74,7 +74,7 @@
 /**
  * A top level window within which a scene is hosted, and with which the user
  * interacts. A Window might be a {@link Stage}, {@link PopupWindow}, or other
- * such top level. A Window is used also for browser plug-in based deployments.
+ * such top level window.
  * <p>
  * Window objects must be constructed and modified on the
  * JavaFX Application Thread.