United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6379813 : TransferHandler should allow the developer to choose the drop action

Details
Type:
Enhancement
Submit Date:
2006-02-01
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2006-03-01
Component:
client-libs
OS:
generic
Sub-Component:
javax.swing
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Relates:

Sub Tasks

Description
In canImport() and importData(), the developer can query the drop action on the TransferInfo. However, they need to also be able to query the source actions and pick a different one.

                                    

Comments
EVALUATION

This support has been added as follows:

TransferHandler.TransferInfo, which previously only provided information on the transfer, has been renamed to TransferHandler.TransferSupport and has been given behavior and more methods. New informational methods are:

getSourceDropActions() - returns the actions supported by the source of the transfer
getUserDropAction() - returns the action chosen by the user with their gesture

The developer can query these actions in canImport() and choose an action different from the user action by calling setDropAction() on the TransferSupport.

When a drop occurs, the final chosen action can be queried with the getDropAction() method.

As part of this fix, and additional change has been made to TransferHandler. To save the developer from having to override another method, the method shouldIndicate() has been removed from TransferHandler and moved into TransferSupport, with the name setShowDropLocation, to be called from canImport().
                                     
2006-02-09
EVALUATION

Agreed. I filed this.
                                     
2006-02-01



Hardware and Software, Engineered to Work Together