Java Code Examples for javafx.stage.Modality#WINDOW_MODAL

The following examples show how to use javafx.stage.Modality#WINDOW_MODAL . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AlertDialog.java    From AsciidocFX with Apache License 2.0 5 votes vote down vote up
public AlertDialog() {
    super(AlertType.WARNING, null, ButtonType.YES, ButtonType.CANCEL);
    super.setTitle("Warning");
    super.initModality(Modality.WINDOW_MODAL);
    setDefaultIcon(super.getDialogPane());
    showAlwaysOnTop(this);
}
 
Example 2
Source File: BatchTableController.java    From MyBox with Apache License 2.0 4 votes vote down vote up
protected void expandDirectories() {
    if (tableData == null || tableData.isEmpty()) {
        return;
    }
    synchronized (this) {
        if (task != null) {
            return;
        }
        task = new SingletonTask<Void>() {
            private boolean changed = false;

            @Override
            protected boolean handle() {
                int index = 0;
                isSettingValues = true;
                while (index < tableData.size()) {
                    File file = file(index);
                    if (file.isFile()) {
                        if (isValidFile(file)) {
                            index++;
                        } else {
                            tableData.remove(index);
                            changed = true;
                        }
                        continue;
                    }
                    tableData.remove(index);
                    changed = true;
                    List<File> files = FileTools.allFiles(file);
                    if (files == null || files.isEmpty()) {
                        continue;
                    }
                    List<File> valids = new ArrayList<>();
                    for (File afile : files) {
                        if (isValidFile(afile)) {
                            valids.add(afile);
                        }
                    }
                    if (valids.isEmpty()) {
                        continue;
                    }
                    addFiles(index, valids);
                    index += valids.size();
                }
                isSettingValues = false;

                return true;
            }

            @Override
            protected void whenSucceeded() {
                if (changed) {
                    tableView.refresh();
                    tableChanged();
                }
            }

        };
        super.openHandlingStage(task, Modality.WINDOW_MODAL);
        Thread thread = new Thread(task);
        thread.setDaemon(true);
        thread.start();
    }

}
 
Example 3
Source File: AlertDialog.java    From AsciidocFX with Apache License 2.0 4 votes vote down vote up
public AlertDialog(AlertType alertType) {
    super(alertType);
    super.initModality(Modality.WINDOW_MODAL);
    setDefaultIcon(super.getDialogPane());
    showAlwaysOnTop(this);
}
 
Example 4
Source File: AlertDialog.java    From AsciidocFX with Apache License 2.0 4 votes vote down vote up
public AlertDialog(AlertType alertType, String contentText, ButtonType... buttons) {
    super(alertType, contentText, buttons);
    super.initModality(Modality.WINDOW_MODAL);
    setDefaultIcon(super.getDialogPane());
    showAlwaysOnTop(this);
}
 
Example 5
Source File: WindowModalAlert.java    From AsciidocFX with Apache License 2.0 4 votes vote down vote up
public WindowModalAlert(AlertType alertType) {
    super(alertType);
    super.initModality(Modality.WINDOW_MODAL);
    showAlwaysOnTop(this);
}
 
Example 6
Source File: WindowModalAlert.java    From AsciidocFX with Apache License 2.0 4 votes vote down vote up
public WindowModalAlert(AlertType alertType, String contentText, ButtonType... buttons) {
    super(alertType, contentText, buttons);
    super.initModality(Modality.WINDOW_MODAL);
    showAlwaysOnTop(this);
}