From c7a518ae93b2aee5e4c488ff37dbcd40f4a3b620 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Fri, 9 Dec 2011 08:25:36 +0000 Subject: [PATCH] * more debug output just in case --- .../filebot/ui/transfer/TransferablePolicy.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/source/net/sourceforge/filebot/ui/transfer/TransferablePolicy.java b/source/net/sourceforge/filebot/ui/transfer/TransferablePolicy.java index b55820fc..d99d83fa 100644 --- a/source/net/sourceforge/filebot/ui/transfer/TransferablePolicy.java +++ b/source/net/sourceforge/filebot/ui/transfer/TransferablePolicy.java @@ -15,10 +15,10 @@ public abstract class TransferablePolicy { public abstract boolean accept(Transferable tr) throws Exception; - + public abstract void handleTransferable(Transferable tr, TransferAction action) throws Exception; - + public boolean canImport(TransferSupport support) { if (support.isDrop()) { support.setShowDropLocation(false); @@ -33,11 +33,12 @@ public abstract class TransferablePolicy { // just assume that the transferable will be accepted, accept will be called in importData again anyway return true; } catch (Exception e) { + Logger.getLogger(getClass().getName()).log(Level.WARNING, e.toString(), e); return false; } } - + public boolean importData(TransferSupport support) { Transferable transferable = support.getTransferable(); @@ -54,7 +55,7 @@ public abstract class TransferablePolicy { return false; } - + protected TransferAction getTransferAction(TransferSupport support) { if (support.isDrop()) { return TransferAction.fromDnDConstant(support.getDropAction()); @@ -64,7 +65,7 @@ public abstract class TransferablePolicy { return TransferAction.PUT; } - + public static enum TransferAction { PUT(TransferHandler.MOVE), ADD(TransferHandler.COPY), @@ -72,17 +73,17 @@ public abstract class TransferablePolicy { private final int dndConstant; - + private TransferAction(int dndConstant) { this.dndConstant = dndConstant; } - + public int getDnDConstant() { return dndConstant; } - + public static TransferAction fromDnDConstant(int dndConstant) { for (TransferAction action : values()) { if (dndConstant == action.dndConstant)