United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6184866 BasicTreeUI should use factory method to construct drop target listener
JDK-6184866 : BasicTreeUI should use factory method to construct drop target listener

Details
Type:
Enhancement
Submit Date:
2004-10-26
Status:
Closed
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2005-05-20
Component:
client-libs
OS:
windows_2000
Sub-Component:
javax.swing
CPU:
x86
Priority:
P4
Resolution:
Duplicate
Affected Versions:
5.0
Fixed Versions:

Related Reports
Duplicate:
Relates:

Sub Tasks

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
                                     
2005-05-20



Hardware and Software, Engineered to Work Together