Search in sources :

Example 16 with DirectoryChooser

use of javafx.stage.DirectoryChooser in project Gargoyle by callakrsos.

the class DialogUtil method showDirSaveDialog.

public static File showDirSaveDialog(Window ownerWindow, File initDir, Consumer<DirectoryChooser> option) {
    DirectoryChooser chooser = new DirectoryChooser();
    chooser.setInitialDirectory(initDir);
    chooser.setTitle("Directory");
    if (option != null)
        option.accept(chooser);
    File selectedDir = chooser.showDialog(ownerWindow);
    if (selectedDir != null && selectedDir.exists()) {
        applyLastPath(selectedDir);
    }
    return selectedDir;
}
Also used : File(java.io.File) DirectoryChooser(javafx.stage.DirectoryChooser)

Aggregations

DirectoryChooser (javafx.stage.DirectoryChooser)16 File (java.io.File)8 FXML (javafx.fxml.FXML)6 CodeGenFile (ilargia.entitas.codeGeneration.data.CodeGenFile)4 BaseController (com.spawpaw.mybatis.generator.gui.controller.BaseController)1 Constants (com.spawpaw.mybatis.generator.gui.util.Constants)1 RenderManager (fractal.RenderManager)1 Popup (io.bitsquare.gui.main.overlays.popups.Popup)1 Dimension (java.awt.Dimension)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 SimpleDateFormat (java.text.SimpleDateFormat)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 CancellationException (java.util.concurrent.CancellationException)1 Platform (javafx.application.Platform)1 Alert (javafx.scene.control.Alert)1 Button (javafx.scene.control.Button)1 ButtonType (javafx.scene.control.ButtonType)1 Label (javafx.scene.control.Label)1