/* 
 * Diplomová práce ÚSI VUT 
 * Forenzní analýza webového prohlížeče
 *
 * Autor: Michal Bača
 * Datum: 20.5.2015
 */
package yafft;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Modality;
import javafx.stage.Stage;

/**
 *
 * @author michal
 */
public class YafftImExWizard {

    /*  public YafftImExWizard(Boolean doImport, YafftMainWindowController controller) {
     this(doImport);
        
       
     }*/
    public YafftImExWizard(Boolean doImport, YafftMainWindowController mainWindowController) {

        try {
            Stage stage = new Stage();
            stage.initModality(Modality.APPLICATION_MODAL);

            FXMLLoader loader = new FXMLLoader(getClass().getResource("yafftImExWizard.fxml"));

            Parent root = (Parent) loader.load();
            Scene scene = new Scene(root);

            stage.setScene(scene);

            YafftImExWizardController controller = loader.<YafftImExWizardController>getController();
            if (doImport) {
                controller.setImport();
                stage.setTitle("YaFFt Průvodce importem");
            } else {
                controller.setExport();
                stage.setTitle("YaFFt Průvodce exportem");
            }

            controller.setMainWindowController(mainWindowController);
            controller.setStage(stage);

            controller.myInit();

            stage.show();

        } catch (IOException ex) {
            Logger.getLogger(YafftImExWizard.class.getName()).log(Level.SEVERE, null, ex);
        }

    }

}
