-
Notifications
You must be signed in to change notification settings - Fork 912
Improve quick search behavior in OutlineView, TreeTable, and ListView #8319
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
base: master
Are you sure you want to change the base?
Conversation
eea89d9 to
d41f4f7
Compare
Details: * For OutlineView and TreeTable, avoid changing the selection when pressing Escape. (TreeView already has the desired behavior.) * Add F3 and Ctrl/Command+G as alternative keystrokes for next-match (and Shift variants for previous-match). * Have QuickSearch select all when invoking Ctrl+F or alternative shortcuts while the search bar is already open. * Make the ListView's quick search box look more modern, and consistent with that of OutlineView/TreeView. Use the magnifying glass icon instead of the text 'Search', and use a flat border style. * Add more alternative find-next/previous keystrokes for ListView, like we did in QuickSearch (which is used by TreeView and OutlineView but not ListView). On Ctrl+F or F3, open the search bar, or select-all the existing text if it is already open. * In OutlineView and TreeTable, avoid backtracking to the first hit if backspace is pressed on a still-matching selection.
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 think this introduces regressions in the IDE (see inline comments). I don't think this should merged as is.
| keyCode == KeyEvent.VK_LEFT || keyCode == KeyEvent.VK_RIGHT || | ||
| keyCode == KeyEvent.VK_TAB || keyCode == KeyEvent.VK_F3) { | ||
| keyCode == KeyEvent.VK_TAB || keyCode == KeyEvent.VK_F3 || | ||
| keyCode == KeyEvent.VK_ENTER && ke.getModifiersEx() == KeyEvent.SHIFT_DOWN_MASK || |
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.
| keyCode == KeyEvent.VK_ENTER && ke.getModifiersEx() == KeyEvent.SHIFT_DOWN_MASK || | |
| (keyCode == KeyEvent.VK_ENTER && ke.getModifiersEx() == KeyEvent.SHIFT_DOWN_MASK) || |
| keyCode == KeyEvent.VK_F3 && e.getModifiersEx() == KeyEvent.SHIFT_DOWN_MASK || | ||
| keyCode == KeyEvent.VK_ENTER && e.getModifiersEx() == KeyEvent.SHIFT_DOWN_MASK || |
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.
| keyCode == KeyEvent.VK_F3 && e.getModifiersEx() == KeyEvent.SHIFT_DOWN_MASK || | |
| keyCode == KeyEvent.VK_ENTER && e.getModifiersEx() == KeyEvent.SHIFT_DOWN_MASK || | |
| (keyCode == KeyEvent.VK_F3 && e.getModifiersEx() == KeyEvent.SHIFT_DOWN_MASK) || | |
| (keyCode == KeyEvent.VK_ENTER && e.getModifiersEx() == KeyEvent.SHIFT_DOWN_MASK) || |
| } | ||
| }); | ||
| InputMap im = component.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); | ||
| im.put(Utilities.stringToKey("D-F"), "openQuickSearch"); |
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 is a problem in Project and Files views in the IDE as it overrides the project wide searches.
| keyCode == KeyEvent.VK_F3 && e.getModifiersEx() == 0 || | ||
| /* We can't use ENTER to go to the next match, as this keystroke is used to | ||
| invoke the row's default action. */ | ||
| /* keyCode == KeyEvent.VK_ENTER && e.getModifiersEx() == 0 || */ |
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.
Does it really make sense to handle Shift-Enter, but not Enter?
| quickSearchInitialColumn = -1; | ||
| } | ||
|
|
||
| private static final boolean RESTORE_PRIOR_SELECTION_AFTER_QUICK_SEARCH = false; |
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.
What is the idea here? Is this a fancy way of commenting out code?
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.
Oh, sorry I left that in. I'll remove it...
(Yes, fancy way to comment out code, especially when I need to experiment with different UI behaviors for a while before deciding what works or not. It also survives later refactoring.)
|
moving to NB29 |
Quick search is the little search bar that pops up when you start typing in various NetBeans explorer view components:
This PR unifies the search bar behavior in OutlineView, TreeTable, and ListView, with some adjustments and bug fixes. Mostly the search bar should work like a search bar in any other app, e.g. Chrome. Some common alternative keystrokes are handled for Find Next/Previous.
Details: