title: How to find out the drag source component in the drop target TransferHandler?
body: <p>Question is regarding <strong>Java 5</strong> and Drag n Drop.</p>
  
  <p>Is there a way to determine the drag source <strong>component</strong> in the drop target <code>TransferHandler</code>?</p>
  
  <p>I need to know this in my <code>canImport(..)</code> or <code>importData(..)</code> method in order to take different actions for transfer data of the same type or <code>DataFlavor</code>.</p>
  
  <p>The way I have achieved this currently is to hijack the DataFlavor 'Human Readable Field' and set a string action, resulting something like this:</p>
  
  <pre><code>DataFlavor localCopyFooFlavor = new DataFlavor(Foo.class, "COPY");
  DataFlavor localEditFooFlavor = new DataFlavor(Foo.class, "EDIT");
  </code></pre>
  
  <p>Then use this field to decide what action to take.
  I pretty sure this is wrong.</p>
  
  <p>Thanks.</p>