-
-
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
Searchbar across all bib files instead each having its own #1549
Conversation
BasePanel currentBasePanel = getCurrentBasePanel(); | ||
if (currentBasePanel == null) { | ||
globalSearchBar.setVisible(false); | ||
globalSearchBar.setAutoCompleter(null); | ||
return; | ||
} |
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.
This only disables the global search bar when the last database will be closed. But the search bar will be shown when one is starting jabref with no open database.
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.
good catch, I'll fix it quickly
Good work 👍 |
I am really happy that you are working on this. Is it correct, that the "global search" window will be abandoned? I have no idea whether it is causing any conflict with the current implementation of the search mechanism, but I am one of those who is using it rather extensively. There are two scenarios, where a global search is useful:
Both scenarios could be managed by creating groups, and if global search gets abandoned, I will certainly do. However, I like the tab based style of several bib files very much, because I don't have the feeling that my project related articles get lost in my huge database with thousands of entries |
👍 for keeping the global search window. Please readd it. @bartsch-dev There are many JabRef users having more than 10 bib files. They do not want to click through all 10 files for each search. |
Another aspect: What happens if the horiztonal space is not enough to display all icons and the search bar? Will the searchbar be displayed beneath the icon bar? |
Based on another issue the minimum width of the window is already around 1000 pixels (depending on look-an-feel, OS, etc), so it is crucial that it will fold. But it indeed looks promising! |
if the window is too small for the toolbar it will now wrap between the normal buttons and the searchbar. The search result Dialog will now remember its location; the global search has a shortcut (ctrl+shift+f, #573); enter in the result dialog will select the entry in the BasePanel (#617); the Reuslt window is cloasable with ctrl+w if fdocused (#573 (comment)); and the result dialog won't stay at top anymore if the MainFrame is focused and they are on top of each other. |
REPLACE_STRING("Replace string", Localization.lang("Replace string"), "ctrl R"), | ||
RESOLVE_DUPLICATE_BIBTEX_KEYS("Resolve duplicate BibTeX keys", Localization.lang("Resolve duplicate BibTeX keys"), "ctrl shift D"), | ||
SAVE_ALL("Save all", Localization.lang("Save all"), "ctrl alt S"), | ||
SAVE_DATABASE("Save database", Localization.lang("Save database"), "ctrl S"), | ||
SAVE_DATABASE_AS( | ||
"Save database as ...", Localization.lang("Save database as..."), "ctrl shift S"), | ||
SAVE_DATABASE_AS("Save database as ...", Localization.lang("Save database as..."), "ctrl shift S"), |
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.
Please do not change the format of lines you didn't modify.
Please resolve conflicts. |
@@ -90,7 +93,7 @@ public GlobalSearchBar() { | |||
|
|||
openCurrentResultsInDialog.setToolTipText(Localization.lang("Show search results in a window")); | |||
openCurrentResultsInDialog.addActionListener(ae -> { |
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.
Please rename the variable "ae", same goes for the other listeners named "l"
EDIT: It does focus the correct entry if I am already in the right tab, but if it has to focus a different tab it always selects the first entry. Did I missunderstand the sentence or is this a bug? |
private final JTextFieldWithUnfocusedText searchField = new JTextFieldWithUnfocusedText(Localization.lang("Search") + "..."); | ||
private final JButton clearSearchButton = new JButton(IconTheme.JabRefIcon.CLOSE.getSmallIcon()); | ||
private final JButton openCurrentResultsInDialog = new JButton(IconTheme.JabRefIcon.OPEN_IN_NEW_WINDOW.getSmallIcon()); | ||
private final JButton globalSearch = new JButton(Localization.lang("Search globally")); |
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.
Can you find an icon for this as well? Toolbars shouldn't include buttons with large strings.
Should be fixed now! |
toolBar.add(new HelpAction(HelpFiles.SEARCH)); | ||
|
||
toolBar.addSeparator(); | ||
toolBar.add(currentResults); |
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.
This will cause the toolbar to jump around when typing and clearing a search query. To fit the searchbar in the first row I need to use full screen mode and than there is no space to the right at all. So once I start typing the result text will be displayed and the searchbar jumps to the second row, when I clear the search it jumps back to the 1st row since the text is invisible. In my opinion the text with the number of found results should be somewhere else.
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've set the preffered size of the lable to 100px which contains the standard Found X entries
-Message.
Is it possible to work on the global search in this PR, too?
|
- The search result Window will now show which entry belongs to which bib file | ||
- The search result Window will now remember its location | ||
- The search result Window won't stay on top anymore if the main Window is focused and will be present in the taskbar | ||
- The User can jump from the searchbar to the maintabel with `ctrl + enter` |
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.
fix typos user
, maintable
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.
Keyboard shortcuts should be rendered consistenly without space before and after +
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.
fixed
fixed |
Tested with bce1bf5 - not fixed: |
* master: Remove obsolete wrapper task Added error dialog when setting invalid main file directory (#1921) Add filteringCharset = 'UTF-8' (#1945) Include https://github.com/grimes2 Searchbar across all bib files instead each having its own (#1549) Some OO/LO cleanups (#1927) Update link Removed external dependency in logic (#1934)
* master: Remove obsolete wrapper task Added error dialog when setting invalid main file directory (JabRef#1921) Add filteringCharset = 'UTF-8' (JabRef#1945) Include https://github.com/grimes2 Searchbar across all bib files instead each having its own (JabRef#1549) Some OO/LO cleanups (JabRef#1927) Update link Removed external dependency in logic (JabRef#1934)
Implemented #825.
The SearchBar is now in the top Toolbar instead of each Tab having its own (always at the right).
On Tab change the Tab gets updated.
The Autocomplete is bound to the current Tab (maybe extend this one in another PR?).
The old global Search (opening all findings in a new Window) is gone, do we really need it?