functional/FxmlTests/src/test/fxmltests/app/staticPropertyLoadApp.java.excluded

Print this page



   1 /*
   2  * Copyright (c) 2014, 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
  23  * questions.
  24  */
  25 package test.fxmltests.app;
  26 
  27 import com.sun.javafx.fxml.LoadListener;
  28 import com.sun.javafx.fxml.ParseTraceElement;
  29 import java.io.File;
  30 import java.io.IOException;
  31 import java.io.InputStream;
  32 import java.net.URL;
  33 import java.nio.charset.Charset;
  34 import java.util.ArrayList;
  35 import java.util.HashMap;
  36 import java.util.LinkedList;
  37 import java.util.List;
  38 import java.util.Locale;
  39 import java.util.ResourceBundle;
  40 import java.util.logging.Level;
  41 import java.util.logging.Logger;
  42 import javafx.collections.FXCollections;
  43 import javafx.collections.ObservableList;
  44 import javafx.css.CssMetaData;
  45 import javafx.css.ParsedValue;
  46 import javafx.css.StyleConverter;
  47 import javafx.css.Styleable;
  48 import javafx.event.ActionEvent;
  49 import javafx.event.EventHandler;
  50 import javafx.fxml.FXMLLoader;
  51 import javafx.fxml.JavaFXBuilderFactory;
  52 import javafx.fxml.LoadException;
  53 import javafx.scene.Group;
  54 
  55 
  56 import javafx.scene.Node;
  57 import javafx.scene.Scene;
  58 import javafx.scene.control.Button;
  59 import javafx.scene.control.Label;
  60 import javafx.scene.control.Labeled;
  61 import javafx.scene.control.ListView;
  62 import javafx.scene.control.Menu;
  63 import javafx.scene.control.MenuBar;
  64 import javafx.scene.control.MenuItem;
  65 import javafx.scene.control.RadioButton;
  66 import javafx.scene.control.TableColumn;
  67 import javafx.scene.control.TableView;
  68 import javafx.scene.control.ToggleGroup;
  69 import javafx.scene.control.cell.PropertyValueFactory;
  70 import javafx.scene.input.KeyCombination;
  71 import javafx.scene.layout.*;
  72 import javafx.scene.paint.Color;
  73 import javafx.scene.paint.Paint;
  74 import javafx.scene.shape.Rectangle;
  75 import javafx.scene.text.Font;
  76 import javafx.scene.text.Text;
  77 import javafx.util.Callback;
  78 import javafx.util.Pair;
  79 import org.jemmy.control.Wrap;
  80 
  81 import test.javaclient.shared.BasicButtonChooserApp;
  82 import test.javaclient.shared.JemmyUtils;
  83 import test.javaclient.shared.PageWithSlots;
  84 import test.javaclient.shared.TestNode;
  85 import test.javaclient.shared.Utils;
  86 
  87 public class staticPropertyLoadApp extends BasicButtonChooserApp {
  88 
  89     public static final String RESOURCE_BASE = "/test/fxmltests/resources/";
  90     public static final String staticPropertyResourcePath = RESOURCE_BASE + "static-property.fxml";
  91     public static final String hashmapResourcePath = RESOURCE_BASE + "hashmap.fxml";
  92     public static final String customClassLoadResourcePath = RESOURCE_BASE + "include.fxml";
  93     public static final String factoryResourcePath = RESOURCE_BASE + "factory.fxml";
  94     public static final String builderResourcePath = RESOURCE_BASE + "builder.fxml";
  95     public static final String propertyElementsResourcePath = RESOURCE_BASE + "propertyElements.fxml";
  96     public static final String referenceResourcePath = RESOURCE_BASE + "reference.fxml";
  97     public static final String copyResourcePath = RESOURCE_BASE + "fxcopy.fxml";
  98     public static final String propertySetterResourcePath = RESOURCE_BASE + "propertySetter.fxml";
  99     public static final String roListResourcePath = RESOURCE_BASE + "rolist.fxml";
 100     public static final String roMapResourcePath = RESOURCE_BASE + "romap.fxml";
 101     public static final String defaultPropertyResourcePath = RESOURCE_BASE + "defaultProperty.fxml";
 102     public static final String fxdefineResourcePath = RESOURCE_BASE + "fxdefine.fxml";


1942                 list.add((Labeled) loader2.load());
1943 //                System.out.println(label.getStyle());
1944             }
1945             catch(Exception e)
1946             {
1947                 e.printStackTrace();
1948                 System.out.println("message: " + e.getMessage());
1949                 reportGetterFailure("message: " + e.getMessage());
1950             }
1951             try
1952             {
1953                 list.add((Labeled) loader3.load());
1954 //                System.out.println(label.getStyle());
1955             }
1956             catch(Exception e)
1957             {
1958                 e.printStackTrace();
1959                 System.out.println("message: " + e.getMessage());
1960                 reportGetterFailure("message: " + e.getMessage());
1961             }
1962             return VBoxBuilder.create().children(list).build();


1963 
1964         }
1965 
1966     }
1967 
1968     public static final String references2Path = RESOURCE_BASE + "ref_test.fxml";
1969     private class references2Slot extends TestNodeWithIOExceptionProcessing {
1970         // RT-18178
1971         AnchorPane anchorPane = null;
1972 
1973         @Override
1974         protected String impl_getPathToResource() {
1975             return references2Path;
1976         }
1977 
1978         @Override
1979         public Node impl_drawNode() throws IOException {
1980             InputStream is = null;
1981             try {
1982                 FXMLLoader fxmlLoader2 = new FXMLLoader();


2191             }
2192         }
2193     }
2194 
2195     private class listenerNullArgSlot extends TestNodeWithIOExceptionProcessing {
2196         // RT-19133
2197 
2198         @Override
2199         protected String impl_getPathToResource() {
2200             return rt19133ResourcePath;
2201         }
2202 
2203         @Override
2204         public Node impl_drawNode() throws IOException {
2205             //InputStream is = null;
2206             try {
2207                 //is = resource.openStream();
2208                 FXMLLoader fxmlLoader = new FXMLLoader(resource);
2209 
2210                 fxmlLoader.impl_setStaticLoad(true);
2211                 fxmlLoader.impl_setLoadListener(new LoadListener() {
2212 
2213                     @Override
2214                     public void readImportProcessingInstruction(String target) {
2215                     }
2216 
2217                     @Override
2218                     public void readLanguageProcessingInstruction(String language) {
2219                     }
2220 
2221                     @Override
2222                     public void readComment(String comment) {
2223                     }
2224 
2225                     @Override
2226                     public void beginInstanceDeclarationElement(Class<?> type) {
2227                     }
2228 
2229                     @Override
2230                     public void beginUnknownTypeElement(String name) {
2231                     }


   1 // https://bugs.openjdk.java.net/browse/INTJDK-7624138
   2 /*
   3  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation. Oracle designates this
   9  * particular file as subject to the "Classpath" exception as provided
  10  * by Oracle in the LICENSE file that accompanied this code.
  11  *
  12  * This code is distributed in the hope that it will be useful, but WITHOUT
  13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  15  * version 2 for more details (a copy is included in the LICENSE file that
  16  * accompanied this code).
  17  *
  18  * You should have received a copy of the GNU General Public License version
  19  * 2 along with this work; if not, write to the Free Software Foundation,
  20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21  *
  22  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  23  * or visit www.oracle.com if you need additional information or have any
  24  * questions.
  25  */
  26 package test.fxmltests.app;
  27 
  28 import javafx.fxml.LoadListener;
  29 import com.sun.javafx.fxml.ParseTraceElement;
  30 import java.io.File;
  31 import java.io.IOException;
  32 import java.io.InputStream;
  33 import java.net.URL;
  34 import java.nio.charset.Charset;
  35 import java.util.ArrayList;
  36 import java.util.HashMap;
  37 import java.util.LinkedList;
  38 import java.util.List;
  39 import java.util.Locale;
  40 import java.util.ResourceBundle;
  41 import java.util.logging.Level;
  42 import java.util.logging.Logger;
  43 import javafx.collections.FXCollections;
  44 import javafx.collections.ObservableList;
  45 import javafx.css.CssMetaData;


  46 import javafx.css.Styleable;
  47 import javafx.event.ActionEvent;
  48 import javafx.event.EventHandler;
  49 import javafx.fxml.FXMLLoader;
  50 import javafx.fxml.JavaFXBuilderFactory;
  51 import javafx.fxml.LoadException;
  52 import javafx.scene.Group;
  53 
  54 
  55 import javafx.scene.Node;
  56 import javafx.scene.Scene;
  57 import javafx.scene.control.Button;
  58 import javafx.scene.control.Label;
  59 import javafx.scene.control.Labeled;
  60 import javafx.scene.control.ListView;
  61 import javafx.scene.control.Menu;
  62 import javafx.scene.control.MenuBar;
  63 import javafx.scene.control.MenuItem;
  64 import javafx.scene.control.RadioButton;
  65 import javafx.scene.control.TableColumn;
  66 import javafx.scene.control.TableView;
  67 import javafx.scene.control.ToggleGroup;
  68 import javafx.scene.control.cell.PropertyValueFactory;
  69 import javafx.scene.input.KeyCombination;
  70 import javafx.scene.layout.*;
  71 import javafx.scene.paint.Color;

  72 import javafx.scene.shape.Rectangle;
  73 import javafx.scene.text.Font;
  74 import javafx.scene.text.Text;
  75 import javafx.util.Callback;
  76 import javafx.util.Pair;

  77 
  78 import test.javaclient.shared.BasicButtonChooserApp;

  79 import test.javaclient.shared.PageWithSlots;
  80 import test.javaclient.shared.TestNode;
  81 import test.javaclient.shared.Utils;
  82 
  83 public class staticPropertyLoadApp extends BasicButtonChooserApp {
  84 
  85     public static final String RESOURCE_BASE = "/test/fxmltests/resources/";
  86     public static final String staticPropertyResourcePath = RESOURCE_BASE + "static-property.fxml";
  87     public static final String hashmapResourcePath = RESOURCE_BASE + "hashmap.fxml";
  88     public static final String customClassLoadResourcePath = RESOURCE_BASE + "include.fxml";
  89     public static final String factoryResourcePath = RESOURCE_BASE + "factory.fxml";
  90     public static final String builderResourcePath = RESOURCE_BASE + "builder.fxml";
  91     public static final String propertyElementsResourcePath = RESOURCE_BASE + "propertyElements.fxml";
  92     public static final String referenceResourcePath = RESOURCE_BASE + "reference.fxml";
  93     public static final String copyResourcePath = RESOURCE_BASE + "fxcopy.fxml";
  94     public static final String propertySetterResourcePath = RESOURCE_BASE + "propertySetter.fxml";
  95     public static final String roListResourcePath = RESOURCE_BASE + "rolist.fxml";
  96     public static final String roMapResourcePath = RESOURCE_BASE + "romap.fxml";
  97     public static final String defaultPropertyResourcePath = RESOURCE_BASE + "defaultProperty.fxml";
  98     public static final String fxdefineResourcePath = RESOURCE_BASE + "fxdefine.fxml";


1938                 list.add((Labeled) loader2.load());
1939 //                System.out.println(label.getStyle());
1940             }
1941             catch(Exception e)
1942             {
1943                 e.printStackTrace();
1944                 System.out.println("message: " + e.getMessage());
1945                 reportGetterFailure("message: " + e.getMessage());
1946             }
1947             try
1948             {
1949                 list.add((Labeled) loader3.load());
1950 //                System.out.println(label.getStyle());
1951             }
1952             catch(Exception e)
1953             {
1954                 e.printStackTrace();
1955                 System.out.println("message: " + e.getMessage());
1956                 reportGetterFailure("message: " + e.getMessage());
1957             }
1958             VBox vb = new VBox();
1959             vb.getChildren().addAll(list);
1960             return vb;
1961 
1962         }
1963 
1964     }
1965 
1966     public static final String references2Path = RESOURCE_BASE + "ref_test.fxml";
1967     private class references2Slot extends TestNodeWithIOExceptionProcessing {
1968         // RT-18178
1969         AnchorPane anchorPane = null;
1970 
1971         @Override
1972         protected String impl_getPathToResource() {
1973             return references2Path;
1974         }
1975 
1976         @Override
1977         public Node impl_drawNode() throws IOException {
1978             InputStream is = null;
1979             try {
1980                 FXMLLoader fxmlLoader2 = new FXMLLoader();


2189             }
2190         }
2191     }
2192 
2193     private class listenerNullArgSlot extends TestNodeWithIOExceptionProcessing {
2194         // RT-19133
2195 
2196         @Override
2197         protected String impl_getPathToResource() {
2198             return rt19133ResourcePath;
2199         }
2200 
2201         @Override
2202         public Node impl_drawNode() throws IOException {
2203             //InputStream is = null;
2204             try {
2205                 //is = resource.openStream();
2206                 FXMLLoader fxmlLoader = new FXMLLoader(resource);
2207 
2208                 fxmlLoader.impl_setStaticLoad(true);
2209                 fxmlLoader.setLoadListener(new LoadListener() {
2210 
2211                     @Override
2212                     public void readImportProcessingInstruction(String target) {
2213                     }
2214 
2215                     @Override
2216                     public void readLanguageProcessingInstruction(String language) {
2217                     }
2218 
2219                     @Override
2220                     public void readComment(String comment) {
2221                     }
2222 
2223                     @Override
2224                     public void beginInstanceDeclarationElement(Class<?> type) {
2225                     }
2226 
2227                     @Override
2228                     public void beginUnknownTypeElement(String name) {
2229                     }