From c01c405f203a74322a79fdb4797aadbf6579677b Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Fri, 21 May 2021 13:16:14 +0200 Subject: [PATCH] add select all checkbox --- .../org/cryptomator/ui/health/CheckListController.java | 10 ++++++++++ main/ui/src/main/resources/fxml/health_check_list.fxml | 2 ++ 2 files changed, 12 insertions(+) diff --git a/main/ui/src/main/java/org/cryptomator/ui/health/CheckListController.java b/main/ui/src/main/java/org/cryptomator/ui/health/CheckListController.java index b91c4bca3..4ad6fd242 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/health/CheckListController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/health/CheckListController.java @@ -16,10 +16,12 @@ import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleIntegerProperty; import javafx.beans.property.SimpleObjectProperty; +import javafx.beans.value.ObservableValue; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.concurrent.Worker; import javafx.fxml.FXML; +import javafx.scene.control.CheckBox; import javafx.scene.control.ListView; import javafx.scene.control.cell.CheckBoxListCell; import javafx.stage.Stage; @@ -51,6 +53,7 @@ public class CheckListController implements FxController { private final BooleanProperty showResultScreen; /* FXML */ + public CheckBox selectAllBox; public ListView checksListView; @@ -90,6 +93,13 @@ public class CheckListController implements FxController { } })); selectedTask.bind(checksListView.getSelectionModel().selectedItemProperty()); + selectAllBox.selectedProperty().addListener(this::selectOrDeselectAll); + selectAllBox.visibleProperty().bind(showResultScreen.not()); + selectAllBox.managedProperty().bind(showResultScreen.not()); + } + + public void selectOrDeselectAll(ObservableValue observable, boolean oldValue, boolean newValue) { + listPickIndicators.forEach( (task, pickProperty) -> pickProperty.set(newValue)); } @FXML diff --git a/main/ui/src/main/resources/fxml/health_check_list.fxml b/main/ui/src/main/resources/fxml/health_check_list.fxml index c3261626c..5cf3219a9 100644 --- a/main/ui/src/main/resources/fxml/health_check_list.fxml +++ b/main/ui/src/main/resources/fxml/health_check_list.fxml @@ -9,6 +9,7 @@ +