United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4248542 DropTargetListener can't access the transferable in dragOver and dragEnter
JDK-4248542 : DropTargetListener can't access the transferable in dragOver and dragEnter

Details
Type:
Enhancement
Submit Date:
1999-06-22
Status:
Resolved
Updated Date:
2003-08-08
Project Name:
JDK
Resolved Date:
2003-08-08
Component:
client-libs
OS:
windows_nt,generic
Sub-Component:
java.awt
CPU:
x86,generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.2.1,1.2.2
Fixed Versions:
5.0 (tiger)

Related Reports
Relates:
Relates:

Sub Tasks

Description

Name: vi73552			Date: 06/22/99


It is impossible for a DropTargetListener to examine the transferable for accepting or rejecting the drag operation if it necessary to do more controls than just looking to DataFlavor.
The DropTargetDragEvent doesn't have access to the transferable and in DropTargetContext method getTransferable() has protected access.
----------------------------------

Hello,

my problem is to implements a drag and drop in a tree in witch I don't want
to allow the drop of a parent in a child.

To check if drop is possible I used the dragOver() method of the
DropTargetListener, like this I can see if the drag is over a container
node or over a leaf. But even if I allow the drop it can occure that I
raised an error dialog because the drop was in fact not allowed
(just like the windows file explorer).

I think that this point is not specific to my problem and in dnd operation
it could be useful in certain condition to check the data transfered just
like in copy-paste it is possible to get the clipboard content.

regards.
Eric.


(Review ID: 84647) 
======================================================================

Name: krT82822			Date: 11/07/99


Classic VM (build JDK-1.2.2-W, native threads, symcjit)

For DropTargetDragEvent events, it would be useful to access the
transferable data somehow.  Currently, for this event access to the data is
protected via
 
       DropTargetContext context = event.getDropTargetContext();
       
       BUT
            context.getTransferable() is protected.

The reason I would like this feature is that I am working on drawing graphics.
As the mouse moves, my application would like to draw a "label" indicating
what is being dragged.  This is done by drawing a rectangle with text.  The
text comes from the transferable data.

In my source window, I can get to the tranferable string which I use to
form my "label", but in my target window, I do not see how this information
is accessible.  I may have many different target windows, so it is not
practical to make one big class in order to have access to this data.
(Review ID: 97221)
======================================================================

Name: krT82822			Date: 12/11/99


The feature request applies to all versions!

Access to the Transferable Data in a Drag Drop operation can only be obtained
from a Drop event.  It is IMPORTANT that the developer can access the
Transferable Data BEFORE a drop operation occurs.

It is ESSENTIAL that the Transferable can be obtained from the dragEnter
(DropTargetDragEvent dtde) method so that the Java application can compute the
drop area and provide the user with VISUAL feedback of the pasted area.

The transferable data is needed because the application may have to PARSE the
data to calculate the drop bounds.  The Visual feedback is ESSENTIAL to
indicate (for example) populated table cells which will be overwritten when the
drop is performed.
(Review ID: 98838)
======================================================================

                                    

Comments
EVALUATION

We will consider this update for Merlin. It seems reasonsable but requires further investigation.
roger.brinkley@Eng 2000-02-23
                                     
2000-02-23
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger

FIXED IN:
tiger

INTEGRATED IN:
tiger
tiger-b15


                                     
2004-06-14



Hardware and Software, Engineered to Work Together