-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a separate search bar in the global search window #11032
Conversation
@@ -53,6 +57,10 @@ public GlobalSearchResultDialog(UndoManager undoManager) { | |||
private void initialize() { | |||
viewModel = new GlobalSearchResultDialogViewModel(preferencesService); | |||
|
|||
SearchResultDialogSearchBar searchBar = new SearchResultDialogSearchBar(libraryTabContainer, stateManager, preferencesService, undoManager); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, lgtm! Changelog is missing
Closes #11024
Added a search bar in the global search window.
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)