< prev index next >

modules/graphics/src/main/java/javafx/application/HostServices.java

Print this page
rev 9802 : 8156963: Add @Deprecated annotation to HostServices.getWebContext method
Reviewed-by:
   1 /*
   2  * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 133      * This handle is used to access the web page by calling from Java into
 134      * JavaScript.
 135      * If the application is not embedded into a web page, this method
 136      * return null.
 137      *
 138      * <p>Example:</p>
 139      * <ul>
 140      * <pre>
 141      * JSObject jsWin = getHostServices().getWebContext();
 142      * if (jsWin != null) {
 143      *     jsWin.eval("var b = document.body;" +
 144      *                "var newdiv = document.createElement('div');" +
 145      *                "newdiv.innerHTML = '&lt;br&gt;Hello from JavaScript!';" +
 146      *                "b.appendChild(newdiv);");
 147      * }
 148      * </pre>
 149      * </ul>
 150      *
 151      * @return handle of the enclosing DOM window of the web page containing
 152      * this application



 153      */

 154     public final JSObject getWebContext() {
 155         return delegate.getWebContext();
 156     }
 157 
 158 }
   1 /*
   2  * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 133      * This handle is used to access the web page by calling from Java into
 134      * JavaScript.
 135      * If the application is not embedded into a web page, this method
 136      * return null.
 137      *
 138      * <p>Example:</p>
 139      * <ul>
 140      * <pre>
 141      * JSObject jsWin = getHostServices().getWebContext();
 142      * if (jsWin != null) {
 143      *     jsWin.eval("var b = document.body;" +
 144      *                "var newdiv = document.createElement('div');" +
 145      *                "newdiv.innerHTML = '&lt;br&gt;Hello from JavaScript!';" +
 146      *                "b.appendChild(newdiv);");
 147      * }
 148      * </pre>
 149      * </ul>
 150      *
 151      * @return handle of the enclosing DOM window of the web page containing
 152      * this application
 153      *
 154      * @deprecated This method is deprecated as of JDK 9 because the
 155      * {@link java.applet.Applet Applet} API is deprecated.
 156      */
 157     @Deprecated // FIXME: (since = "9")
 158     public final JSObject getWebContext() {
 159         return delegate.getWebContext();
 160     }
 161 
 162 }
< prev index next >