Search in sources :

Example 71 with StringUtils.isBlank

use of org.apache.commons.lang3.StringUtils.isBlank in project dwoss by gg-net.

the class DeleteUnitAction method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    Ui.exec(() -> {
        Ui.build().title("SopoNr die gelöscht werden soll").dialog().eval(() -> {
            TextInputDialog dialog = new TextInputDialog();
            dialog.setContentText("SopoNr die gelöscht werden soll:");
            return dialog;
        }).opt().filter(s -> !StringUtils.isBlank(s)).ifPresent(r -> {
            Ui.build().dialog().eval(() -> new Alert(CONFIRMATION, "SopoNr " + r + " wirklich gelöschen ?")).opt().map(s -> ReplyUtil.wrap(() -> Dl.remote().lookup(UnitDestroyer.class).verifyScarpOrDeleteAble(r))).filter(Ui.failure()::handle).map(Reply::getPayload).ifPresent(u -> {
                Dl.remote().lookup(UnitDestroyer.class).delete(u, "Löschung aus UI", Dl.local().lookup(Guardian.class).getUsername());
                Ui.build().alert().message("SopoNr " + r + " ist gelöscht.").show(AlertType.INFO);
            });
        });
    });
}
Also used : Alert(javafx.scene.control.Alert) AccessableAction(eu.ggnet.saft.core.auth.AccessableAction) Ui(eu.ggnet.saft.Ui) DELETE_UNIQUE_UNIT(eu.ggnet.dwoss.rights.api.AtomicRight.DELETE_UNIQUE_UNIT) ActionEvent(java.awt.event.ActionEvent) StringUtils(org.apache.commons.lang3.StringUtils) Dl(eu.ggnet.saft.Dl) CONFIRMATION(javafx.scene.control.Alert.AlertType.CONFIRMATION) Guardian(eu.ggnet.saft.core.auth.Guardian) AlertType(eu.ggnet.saft.core.ui.AlertType) ReplyUtil(eu.ggnet.dwoss.common.ReplyUtil) TextInputDialog(javafx.scene.control.TextInputDialog) Reply(eu.ggnet.saft.api.Reply) UnitDestroyer(eu.ggnet.dwoss.receipt.ee.UnitDestroyer) Alert(javafx.scene.control.Alert) UnitDestroyer(eu.ggnet.dwoss.receipt.ee.UnitDestroyer) TextInputDialog(javafx.scene.control.TextInputDialog)

Aggregations

StringUtils (org.apache.commons.lang3.StringUtils)54 List (java.util.List)33 Collectors (java.util.stream.Collectors)29 Map (java.util.Map)28 Set (java.util.Set)27 ArrayList (java.util.ArrayList)23 Optional (java.util.Optional)22 Collections (java.util.Collections)19 Logger (org.slf4j.Logger)19 LoggerFactory (org.slf4j.LoggerFactory)19 IOException (java.io.IOException)18 HashSet (java.util.HashSet)18 Collection (java.util.Collection)16 HashMap (java.util.HashMap)16 StopWatch (org.apache.commons.lang3.time.StopWatch)13 Autowired (org.springframework.beans.factory.annotation.Autowired)11 Slf4j (lombok.extern.slf4j.Slf4j)10 InputStream (java.io.InputStream)9 Inject (javax.inject.Inject)8 RegisteredTemplate (com.thinkbiganalytics.feedmgr.rest.model.RegisteredTemplate)7