<commit_before>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();
	}
	
}<commit_msg>add showAndWait method<commit_after>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 Dialogen
 *
 */
public class Dialogs {

	public static void show(Parent root, Stage stage) {
        createDialog(root, stage).show();
	}

    public static void showAndWait(Parent root, Stage stage) {
        createDialog(root, stage).showAndWait();
    }

    private static Stage createDialog(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));
        return dialog;
    }
	
}
{'fraction_non_alphanumeric': 0.10264290104486785, 'fraction_numerical': 0.0, 'mean_word_length': 3.306878306878307, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1780555', 'n_tokens_mistral': 490, 'n_tokens_neox': 473, 'n_words': 114}