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 180053

Summary: Centralized method for select-all-on-focus behavior in text fields
Product: platform Reporter: _ tboudreau <tboudreau>
Component: -- Other --Assignee: issues@platform <issues>
Status: NEW ---    
Severity: normal CC: ivan
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: ENHANCEMENT Exception Reporter:

Description _ tboudreau 2010-01-31 17:12:48 UTC
Almost all text fields in NetBeans UI contain code which adds a focus listener to text fields and calls selectAll() on focus gained.  But everyone has to write their own code to do it.  I am already doing this with a utility method for all of the Java Card modules.

There are also requests to disable this behavior for unix-style middle-button paste users.  A central location for managing this behavior would make that possible.

I'm proposing adding a method Utilities.configureSelectAllOnFocus(JTextComponent).

Hopefully, if Jackpot is up to it (or if not, with lots of grepping) all or most such instances can be found in a pass over the codebase, and quite likely a number of inner FocusListener classes can be eliminated.
Comment 1 Stanislav Aubrecht 2010-02-01 02:33:51 UTC
sounds like a new feature to me...