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 - Centralized method for select-all-on-focus behavior in text fields
Summary: Centralized method for select-all-on-focus behavior in text fields
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: issues@platform
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-31 17:12 UTC by _ tboudreau
Modified: 2010-02-01 02:33 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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...