Skip to content

Commit

Permalink
Add option to recalculate the option universe
Browse files Browse the repository at this point in the history
  • Loading branch information
nea89o committed Sep 9, 2023
1 parent 941236b commit 6121f3b
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ private void propagateSearchinessForAccordions(Set<ProcessedOption> options, Set
}

public void updateSearchResults() {
updateSearchResults(false);
}

public void updateSearchResults(boolean recalculateOptionUniverse) {
if(recalculateOptionUniverse){
allOptions.clear();
for (ProcessedCategory category : processedConfig.getAllCategories().values()) {
allOptions.addAll(category.options);
}
}
String toSearch = searchField.getText().trim().toLowerCase(Locale.ROOT);
if (!toSearch.isEmpty()) {
Set<ProcessedOption> matchingOptions = new HashSet<>(allOptions);
Expand Down

0 comments on commit 6121f3b

Please sign in to comment.