This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
(thought I filed this already but can't find it...) It takes far too many keystrokes to choose classes in the fix imports dialog. Part of the problem is that by default a JTable with a combo box will require one keystroke to establish edit mode and another to open the popup. Another problem is that in the table there is really one interesting column - the left hand one with the combo boxes - but it is necessary to navigate to it. Fortunately, I had to address exactly these issues when writing the property sheet (it is not nearly as easy as it sounds - making it work on all look and feels took a month). So I spent a while trying to hack all of the same fixes into your code, then realized, why not use the existing code in the property sheet. Attached is a patch that does that - I think you'll find the keyboard interactivity to be exactly what it ought to be for this dialog - press spacebar in either column to open the popup and choose, arrows or tab navigate, dialog buttons still work correctly, etc. Additionally it deletes 90% of the UI code from the dialog, and the property sheet code has had years of testing and bugfixing invested in it. It does involve a small API change for the property sheet - exposing two setters so the popup menu can be disabled and the description area can be hidden programmatically. It seems more than worth it. I'll file a separate issue for that - this problem could be solved by copying three or four large classes from the property sheet package, but this makes a lot more sense to do.
Created attachment 40529 [details] Patch
fixed (the table has been replaced with plain combo-boxes) Checking in JavaFixAllImports.java; /cvs/java/editor/src/org/netbeans/modules/java/editor/imports/JavaFixAllImports.java,v <-- JavaFixAllImports.java new revision: 1.6; previous revision: 1.5 done Checking in FixDuplicateImportStmts.java; /cvs/java/editor/src/org/netbeans/modules/java/editor/imports/FixDuplicateImportStmts.java,v <-- FixDuplicateImportStmts.java new revision: 1.3; previous revision: 1.2 done Checking in FixDuplicateImportStmts.form; /cvs/java/editor/src/org/netbeans/modules/java/editor/imports/FixDuplicateImportStmts.form,v <-- FixDuplicateImportStmts.form new revision: 1.3; previous revision: 1.2 done Checking in Bundle.properties; /cvs/java/editor/src/org/netbeans/modules/java/editor/imports/Bundle.properties,v <-- Bundle.properties new revision: 1.3; previous revision: 1.2 done
I wouldn't quite say it's fixed - what would be ideal fast keyboard navigation for fix imports: - Up/Down arrows navigate between combo boxes unless a popup is open - Space opens the popup on the selected row (right now it seems impossible to open the popup except with the mouse) - Space/enter with popup open accepts value (standard JCB behavior, but I can't get the popup open with the mouse) It's still more gestures than it should be to select things in this dialog.
and why not TAB to switch between the combo boxes (as the standard key for component navigation) and up/down arrows to select the right import (in most cases you don't need the popup at all). it's even less gestures than what you're suggesting. or is this not working for you on some os/lf other than ms windows?
Since the popup contents are not alpha sorted (or at least the default selection is not necessarily the first item - nor should it be), there is no way to tell how many down-arrow strokes it would take to get to the right element. It is less frustrating to actually see the available choices than to fly blind through a list of items with no idea how far away the one you want is.
on metal l&f the down arrow in a focused combo box opens the popup list, on windows it just changes the selected value without the popup. imho, there are usually 2-3 choices only (JList/List) and it's still faster to select the value without the popup instead of 1. open popup 2. navigate the to right value 3. close popup
> it's still faster to select the value without the popup instead of Only if you know whether you have to press the up arrow or the down arrow. For example, if I am using the class TreePath, I have the following choices in the following order: javax.swing.tree.TreePath com.sun.source.util.TreePath The swing class is the default. The com.sun class is what I want. I have to either see the popup, or press down arrow, see that nothing happens and then press up arrow (or use the mouse to open the popup). It's about the same number of gestures for two items, but once you have more than two, the only choice is to scroll through all of them (and hope you picked the right direction - it's non intuitive to need to press the up arrow on the initial selection). In short, the result with no popup is much more frustrating to work with - you don't know which direction to go, maybe don't realize that up is also an option. And it's too much of a learning curve to figure out that up is an option. The popup will make people feel more like they're in control.
space key now shows/hides the popup list /cvs/java/editor/src/org/netbeans/modules/java/editor/imports/FixDuplicateImportStmts.java,v <-- FixDuplicateImportStmts.java new revision: 1.9; previous revision: 1.8