Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Weninger2015-09-30 07:58:21 -0400
committerUwe Stieber2015-09-30 07:59:03 -0400
commitf21bd57bc334d7f97c6017a6afec419b05b2980f (patch)
tree3ed27ffddfd0cd2bb24d83bd884eadb919de3dc9
parentfb8b3e77f2aa51ad84ad5f48b4af6b699e725f9d (diff)
downloadorg.eclipse.tcf-f21bd57bc334d7f97c6017a6afec419b05b2980f.tar.gz
org.eclipse.tcf-f21bd57bc334d7f97c6017a6afec419b05b2980f.tar.xz
org.eclipse.tcf-f21bd57bc334d7f97c6017a6afec419b05b2980f.zip
Target Explorer: Fix DND to file system explorer not working on Linux hosts
Signed-off-by: Max Weninger <max.weninger@windriver.com>
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/dnd/CommonDnD.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/dnd/CommonDnD.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/dnd/CommonDnD.java
index b40971462..b237a4b9e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/dnd/CommonDnD.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/dnd/CommonDnD.java
@@ -192,16 +192,20 @@ public class CommonDnD implements IConfirmCallback {
public boolean validateFilesDrop(Object target, int operation, TransferData transferType) {
FileTransfer transfer = FileTransfer.getInstance();
String[] elements = (String[]) transfer.nativeToJava(transferType);
- if (elements.length > 0) {
- boolean moving = (operation & DND.DROP_MOVE) != 0;
- boolean copying = (operation & DND.DROP_COPY) != 0;
- IFSTreeNode hovered = (IFSTreeNode) target;
- if (hovered.isFile() && copying) {
- hovered = hovered.getParent();
- }
- return hovered.isDirectory() && hovered.isWritable() && (moving || copying);
+ if (elements == null) {
+ // see ResourceDropAdapterAssistant:validateDrop
+ // source names will be null on Linux. Use empty names to do
+ // destination validation.
+ // Fixes bug 29778
+ elements = new String[0];
}
- return false;
+ boolean moving = (operation & DND.DROP_MOVE) != 0;
+ boolean copying = (operation & DND.DROP_COPY) != 0;
+ IFSTreeNode hovered = (IFSTreeNode) target;
+ if (hovered.isFile() && copying) {
+ hovered = hovered.getParent();
+ }
+ return hovered.isDirectory() && hovered.isWritable() && (moving || copying);
}
/**

Back to the top