Feature: implement search filter in show preferences#4759
Conversation
Add a search box in show preferences window to allow users to filter preference options. Resolves #1019
| } | ||
|
|
||
| List<JabRefPreferencesFilter.PreferenceOption> filteredOptions = auxillaryPreferenceOptions.stream() | ||
| .filter(p -> p.getKey().toLowerCase().contains(searchText)) |
There was a problem hiding this comment.
Better use LOCALE.ROOT as second parameter for the toLowerCase function to avoid unexpected problems:
https://garygregory.wordpress.com/2015/11/03/java-lowercase-conversion-turkey/
There was a problem hiding this comment.
Understood, I have made the necessary changes.
|
Codewise lgtm. Could you please provide a screenshot how it looks like when the search matched/text is found? |
tobiasdiez
left a comment
There was a problem hiding this comment.
Thanks for your PR. The code looks good and works, but can still be a bit improved using a FilteredList (which encapsulates some of the things you had to implement your own).
| </bottom> | ||
| <top> | ||
| <HBox> | ||
| <TextField fx:id="searchField" promptText="Search"/> |
There was a problem hiding this comment.
Please use %Search so that the text get localized properly.
|
|
||
| private final JabRefPreferencesFilter preferencesFilter; | ||
| private final ObservableList<JabRefPreferencesFilter.PreferenceOption> preferenceOptions; | ||
| private final List<JabRefPreferencesFilter.PreferenceOption> auxillaryPreferenceOptions; |
There was a problem hiding this comment.
If you use the FilteredList, then the code gets somewhat cleaner (as you don't need to manage two lists on your own). Have a look here:
jabref/src/main/java/org/jabref/gui/maintable/MainTableDataModel.java
Lines 29 to 33 in b39ed7b
There was a problem hiding this comment.
Thank you for the suggestions! I have made the necessary changes.
|
@Siedlerchr I have added a screenshot now. |
|
|
Yeah! That's cool, looks good, I would move the checkbox to the top next to the search field. |
|
But the |
|
On moving the checkbox to the top next to the search field, what are your opinion on it @tobiasdiez @Siedlerchr ? |
|
Yep, that is exactly what I meant'! Looks good! And thanks for fixing this longstanding issue ;) |
|
I am glad it came out as expected! :) |
tobiasdiez
left a comment
There was a problem hiding this comment.
Thanks! The code looks good and I like the idea of having the count bound to the actual number of entries displayed.
…erbibtexkey * upstream/master: (827 commits) [#4306] Disable renaming (#4727) Feature: implement search filter in show preferences (#4759) Enable import button only if entry selected (#4761) Improve Remote messaging (#4760) Add changelog entry for #4520 Modifications to improve contrast of UI elements (#4758) Rework external changes dialog in JavaFX (#4693) Changes the title of Group Dialog to Add subgroup when adding a new subgroup (#4757) Optimize data fetching (#4520) Adds a browse button next to the path text field for aux-based groups (#4743) Saving changes and exiting application (#4729) Code optimized and created a reusable method to get writer output (#4750) Bump mvvmfx from 1.7.0 to 1.8.0 (#4747) Bump guava from 27.0.1-jre to 27.1-jre (#4748) Bump mvvmfx-validation from 1.7.0 to 1.8.0 (#4749) Remove obsolete swing components in Preferences and OpenOffice (#4740) Move library specific key pattern dialog call to library menu (#4744) Revert "Revert "Fix: bibkey generated does not handle diacritics" (#4741)" (#4742) Revert "Fix: bibkey generated does not handle diacritics" (#4741) Rename method to removeUnwantedCharacters ...

Add a search box in show preferences window to allow users to filter
preference options.
Resolves #1019