package de.kwirz.yapne.app;

import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.Window;

/**
 * Hilfsklasse zum Erstellen von modalen Dialogen
 *
 */
public class Dialogs {

	public static void show(Parent root, Stage stage) {
		final Scene sourceScene = stage.getScene();
        final Window sourceWindow = sourceScene.getWindow();
		
		final Stage dialog = new Stage();
        dialog.initModality(Modality.APPLICATION_MODAL);
        dialog.initOwner(sourceWindow);
        dialog.centerOnScreen();
                
        dialog.setScene(new Scene(root));
        dialog.show();
	}
	
}

@@ -204,16 +204,8 @@
 von 
-modalen 
 Dial
@@ -209,16 +209,16 @@
 ialogen%0A
+
  *%0A */%0Ap
@@ -293,18 +293,255 @@
 tage) %7B%0A
-%09%09
+        createDialog(root, stage).show();%0A%09%7D%0A%0A    public static void showAndWait(Parent root, Stage stage) %7B%0A        createDialog(root, stage).showAndWait();%0A    %7D%0A%0A    private static Stage createDialog(Parent root, Stage stage) %7B%0A        
 final Sc
@@ -641,13 +641,17 @@
 ();%0A
-%09%09%0A%09%09
+%0A        
 fina
@@ -814,25 +814,9 @@
 ();%0A
-                
 %0A
+
     
@@ -865,24 +865,27 @@
     
-dialog.show();%0A%09
+return dialog;%0A    
 %7D%0A%09%0A

add showAndWait method