Submitted On 25-AUG-1999
bryantb
I would be interested in hearing why Sun decided to not make the Transferable
object accessible. I wish it were.
Submitted On 03-NOV-1999
rsyedna
create a sub class of DropTargetContext and use
its getTransferable() method.
Submitted On 06-APR-2000
VHJay
One way to get around this is to store the Transferable
object in a class that the DragGestureListener,
DragSourceListener, and DropTargetListener can get to. You
have to be carefull to null that value out when the drag is
complete so that there isn't confusion in subsequent
operations. You can use the DragSourceListener.dragDropEnd
method to do this.
It would be nice if this data was available through the
DropTargetDragEvent, though.
Submitted On 13-JUN-2000
ArraA
The 2 workarounds (WA) are not as desirable as the
requested change (although thanks very much for them)!
The subclass WA actually requires two extended classes,
an extension of DropTargetContext to supply the
transferable, and an extension of DropTarget to override
createDropTargetContext.
The "store transferable" requires a change to the model
so that it still works with multiple views. The model
should not have to hold onto such a temporary piece of
information relating to DnD!
Submitted On 25-JUL-2000
AX3801
It is very annoying, that a Java file list cannot be examinated about file types in dragOver.
Please consider enhancing the interface.
Submitted On 07-FEB-2001
hallad
I agree - there are definitely times when you need access to the transferable object in order to control drag under
feedback and to decide whether to accept or reject a drop. Having access to the data flavor isn't enough. Please
enhance the interface.
Submitted On 14-JAN-2002
robertE
Bad news for all of you: there is not really a workaround.
The idea of subclassing DropTargetContext is impossible because it has a constructor with
default access, so you cannot define a subclass. And you cannot define a new class in package
java.awt.dnd to access the protected method getTransferable() because the class loader will
throw a security exception. Also using reflection to access this method is not successfull because
when you call method getTransferData() on the returned transferable you end up with the
following exception: java.io.IOException: class java.awt.dnd.InvalidDnDOperationException:No drop current
caught while getting Data
The second described workaround will not work if the DragSource is not accessible which is the
case if you want to perform DnD between the windows file explorer and your java application (which is the
kind of operation that i need).
So now its your turn my friends at Sun. Give us the possibility to do our work.
Submitted On 08-AUG-2002
jrduncans
Bug Id 4378091 is a duplicate of this one. Votes from it
should be transferred here.
It is located here:
http://developer.java.sun.com/developer/bugParade/bugs/437
8091.html
Submitted On 30-AUG-2002
mitchg
Yeah this was a poor design decision at best. It also seems
that one cannot even get the DataFlavor, much less the
actual Transferable.
The only way to get around this is to have the
DragGestureListener save a reference to the Transferable
that is being used to initiate the drag with startDrag(). Not a
pretty picture.
Submitted On 21-MAR-2003
LuZhouMan
It is a very reasonable request. The feature is very useful.
Submitted On 25-JUN-2003
martinagren
I happen to notice that today it is just about exactly four
years since this bug was submitted. That's a little anniversary
right there. It seems strange to me though, that this
enhancement - which I in my naive thinking believe would
consist of three lines of code and a littly copy&paste in the
documentation -, would take more than four years to perform.
It seems clear that there is a need for this feature. I can tell
this by the number of votes in the various, identical bug
reports, of which more than one are still open, and by the
fury and desperation that can be sensed in the above posts -
as well as in this one.
By the way, what exactly does "further investigation" mean?
Is this feature that we so deeply crave something that could
damage existing code, or provide weird behaviour? I think not.
But please, if I am wrong, let me know, and my agony as to
why this is taking such a long time, may be somewhat
oppressed.
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|