use of javafx.scene.control.ButtonType.OK in project dwoss by gg-net.
the class ExportDossierToXlsAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
Ui.exec(() -> {
Ui.build().title("Bitte DossierId eingeben").dialog().eval(() -> {
TextInputDialog dialog = new TextInputDialog();
dialog.setContentText("Bitte DossierId eingeben:");
dialog.getDialogPane().lookupButton(OK).disableProperty().bind(Bindings.createBooleanBinding(() -> dialog.getEditor().getText().trim().isEmpty(), dialog.getEditor().textProperty()));
return dialog;
}).opt().filter(s -> !StringUtils.isBlank(s)).map(r -> ReplyUtil.wrap(() -> Ui.osOpen(Dl.remote().lookup(DocumentSupporter.class).toXls(r).toTemporaryFile()))).filter(Ui.failure()::handle);
});
}
use of javafx.scene.control.ButtonType.OK in project dwoss by gg-net.
the class ImportImageIdsAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
Ui.exec(() -> {
Optional<File> inFile = Ui.fileChooser().open().opt();
if (!inFile.isPresent())
return;
Ui.build().dialog().eval(() -> new Alert(CONFIRMATION, "ImageIds aus der Datei:" + inFile.get().getPath() + " importieren ?")).opt().filter(b -> b == OK).map(b -> TikaUtil.isExcel(inFile.get())).filter(Ui.failure()::handle).map(Reply::getPayload).map(f -> Ui.progress().call(() -> Dl.remote().lookup(ImageIdHandler.class).importMissing(new FileJacket("in", ".xls", f)))).filter(Ui.failure()::handle).isPresent();
});
}
use of javafx.scene.control.ButtonType.OK in project dwoss by gg-net.
the class ScrapUnitAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
Ui.exec(() -> {
Ui.build().title("SopoNr die verschrottet werden soll").dialog().eval(() -> {
TextInputDialog dialog = new TextInputDialog();
dialog.setContentText("SopoNr die verschrottet werden soll:");
return dialog;
}).opt().filter(s -> !StringUtils.isBlank(s)).ifPresent(r -> {
Ui.build().dialog().eval(() -> new Alert(CONFIRMATION, "SopoNr " + r + " wirklich verschrotten ?")).opt().filter(b -> b == OK).map(u -> ReplyUtil.wrap(() -> Dl.remote().lookup(UnitDestroyer.class).verifyScarpOrDeleteAble(r))).filter(Ui.failure()::handle).map(Reply::getPayload).ifPresent(u -> {
Ui.build().title("Bitte Grund angeben").dialog().eval(() -> {
TextInputDialog dialog = new TextInputDialog();
dialog.setContentText("Bitte Grund angeben");
dialog.getDialogPane().lookupButton(OK).disableProperty().bind(Bindings.createBooleanBinding(() -> dialog.getEditor().getText().trim().isEmpty(), dialog.getEditor().textProperty()));
return dialog;
}).opt().filter(s -> !StringUtils.isBlank(s)).ifPresent(c -> {
Dl.remote().lookup(UnitDestroyer.class).scrap(u, c, Dl.local().lookup(Guardian.class).getUsername());
Ui.build().alert().message("SopoNr " + r + " ist verschrottet.").show(AlertType.INFO);
});
});
});
});
}
Aggregations