JAL-1522 patch - try to pick best text dataflavor
authorJim Procter <jprocter@issues.jalview.org>
Wed, 25 May 2016 17:51:05 +0000 (18:51 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 25 May 2016 17:51:05 +0000 (18:51 +0100)
src/jalview/gui/AlignFrame.java

index 7e7bdd3..0419b6f 100644 (file)
@@ -5048,6 +5048,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         // This is used by Unix drag system
         evt.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
         String data = (String) t.getTransferData(uriListFlavor);
+        if (data == null)
+        {
+          // try 'best' dataflavor
+          data = (String) t.getTransferData(DataFlavor
+                  .selectBestTextFlavor(t.getTransferDataFlavors()));
+        }
         files = new java.util.ArrayList(1);
         for (java.util.StringTokenizer st = new java.util.StringTokenizer(
                 data, "\r\n"); st.hasMoreTokens();)