< prev index next >

apps/toys/Hello/src/main/java/hello/HelloHostServices.java

Print this page
rev 10669 : 8187149: Remove HostServices::getWebContext
Reviewed-by:

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -40,11 +40,10 @@
     @Override
     public void start(Stage stage) {
         final HostServices hs = getHostServices();
         final Label codeBaseText = new Label();
         final Label documentBaseText = new Label();
-        final Label webContextText = new Label();
         final Label showDocumentText = new Label();
 
         stage.setTitle("Hello HostServices");
 
         String userDir = System.getProperty("user.dir");

@@ -65,28 +64,22 @@
 
         documentBaseText.setPrefWidth(400);
         Button getDocumentBaseBtn = new Button("Get DocumentBase");
         getDocumentBaseBtn.setOnAction(event -> documentBaseText.setText(hs.getDocumentBase()));
 
-        // getWebContext() in HostServices has been deprecated and marked for removal
-        Button getWebContextBtn = new Button("Get WebContext");
-        getWebContextBtn.setOnAction(event -> webContextText.setText(
-                (hs.getWebContext() != null) ? hs.getWebContext().toString() : "NULL"));
-
         Button showDocmentBtn = new Button("Show Document");
         showDocmentBtn.setOnAction(event
                 -> showDocument(hs, showDocumentText, "http://www.oracle.com/java/"));
 
         VBox textBox = new VBox(15);
         textBox.setFillWidth(false);
-        textBox.getChildren().addAll(codeBaseText, documentBaseText, webContextText, showDocumentText);
+        textBox.getChildren().addAll(codeBaseText, documentBaseText, showDocumentText);
 
         VBox buttonBox = new VBox(5);
         buttonBox.getChildren().addAll(
                 getCodeBaseBtn,
                 getDocumentBaseBtn,
-                getWebContextBtn,
                 showDocmentBtn);
 
         HBox root = new HBox(7);
         root.setPadding(new Insets(11, 12, 12, 11));
         root.getChildren().addAll(buttonBox, textBox);
< prev index next >