19 package org.sleuthkit.autopsy.timeline.ui.filtering;
21 import java.util.function.Supplier;
22 import javafx.beans.property.SimpleBooleanProperty;
23 import javafx.beans.value.ObservableBooleanValue;
24 import javafx.scene.control.CheckBox;
25 import javafx.scene.control.IndexedCell;
31 private final CheckBox checkBox =
new CheckBox();
32 private SimpleBooleanProperty selectedProperty;
33 private ObservableBooleanValue disabledProperty;
36 protected void configureCell(IndexedCell<? extends X> cell, X item,
boolean empty, Supplier<X> supplier) {
37 if (selectedProperty != null) {
38 checkBox.selectedProperty().unbindBidirectional(selectedProperty);
40 if (disabledProperty != null) {
41 checkBox.disableProperty().unbind();
45 cell.setGraphic(null);
47 checkBox.setText(item.getDisplayName());
49 selectedProperty = item.selectedProperty();
50 checkBox.selectedProperty().bindBidirectional(selectedProperty);
51 disabledProperty = item.disabledProperty();
52 checkBox.disableProperty().bind(disabledProperty);
53 cell.setGraphic(checkBox);