diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterCheckBoxCell.java b/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterCheckBoxCell.java deleted file mode 100644 index 026ca01b89..0000000000 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterCheckBoxCell.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2014 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.timeline.ui.filtering; - -import javafx.scene.control.CheckBox; -import javafx.scene.control.TreeTableCell; -import org.sleuthkit.autopsy.timeline.filters.AbstractFilter; - -/** - * - */ -class FilterCheckBoxCell extends TreeTableCell { - - private CheckBox checkBox; - - public FilterCheckBoxCell() { - } - - @Override - protected void updateItem(AbstractFilter item, boolean empty) { - super.updateItem(item, empty); - - if (item == null) { - setText(null); - setGraphic(null); - checkBox = null; - } else { - setText(item.getDisplayName()); - - checkBox = new CheckBox(); - checkBox.selectedProperty().bindBidirectional(item.getActiveProperty()); - checkBox.disableProperty().bind(item.getDisabledProperty()); - setGraphic(checkBox); - } - } - -} diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterSetPanel.java b/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterSetPanel.java index 89f379f80f..ee1c507ed5 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterSetPanel.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterSetPanel.java @@ -18,15 +18,16 @@ */ package org.sleuthkit.autopsy.timeline.ui.filtering; -import java.net.URL; -import java.util.ResourceBundle; +import javafx.application.Platform; import javafx.beans.Observable; import javafx.fxml.FXML; import javafx.scene.control.Button; +import javafx.scene.control.CheckBox; import javafx.scene.control.ContextMenu; import javafx.scene.control.Menu; import javafx.scene.control.MenuItem; import javafx.scene.control.TreeItem; +import javafx.scene.control.TreeTableCell; import javafx.scene.control.TreeTableColumn; import javafx.scene.control.TreeTableRow; import javafx.scene.control.TreeTableView; @@ -47,12 +48,6 @@ import org.sleuthkit.autopsy.timeline.filters.Filter; */ public class FilterSetPanel extends BorderPane implements TimeLineView { - @FXML - private ResourceBundle resources; - - @FXML - private URL location; - @FXML private Button applyButton; @@ -163,10 +158,36 @@ public class FilterSetPanel extends BorderPane implements TimeLineView { this.filteredEvents.filter().addListener((Observable o) -> { refresh(); }); - } - public void refresh() { + private void refresh() { filterTreeTable.setRoot(new FilterTreeItem(this.filteredEvents.filter().get().copyOf())); } + + /** + * A {@link TreeTableCell} that represents the active state of a + * {@link AbstractFilter} as a checkbox + */ + private static class FilterCheckBoxCell extends TreeTableCell { + + private final CheckBox checkBox = new CheckBox(); + + @Override + protected void updateItem(AbstractFilter item, boolean empty) { + super.updateItem(item, empty); + Platform.runLater(() -> { + if (item == null) { + setText(null); + setGraphic(null); + checkBox.selectedProperty().unbind(); + checkBox.disableProperty().unbind(); + } else { + setText(item.getDisplayName()); + checkBox.selectedProperty().bindBidirectional(item.getActiveProperty()); + checkBox.disableProperty().bind(item.getDisabledProperty()); + setGraphic(checkBox); + } + }); + } + } }