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 54264

Summary: A11Y: Tab key is consumed by Explorer
Product: platform Reporter: Jaromir Uhrik <juhrik>
Component: Window SystemAssignee: Milos Kleint <mkleint>
Status: CLOSED FIXED    
Severity: blocker CC: saubrecht
Priority: P2 Keywords: A11Y, FOCUS
Version: 4.x   
Hardware: PC   
OS: Windows ME/2000   
Issue Type: DEFECT Exception Reporter:
Attachments: alternative fix

Description Jaromir Uhrik 2005-02-01 10:13:30 UTC
[200401311900; jdk1.4.2]
When the TAB is pressed in Explorer, Favorites and
other such components then it is not possible to
find the focus and navigation from keyboard is not
possible until switching e.g. Form Explorer to
Favorites and back.
Comment 1 David Simonek 2005-02-10 12:15:38 UTC
I think it should be fixed directly in explorer like components,
Swing's  focus cycle traversals should be properly defined and then
Tab will be switching among components in focus cycle traversal (or do
nothing).
Comment 2 Petr Nejedly 2005-02-17 23:08:31 UTC
The tab key is not consumed by the explorer. It correctly lets the
framework pass the focus along.
The next thing in the chain is (according to the focus lost event) the
tab control:
Focus event:
java.awt.event.FocusEvent[FOCUS_LOST,permanent,opposite=org.netbeans.core.windows.view.ui.tabcontrol.TabbedAdapter[,0,0,330x488,layout=java.awt.BorderLayout,alignmentX=null,alignmentY=null,border=javax.swing.border.LineBorder@13f7cd2,flags=320,maximumSize=,minimumSize=,preferredSize=]]
on
org.openide.explorer.view.TreeView$ExplorerTree[,0,0,328x465,alignmentX=null,alignmentY=null,border=javax.swing.border.EmptyBorder@1b277f0,flags=360,maximumSize=,minimumSize=,preferredSize=,editable=true,invokesStopCellEditing=false,largeModel=false,rootVisible=false,rowHeight=18,scrollsOnExpand=true,showsRootHandles=true,toggleClickCount=0,visibleRowCount=20]
Comment 3 Milos Kleint 2005-02-18 08:06:15 UTC
TabbedAdapter.setFocusable(false) seems to cure the problem. (at leat
on macosx)
Dafe, any idea if this could be harmful? I'm always kind of defensive
when dealing with focus.
Comment 4 Milos Kleint 2005-02-18 14:45:04 UTC
it's not ok.
it seems the that focus cycle gets out of the TabbedAdapter component
onto the whole window and that assigns it to the first component in
it.. usually it's the topleft explorer.
 that's wrong.
Comment 5 Milos Kleint 2005-02-23 13:58:52 UTC
fix by copy&modify of LayoutFocusTraversalPolicy. Create a focus cycle
within a TabbedContainer, never allowing the focus to leave the active
TopComponent.

The fix seems to work with the most common components in the IDE
desktop, but there could be special cases that could fail. Therefore I
would prefer not to integrate into beta1, but give it more testing
beforehand..

Checking in
swing/tabcontrol/src/org/netbeans/swing/tabcontrol/TabbedContainer.java;
/cvs/core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/TabbedContainer.java,v
 <--  TabbedContainer.java
new revision: 1.12; previous revision: 1.11
Comment 6 Jaromir Uhrik 2005-02-25 15:58:26 UTC
I have tested the use tab in most of IDE components and it seems to be
fine. Verified in dev build #200502241900; jdk1.5.0_02-b07
Comment 7 Stanislav Aubrecht 2005-11-10 16:10:27 UTC
Created attachment 26832 [details]
alternative fix
Comment 8 Stanislav Aubrecht 2005-11-10 16:18:03 UTC
i'm fixing issue 61092 and found out that the problem is in TabbedContainer.
when it's used in a standalone dialog window (e.g. properties dialog) it somehow
consumes the focus and it's not possible to navigate the properties dialog with
a tab key without a mouse-click first.

after some experiments i discovered that both issues (54264 and 61092) are fixed
just by removing 'setFocusable( true )' from the TabbedContainer (compare to
revision 1.11). then the focus works as expected both in the properties dialog
and main window modes as well.

milos, what do you think?
Comment 9 Milos Kleint 2005-11-11 06:50:04 UTC
how come the tabbedcontainer is used in dialogs?

i have no problem with it, but please test extensively, I remember this bug to
be somewhat esoteric in nature..
Comment 10 Stanislav Aubrecht 2005-11-14 16:16:14 UTC
the property sheet uses tab control and the property sheet can be embedded in a
dialog window.
Comment 11 Stanislav Aubrecht 2005-11-14 17:30:25 UTC
tested on winxp, jdk 1.4-1.6

Checking in TabbedContainer.java;
/cvs/core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/TabbedContainer.java,v
 <--  TabbedContainer.java
new revision: 1.16; previous revision: 1.15
done