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 73308 - Unexplained deprecation of TopComponent.requestFocus and .requestFocusInWindow
Summary: Unexplained deprecation of TopComponent.requestFocus and .requestFocusInWindow
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 5.x
Hardware: All All
: P4 blocker (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2006-03-06 19:45 UTC by Jesse Glick
Modified: 2009-11-02 11:03 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2006-03-06 19:45:55 UTC
These methods are deprecated yet they seem to be necessary to override. For
example, ProjectTab, and about a dozen others in nb.org sources that I can see.

It is fine to say that they should not be called from outside code, but
subclasses often need to override these calls, and you get spurious deprecation
warnings. Maybe you could introduce a new

protected void handleRequestFocus() {}

which subclasses could override if they want to send focus to an embedded
component like a TreeView. Then this method could be called from the deprecated
methods.

Note also that Javadoc says

"The default implementation does nothing, and does not call
super.requestFocusInWindow()."

which is not true - just look at the source.
Comment 1 David Simonek 2006-03-15 17:21:09 UTC
Accepted.
Comment 2 David Simonek 2007-09-24 13:13:53 UTC
Passing to Standa...
Comment 3 Stanislav Aubrecht 2007-09-25 12:19:33 UTC
i've removed the note about default implementation of these methods.
changing to enhancement as it is to late to introduce api changes in nb 6.0 anyway

/cvs/openide/windows/src/org/openide/windows/TopComponent.java,v  <--  TopComponent.java
new revision: 1.25; previous revision: 1.24
Comment 4 Jesse Glick 2007-09-26 17:50:28 UTC
It is a bug if you need to override a deprecated method to implement a recommended code pattern. Not high priority, but
not an RFE either.
Comment 5 Stanislav Aubrecht 2008-11-21 09:05:18 UTC
fixing this issue needs some api redesign which imho is not worth the effort
Comment 6 Jesse Glick 2008-11-21 18:09:34 UTC
If overriding these methods is in fact correct (at least for now), you can at least remove the deprecation marking so
people can focus on real deprecations.
Comment 7 Quality Engineering 2009-11-02 11:03:56 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX