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.

Bug 100168 - Fix imports dlg is keyboard-unfriendly
Summary: Fix imports dlg is keyboard-unfriendly
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords:
Depends on: 100170
Blocks:
  Show dependency tree
 
Reported: 2007-04-05 23:17 UTC by _ tboudreau
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch (34.06 KB, patch)
2007-04-05 23:18 UTC, _ tboudreau
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2007-04-05 23:17:52 UTC
(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.
Comment 1 _ tboudreau 2007-04-05 23:18:20 UTC
Created attachment 40529 [details]
Patch
Comment 2 Stanislav Aubrecht 2007-05-07 16:21:43 UTC
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
Comment 3 _ tboudreau 2007-05-24 23:34:32 UTC
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.
Comment 4 Stanislav Aubrecht 2007-05-25 07:09:17 UTC
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?
Comment 5 _ tboudreau 2007-05-25 08:44:03 UTC
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.
Comment 6 Stanislav Aubrecht 2007-05-25 08:59:12 UTC
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
Comment 7 _ tboudreau 2007-05-27 00:43:11 UTC
> 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.

Comment 8 Stanislav Aubrecht 2007-05-28 11:40:13 UTC
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