Remove count of warnings/criticals from GUI

This commit is contained in:
Armin Schrenk
2021-07-13 12:03:34 +02:00
parent 05f5856d66
commit e40ce62877
4 changed files with 14 additions and 4 deletions

View File

@@ -34,6 +34,7 @@ public class CheckDetailController implements FxController {
private final Binding<Boolean> checkCancelled;
private final Binding<Number> countOfWarnSeverity;
private final Binding<Number> countOfCritSeverity;
private final Binding<Boolean> warnOrCritsExist;
private final ResultListCellFactory resultListCellFactory;
public CheckStateIconView checkStateIconView;
@@ -56,6 +57,7 @@ public class CheckDetailController implements FxController {
this.checkFinished = EasyBind.combine(checkSucceeded, checkFailed, checkCancelled, (a, b, c) -> a || b || c);
this.countOfWarnSeverity = results.reduce(countSeverity(DiagnosticResult.Severity.WARN));
this.countOfCritSeverity = results.reduce(countSeverity(DiagnosticResult.Severity.CRITICAL));
this.warnOrCritsExist = EasyBind.combine(checkSucceeded, countOfWarnSeverity, countOfCritSeverity, (suceeded, warns, crits) -> suceeded && (warns.longValue() > 0 || crits.longValue() > 0) );
selectedTask.addListener(this::selectedTaskChanged);
}
@@ -156,6 +158,14 @@ public class CheckDetailController implements FxController {
return checkCancelled.getValue();
}
public Binding<Boolean> warnOrCritsExistProperty() {
return warnOrCritsExist;
}
public boolean isWarnOrCritsExist() {
return warnOrCritsExist.getValue();
}
public Binding<Boolean> checkCancelledProperty() {
return checkCancelled;
}

View File

@@ -19,6 +19,7 @@ import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ListView;
import javafx.scene.control.SelectionMode;
import javafx.stage.Stage;
import java.io.IOException;
import java.util.List;
@@ -60,6 +61,7 @@ public class CheckListController implements FxController {
@FXML
public void initialize() {
checksListView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
checksListView.setItems(checks);
checksListView.setCellFactory(view -> new CheckListCell());
selectedCheck.bind(checksListView.getSelectionModel().selectedItemProperty());