From ddcf547f22b01ea79678b45e1eda9f71424cd3fb Mon Sep 17 00:00:00 2001 From: jmillman Date: Fri, 15 Apr 2016 16:54:43 -0400 Subject: [PATCH] set initial disabled state of sub filters based on active state of compound filter --- .../timeline/ui/filtering/FilterTreeItem.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterTreeItem.java b/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterTreeItem.java index 59368eeab6..58be2a2554 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterTreeItem.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterTreeItem.java @@ -79,8 +79,20 @@ final public class FilterTreeItem extends TreeItem { * disable the subfilters if the compound filter is not active. */ compoundFilter.activeProperty().addListener(activeProperty -> { - compoundFilter.getSubFilters().forEach(subFilter -> subFilter.setDisabled(compoundFilter.isActive() == false)); + disableSubFiltersIfNotActive(compoundFilter); }); + + disableSubFiltersIfNotActive(compoundFilter); } } + + /** + * disable the sub-filters of the given compound filter if it is not active + * + * @param compoundFilter the compound filter + */ + static private void disableSubFiltersIfNotActive(CompoundFilter compoundFilter) { + boolean inactive = compoundFilter.isActive() == false; + compoundFilter.getSubFilters().forEach(subFilter -> subFilter.setDisabled(inactive)); + } }