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();
}
;
});
}
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;
}
}
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);
}
}
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;
}
});
}
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);
}
}
}
Aggregations