Search in sources :

Example 6 with TextInputDialog

use of javafx.scene.control.TextInputDialog in project tokentool by RPTools.

the class ManageOverlays_Controller method addFolderButton_onAction.

@FXML
void addFolderButton_onAction(ActionEvent event) {
    TextInputDialog dialog = new TextInputDialog();
    dialog.setTitle(I18N.getString("ManageOverlays.filechooser.folder.title"));
    dialog.setContentText(I18N.getString("ManageOverlays.filechooser.folder.content_text"));
    Optional<String> result = dialog.showAndWait();
    result.ifPresent(name -> {
        if (FileSaveUtil.makeDir(name, currentDirectory)) {
            displayTreeView();
        }
        ;
    });
}
Also used : TextInputDialog(javafx.scene.control.TextInputDialog) FXML(javafx.fxml.FXML)

Example 7 with TextInputDialog

use of javafx.scene.control.TextInputDialog in project placar-eletronico by GeovaniNieswald.

the class Utils method prompt.

public static Optional<String> prompt(String titulo, String cabecalho, String label) {
    TextInputDialog dialog = new TextInputDialog();
    dialog.setTitle(titulo);
    dialog.setHeaderText(cabecalho);
    dialog.setContentText(label);
    Optional<String> result = dialog.showAndWait();
    if (result.isPresent()) {
        return result;
    } else {
        return null;
    }
}
Also used : TextInputDialog(javafx.scene.control.TextInputDialog)

Example 8 with TextInputDialog

use of javafx.scene.control.TextInputDialog in project jvarkit by lindenb.

the class JfxNgs method openBamUrl.

void openBamUrl(final Window owner) {
    final String lastkey = "last.bam.url";
    final TextInputDialog dialog = new TextInputDialog(this.preferences.get(lastkey, ""));
    dialog.setContentText("URL:");
    dialog.setTitle("Get BAM URL");
    dialog.setHeaderText("Input BAM URL");
    final Optional<String> choice = dialog.showAndWait();
    if (!choice.isPresent())
        return;
    BamFile input = null;
    try {
        input = BamFile.newInstance(choice.get());
        this.preferences.put(lastkey, choice.get());
        final BamStage stage = new BamStage(JfxNgs.this, input);
        stage.show();
    } catch (final Exception err) {
        CloserUtil.close(input);
        showExceptionDialog(owner, err);
    }
}
Also used : ScriptException(javax.script.ScriptException) BackingStoreException(java.util.prefs.BackingStoreException) IOException(java.io.IOException) TextInputDialog(javafx.scene.control.TextInputDialog)

Example 9 with TextInputDialog

use of javafx.scene.control.TextInputDialog in project latexdraw by arnobl.

the class ExportTemplate method doCmdBody.

@Override
protected void doCmdBody() {
    // NON-NLS
    final TextInputDialog dialog = new TextInputDialog("templateFileName");
    dialog.setHeaderText(LangTool.INSTANCE.getBundle().getString("DrawContainer.nameTemplate"));
    dialog.showAndWait().ifPresent(name -> {
        // NON-NLS
        final String path = LPath.PATH_TEMPLATES_DIR_USER + File.separator + name + ".svg";
        if (Paths.get(path).toFile().exists()) {
            final Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
            alert.setHeaderText(LangTool.INSTANCE.getBundle().getString("DrawContainer.overwriteTemplate"));
            alert.setTitle(LangTool.INSTANCE.getBundle().getString("LaTeXDrawFrame.42"));
            if (alert.showAndWait().orElse(ButtonType.CANCEL) == ButtonType.OK) {
                SVGDocumentGenerator.INSTANCE.saveTemplate(path, progressBar, statusWidget, templatesPane);
                ok = true;
            }
        } else {
            SVGDocumentGenerator.INSTANCE.saveTemplate(path, progressBar, statusWidget, templatesPane);
            ok = true;
        }
    });
}
Also used : Alert(javafx.scene.control.Alert) TextInputDialog(javafx.scene.control.TextInputDialog)

Example 10 with TextInputDialog

use of javafx.scene.control.TextInputDialog in project financial by greatkendy123.

the class TGAddCommentController method addTypeItemAction.

/**
 * 添加类别选项
 *
 * @time 2018年3月3日
 * @param event
 */
public void addTypeItemAction(ActionEvent event) {
    TextInputDialog dialog = new TextInputDialog();
    dialog.setTitle("添加");
    dialog.setHeaderText(null);
    dialog.setContentText("新增类别选项:");
    Optional<String> result = dialog.showAndWait();
    if (result.isPresent()) {
        String newPayItem = result.get();
        if (typeItems.contains(newPayItem)) {
            ShowUtil.show("已经存在类别选项:" + newPayItem);
        } else {
            // 修改界面和缓存
            typeItems.add(newPayItem);
            typeChoice.setItems(FXCollections.observableArrayList(typeItems));
            // 更新到数据库
            saveTypeItem();
            // 刷新
            initTypeChoice();
            // 自动选值
            typeChoice.getSelectionModel().select(newPayItem);
        }
    }
}
Also used : TextInputDialog(javafx.scene.control.TextInputDialog)

Aggregations

TextInputDialog (javafx.scene.control.TextInputDialog)38 Alert (javafx.scene.control.Alert)12 FXML (javafx.fxml.FXML)9 ActionEvent (javafx.event.ActionEvent)8 EventHandler (javafx.event.EventHandler)8 KeyFrame (javafx.animation.KeyFrame)7 Timeline (javafx.animation.Timeline)7 Stage (javafx.stage.Stage)7 ReplyUtil (eu.ggnet.dwoss.common.ReplyUtil)6 AccessableAction (eu.ggnet.saft.core.auth.AccessableAction)6 ActionEvent (java.awt.event.ActionEvent)6 Dl (eu.ggnet.saft.Dl)5 Ui (eu.ggnet.saft.Ui)5 Reply (eu.ggnet.saft.api.Reply)5 IOException (java.io.IOException)4 Guardian (eu.ggnet.saft.core.auth.Guardian)3 Point (java.awt.Point)3 Optional (java.util.Optional)3 StringUtils (org.apache.commons.lang3.StringUtils)3 CircuitState (com.cas.sim.tis.app.state.CircuitState)2