* fix subtitle drop target on Mac (didn't accept drops before)

This commit is contained in:
Reinhard Pointner 2010-11-26 14:12:04 +00:00
parent 051c34c98d
commit 3974551821
2 changed files with 6 additions and 4 deletions

View File

@ -184,12 +184,14 @@ abstract class SubtitleDropTarget extends JButton {
@Override
public void dragEnter(DropTargetDragEvent dtde) {
DropAction dropAction = DropAction.Cancel;
DropAction dropAction = DropAction.Download;
try {
dropAction = getDropAction(getFilesFromTransferable(dtde.getTransferable()));
} catch (Exception e) {
// ignore
// just accept the drag if we can't access the transferable,
// because on some implementations we can't access transferable data before we accept the drag,
// but accepting or rejecting the drag depends on the files dragged
}
// update visual representation
@ -197,7 +199,7 @@ abstract class SubtitleDropTarget extends JButton {
// accept or reject
if (dropAction != DropAction.Cancel) {
dtde.acceptDrag(DnDConstants.ACTION_COPY);
dtde.acceptDrag(DnDConstants.ACTION_REFERENCE);
} else {
dtde.rejectDrag();
}

View File

@ -134,6 +134,6 @@ public class FileTransferable implements Transferable {
}
// cannot get files from transferable
throw new UnsupportedFlavorException(DataFlavor.javaFileListFlavor);
throw new UnsupportedFlavorException(null);
}
}