JDK-6184866 : BasicTreeUI should use factory method to construct drop target listener
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2004-10-26
  • Updated: 2010-04-02
  • Resolved: 2005-05-20
Related Reports
Duplicate :  
Relates :  
Description
A DESCRIPTION OF THE REQUEST :
The BasicTreeUI installListeners() method directly instantiates a TreeDropTargetListener to respond to DropTarget events.  The rest of the installListeners() method use factory methods to add a level of indirection in creating these listener classes.


JUSTIFICATION :
A factory method should be used for TreeDropTargetListener too to allow custom L&Fs to provide custom TreeDropTargetListener.

The pattern of using factory methods should be part of the L&F coding standards.


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I'd like to see a createDropTargetListener() method in BasicTreeUI with installListeners() calling it.

CUSTOMER SUBMITTED WORKAROUND :
The workaround is to copy the BasicTreeUI installListeners() method to BasicTreeUI subclass and change the creation of TreeDropTargetListener to desired class.
###@###.### 10/26/04 22:30 GMT

Comments
EVALUATION The fixes for 4468566 and 4942851 will re-architect Swing's drop support to make it much more usable by the developer. In particular, they will provide location sensitive dropping, and much better indication of the drop location. As a result of this re-architecture, BasicTreeUI will no longer install a drop target listener, as all the details of indicating drop locations will be handled within TransferHandler. Closing as a duplicate. ###@###.### 2005-05-20 15:19:25 GMT
20-05-2005