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 17794 - [core] No initial focus on open of "New" dialog
Summary: [core] No initial focus on open of "New" dialog
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: Peter Zavadsky
URL:
Keywords: A11Y
: 17770 (view as bug list)
Depends on:
Blocks: 19103
  Show dependency tree
 
Reported: 2001-11-17 04:39 UTC by _ jrichard
Modified: 2008-12-23 13:33 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Diff of proposed patch (3.31 KB, patch)
2002-01-17 13:22 UTC, Peter Zavadsky
Details | Diff
Proposed patch (put in lib/patches dir to try out) (15.70 KB, application/zip)
2002-01-17 13:23 UTC, Peter Zavadsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ jrichard 2001-11-17 04:39:28 UTC
When I bring up the "New" wizard (Ctrl-N) focus is set to the
tree (where it should be).  However, when I try to tab
to the next button, I can hit tab a few times, but then all
the wizard does if beep at me.  I haven't figured out how
to tab out of the tree, if it is possible at all.

Using the mouse does work, so if a11y isn't a huge deal, feel
free to lower the priority.
Comment 1 Marian Mirilovic 2001-11-17 10:43:15 UTC
You can use these keys to traverse focus, not only Tab ( try to hit
Ctrl-Tab)


       traverse forward to the next Component: 
       TextAreas: CTRL-TAB on KEY_PRESSED 
       All others: TAB on KEY_PRESSED and CTRL-TAB on KEY_PRESSED 
       traverse backward to the previous Component: 
       TextAreas: CTRL-SHIFT-TAB on KEY_PRESSED 
       All others: SHIFT-TAB on KEY_PRESSED and CTRL-SHIFT-TAB on
KEY_PRESSED 


You can hit Ctrl+Tab In New Wizard to travers focus out of JTree.
Comment 2 _ jrichard 2001-11-17 18:00:35 UTC
Ah, you're right.  My problem was I didn't see any visual indication
of the focus since focus was going to the text areas or 
the scrollbars (probably a JDK bug).  (Sorry, I usually use
a toolkit other than swing.)


But I lied about one thing, which I'll leave in this reopened
bug.  After a ctrl-N, there is no initial focus on the 
dialog (JDK 1.4 beta 3 on linux).  I have to hit tab to get
focus set.  (It could be that this is a JDK bug as well, but
I think this was just fixed for the Keyboard Shortcuts dialog
(at least I sent in a patch for it, and someone seems to have
fixed it more generically -- but I don't see the fix yet).
Comment 3 _ jrichard 2001-11-17 18:05:48 UTC
The other bug is 
http://openide.netbeans.org/issues/show_bug.cgi?id=16932
If this uses the same code, you may want to close as a dup.
Comment 4 Marian Mirilovic 2001-11-18 11:01:23 UTC
Ok, for A11Y issues we are using A11Y keyword.
Comment 5 _ jrichard 2001-11-18 14:54:42 UTC
When creating a new class using ctrl-N, the second page
seems even worse.  There are two problems in the class page:

1) if the Template in the first page is already correct I
 can do 
  -- ctrl-N (New Wizard) and then 
  -- <return> (next page via default button)
 at this point, no amount of ctrl-shift, ctrl-shift-tab,
 tab, or shift-tab will get me keyboard focus.  If I click
 with the mouse though, I get keyboard focus and can navigate
 with tabs, etc...

2) if I use tab to navigate to a button on the first 
 wizard page, the second page has the "Back" button 
 with initial focus.  Initial focus should probably be
 on the class name for the class wizard, etc...

Comment 6 _ jrichard 2001-11-22 02:12:29 UTC
BTW: according to http://openide.netbeans.org/issues/show_bug.cgi?id=16932
this is a JDK 1.4 compatiblity issue, maybe it should
go onto the back burner until JDK 1.4 is the primary
platform?
Comment 7 David Strupl 2001-11-22 10:57:59 UTC
*** Issue 17770 has been marked as a duplicate of this issue. ***
Comment 8 Jan Chalupa 2001-11-27 11:50:21 UTC
Target milestone -> 3.3.1.
Comment 9 Jan Chalupa 2001-11-27 11:53:48 UTC
Target milestone -> 3.3.1.
Comment 10 Marian Mirilovic 2001-11-28 14:48:10 UTC
Jano, seems like first focused component is :

org.openide.loaders.ClassNamePanel[New Object Name,
instead 
TextField

and this is the root of problems in New from template wizard.

Reproducible on Solaris(CDE) and Windows(2000)
Comment 11 jrojcek 2001-12-17 12:51:36 UTC
Focus system was changed heavily in JDK 1.4. Focus request is granted
only if component is displayable (peer is created?) and visible. That
is why requestDefault focus doesn't work in NbPresenter. Will
investigate later whether it is possible to get it work on both JDKs
(1.3.1 and 1.4).
Comment 12 jrojcek 2002-01-08 12:50:39 UTC
This is general initial focus problem in NbPresenter.
Comment 13 Jan Chalupa 2002-01-11 14:03:11 UTC
Target milestone -> 3.4
Comment 14 Jan Chalupa 2002-01-11 14:07:12 UTC
Target milestone -> 3.4
Comment 15 Jan Chalupa 2002-01-11 14:08:22 UTC
Target milestone -> 3.4
Comment 16 Jan Chalupa 2002-01-11 14:11:16 UTC
Target milestone -> 3.4
Comment 17 Peter Zavadsky 2002-01-16 09:32:52 UTC
Partial eval (jdk1.4):

It seemed the prob is only the desired component doesn't get
FOCUS_GAINED event, what is true in current impl of NbPresenter.

But problem is it doesn't help when we achieve the comp gets the event.
(It is possible if we put calling of requestFocusForMessage after
superShow method call.
So there is a state the component always gets FOCUS_GAINED event,
doesn't get FOCUS_LOST event, but still somtimes doesn't respond to
key strokes.
Will investigate further.
Comment 18 Peter Zavadsky 2002-01-16 09:45:46 UTC
I made a terrible mistake, using jdk1.4 build87 containing a bug, when
cursor is not at the window with focused comp, it didn't get the events.
Going to update the jdk and try out the fix once again.
Comment 19 Marian Mirilovic 2002-01-16 13:37:03 UTC
P2:
This is high priority issue, because it must be fixed for 3.3.1 and it
is very annoynig if you must hitting <Tab> after opening New from
template wizard for focusing Textfield when you must write name of new
component.
Comment 20 Peter Zavadsky 2002-01-17 13:10:45 UTC
Fixed in [main-trunk]

Fix:
core/../core/NbPresenter.java [1.54]
Comment 21 Peter Zavadsky 2002-01-17 13:22:54 UTC
Created attachment 4240 [details]
Diff of proposed patch
Comment 22 Peter Zavadsky 2002-01-17 13:23:48 UTC
Created attachment 4241 [details]
Proposed patch (put in lib/patches dir to try out)
Comment 23 Peter Zavadsky 2002-01-17 13:25:07 UTC
Please test and approve the patch for [release33].
Comment 24 Jan Zajicek 2002-01-17 16:19:44 UTC
Patch checked and tested in 3.3.1 build # 200201170331 on both jdks.
It works without problems - Verified.
Comment 25 Marian Mirilovic 2002-01-17 16:22:39 UTC
verified in [nb331_dev](20020117) on [jdk1.4](91) {[jdk1.3.1](02)
without changes} on W2K & Solaris 5.8 (CDE)
Comment 26 Jan Chalupa 2002-01-17 16:23:27 UTC
Approved by QA.
Comment 27 eadams 2002-01-17 16:54:47 UTC
Approved
Comment 28 Peter Zavadsky 2002-01-17 17:26:43 UTC
Integrated into [release33]

Fix:
core/../core/NbPresenter.java [1.52.4.2]
Comment 29 Marian Mirilovic 2002-01-18 09:45:25 UTC
verified in [nb3.3.1-rc2](200201180727)
Comment 30 _ jrichard 2002-01-25 04:28:51 UTC
I hate to say it, but I don't see this fixed with
JDK 1.4RC1 and NetBeans 3.3.1RC2 on Linux (and I believe
on Solaris 2.8 as well).

I still don't see initial focus on the New Dialog, and 
initial focus for the panels in the dialog aren't set to
the important things to change (like the name) by default.

Maybe JDK 1.4 RC1 changed things?
Comment 31 Peter Zavadsky 2002-01-25 08:43:56 UTC
John,
I tried it and it works. On New dialog (File | New...) is set initial
focus to the tree, what is right. I believe you should see the same.
Therefore closing the issue.

If you see the problem at other dialogs, please fire individual bugs
for them.
This fix just makes possible to set initial focus for the dialog, what
component actually gets the initial focus is (specified) up to the
individual implementations.

Problematic is setting initial(default) focus when switching panels in
wizard (because sometimes are rearraned buttons what causes the change
of default focus component, it should be avoided), but there is
another bug fired for it (Marian, please tell the number) with lower
priority.
Comment 32 Marian Mirilovic 2002-01-25 09:01:11 UTC
John, see issue 19540 or issue 19539.
Comment 33 Quality Engineering 2003-07-01 16:39:06 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.