mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-23 13:11:28 +00:00
add select all checkbox
This commit is contained in:
@@ -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<HealthCheckTask> 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<? extends Boolean> observable, boolean oldValue, boolean newValue) {
|
||||
listPickIndicators.forEach( (task, pickProperty) -> pickProperty.set(newValue));
|
||||
}
|
||||
|
||||
@FXML
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import java.lang.Integer?>
|
||||
<?import javafx.scene.layout.StackPane?>
|
||||
<?import javafx.scene.control.CheckBox?>
|
||||
<VBox xmlns:fx="http://javafx.com/fxml"
|
||||
xmlns="http://javafx.com/javafx"
|
||||
fx:controller="org.cryptomator.ui.health.CheckListController"
|
||||
@@ -25,6 +26,7 @@
|
||||
<VBox minWidth="80" maxWidth="200" spacing="6" HBox.hgrow="ALWAYS" >
|
||||
<Label fx:id="listHeading" text="%health.check.listHeader"/>
|
||||
<!-- TODO:HEADER with select all checkbox -->
|
||||
<CheckBox fx:id="selectAllBox" text="FIX: SELECT ALL" />
|
||||
<ListView fx:id="checksListView" VBox.vgrow="ALWAYS"/>
|
||||
</VBox>
|
||||
<StackPane visible="${controller.showResultScreen}" managed="${controller.showResultScreen}" HBox.hgrow="ALWAYS" >
|
||||
|
||||
Reference in New Issue
Block a user