apps/scenebuilder/SceneBuilderApp/src/com/oracle/javafx/scenebuilder/app/SceneBuilderTest.java

Print this page
rev 9240 : 8076423: JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization


 393      * Closes the preview window associated to a document window.
 394      * Performs nothing if documentScene is not a scene associated to a
 395      * document window or if preview window is not opened.
 396      * 
 397      * @param documentScene a scene holding a document window
 398      */
 399     public static void closePreviewWindow(Scene documentScene) {
 400         final DocumentWindowController dwc = lookupWindowController(documentScene);
 401         if (dwc != null) {
 402             dwc.getPreviewWindowController().closeWindow();
 403         }
 404     }
 405     
 406     /**
 407      * Starts the application in test mode.
 408      * In this mode, no files are opened at application startup.
 409      * 
 410      * @param args arguments to SceneBuilderApp.main()
 411      */
 412     public static void startApplication(String[] args) {
 413         AppPlatform.setStartingFromTestBed(true);
 414         SceneBuilderApp.main(args);
 415     }
 416     
 417     /*
 418      * Private
 419      */
 420     
 421     private static FXOMDocument lookupFxomDocument(Scene documentScene) {
 422         final FXOMDocument result;
 423         
 424         final DocumentWindowController dwc = lookupWindowController(documentScene);
 425         if (dwc == null) {
 426             result = null;
 427         } else {
 428             result = dwc.getEditorController().getFxomDocument();
 429         }
 430         
 431         return result;
 432     }
 433     




 393      * Closes the preview window associated to a document window.
 394      * Performs nothing if documentScene is not a scene associated to a
 395      * document window or if preview window is not opened.
 396      * 
 397      * @param documentScene a scene holding a document window
 398      */
 399     public static void closePreviewWindow(Scene documentScene) {
 400         final DocumentWindowController dwc = lookupWindowController(documentScene);
 401         if (dwc != null) {
 402             dwc.getPreviewWindowController().closeWindow();
 403         }
 404     }
 405     
 406     /**
 407      * Starts the application in test mode.
 408      * In this mode, no files are opened at application startup.
 409      * 
 410      * @param args arguments to SceneBuilderApp.main()
 411      */
 412     public static void startApplication(String[] args) {

 413         SceneBuilderApp.main(args);
 414     }
 415     
 416     /*
 417      * Private
 418      */
 419     
 420     private static FXOMDocument lookupFxomDocument(Scene documentScene) {
 421         final FXOMDocument result;
 422         
 423         final DocumentWindowController dwc = lookupWindowController(documentScene);
 424         if (dwc == null) {
 425             result = null;
 426         } else {
 427             result = dwc.getEditorController().getFxomDocument();
 428         }
 429         
 430         return result;
 431     }
 432