Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4938575
Votes 0
Synopsis DropTargetListener cannot get dragged Transferable
Category java:dragndrop
Reported Against 1.4.2
Release Fixed
State 11-Closed, duplicate of 4378091, request for enhancement
Priority: 4-Low
Related Bugs 4248542 , 4378091
Submit Date 16-OCT-2003
Description




A DESCRIPTION OF THE REQUEST :
No way for a Java application/applet to get the Transferable as a TargetListener, but it is almost possible with the DropTargetContext:
 DropTargetDragEvent.getDropTargetContext().getTransferable(), but the access is protected, whereas the 'symmetrical' DragSourceContext.getTransferable() is public...incredible!

JUSTIFICATION :
The problem is when the program needs data from the Transferable in order to 'know' whether the drop would be possible or not, and/or, in order to present data from the Transferable before the drop (the user would have a preview of what the drop would do).

Anyway, why putting such limitations as the DropTargetContext knows the TransferableProxy (which knows the Transferable istelf)?

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
DropTargetContext.getTransferable() declared as public
ACTUAL -
DropTargetContext.getTransferable() is declared protected and there is no 'clean' way to bypass that as DropTargetContext has no public constructor (it is not possible to construct an extended context which would add the behavior)

---------- BEGIN SOURCE ----------
Change in the java.awt.dnd.DropTargetContext:

public Transferable getTransferable() { ... }
---------- END SOURCE ----------
(Incident Review ID: 185307) 
======================================================================
Work Around
N/A
Evaluation




The same functionality is requested in 4248542 and 4378091.
The respective public API was integrated in Tiger.

  xxxxx@xxxxx   2003-10-17

======================================================================
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang