Use a separate search bar in the global search window#11032
Conversation
| private void initialize() { | ||
| viewModel = new GlobalSearchResultDialogViewModel(preferencesService); | ||
|
|
||
| SearchResultDialogSearchBar searchBar = new SearchResultDialogSearchBar(libraryTabContainer, stateManager, preferencesService, undoManager); |
There was a problem hiding this comment.
I like the idea of having this as a separate component, but inside you have bascially duplicate functionality/content to the normal "SearchBar". Can the normal search bar also be adapted to use this new component?
DRY (Don't Repeat Yourself) Principle
There was a problem hiding this comment.
I tried to avoid these duplications, but I don't know how to handle them. Should I create a new class containing some static methods and call them? Or what do you suggest? The only difference between the two classes is the removal of two buttons (keepSearchString, openGlobalSearchButton) and a change in the listener to listen to the newly introduced property activeGlobalSearchQuery.
There was a problem hiding this comment.
Pass the listener as Consumer parameter and maybe pass an enum e.g. NORMAL_SEARCH, GLOBAL_SEARCH and adapt the buttons accordingly
|
|
Uhh, wouldnt that make the global search Dialog be the some kind of a second instance of jabref without groups and entry editor? |
Maybe kind of, but I haven't changed of its functionality. We can consider it an instance of the main table containing all opened libraries. |
Siedlerchr
left a comment
There was a problem hiding this comment.
Thanks, lgtm! Changelog is missing
Closes #11024
Added a search bar in the global search window.
CHANGELOG.mddescribed in a way that is understandable for the average user (if applicable)