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)); + } }