Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4938575

DropTargetListener cannot get dragged Transferable

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.2
    • client-libs
    • x86
    • windows_xp



      Name: rmT116609 Date: 10/15/2003


      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)
      ======================================================================

            dassunw Das Das (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: