Bug 35029 - Change requestFocus to requestFocusToWindow (was: Focus code review & JDK 1.4 compliance checking)
Change requestFocus to requestFocusToWindow (was: Focus code review & JDK 1.4...
Status: NEW
Product: platform
Classification: Unclassified
Component: -- Other --
3.x
All All
: P3 (vote)
: 6.x
Assigned To: issues@platform
issues@platform
: FOCUS, UMBRELLA
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-07-21 18:44 UTC by Jesse Glick
Modified: 2009-01-06 14:14 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2003-07-21 18:44:28 UTC
We should review all focus-related code in the
platform and collect information on how it is
being used. Everything should be updated to use
the JDK 1.4 focus manager natively. Should avoid
overriding methods to assign focus somewhere else,
etc., instead using higher-level methods which
declare which components can hold focus. Goals
should be better usage of 1.4 focus features,
simpler code, clear and publically documented
guidelines for new code, fewer bugs, better
portability to different window managers,
platforms, and L&Fs.
Comment 1 Peter Zavadsky 2003-07-24 08:03:20 UTC
According to this I'd like to point out that problematic (I believe
wrong) is TopComponent.requestFocus() implementation (javadoc too)..
and I think it should be replaced by another method (e.g. activate)...
and requestFocus() to be left as it is (without adding another aspects
to it).
 I prepared it that way on the branch winsys_29836, but it is an
incompatible change.

Also there needs to be revised whether the TopComponent itself should
be not focusable (as it is now) which doesn't seem to be a problem
however.
Comment 2 Marian Mirilovic 2003-11-26 12:55:56 UTC
Because Window System v1 will not be supported from now by our team, all old
winsys issues (now "core/window system v1" issues) are going to be closed as
WONTFIX. 

Changes in API which emerged both from UI spec 
and problems with adjusting to the older API are described in the document
http://core.netbeans.org/windowsystem/changes.html.
 It shows also recommends how the client code should be adjusted to the new
window system.

If you think this issue apply also to the new winsys then change the
subcomponent (to "core/window system") and REOPEN it.
Comment 3 Jesse Glick 2003-11-26 15:38:24 UTC
Definitely applies to new window system equally. Don't you guys look
at the summaries of the bugs you are closing WONTFIX?
Comment 4 Peter Zavadsky 2003-11-26 16:42:02 UTC
New window system doesn't listen on focus events like it was in old
one. It also don't force (unless the infamous
TopComponent.requestFocus) any screwing of those methods. So I'd say
it is already jdk1.4 compliant.

Therefore I would leave this issue in old winsys.
However this issue spans more than just core/windows module.
Comment 5 Jesse Glick 2003-11-26 17:49:04 UTC
Fair enough; marking as a general issue to encompass reviews,
documentation, fixes in whatever components need them, etc.
Comment 6 _ tboudreau 2003-11-26 21:53:54 UTC
I'd go so far as to suggest doing a scan of all our sources for calls
to requestFocus and requestDefaultFocus, delete almost all of them and
see what breaks.  With the exception of table cell editors and such, a
proper focus transfer policy should make such code completely unnecessary.
Comment 7 Jan Chalupa 2004-11-01 16:50:45 UTC
Re-assigning Tim's issues to Dafe.
Comment 8 David Simonek 2005-05-05 16:21:44 UTC
Hmm, probably still makes sense. Any specific error scenarios left we are trying
to fix by this or is this just for fun? :-))
Comment 9 Stanislav Aubrecht 2008-10-16 10:09:54 UTC
i found almost 600 usages of requestFocus() in netbeans sources which could be safely replaced with safer
requestFocusInWindow()


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo