Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAnton Leherbauer2009-08-20 09:37:35 +0000
committerAnton Leherbauer2009-08-20 09:37:35 +0000
commite2e88cfedbe510bf7c9c356267425b6d77083b24 (patch)
treeb0f955f1eac8387da1891bf2e88608f9429c142f /core
parentb85570c48ce016ce6d3ee942e7614dfe5ba889dd (diff)
downloadorg.eclipse.cdt-e2e88cfedbe510bf7c9c356267425b6d77083b24.tar.gz
org.eclipse.cdt-e2e88cfedbe510bf7c9c356267425b6d77083b24.tar.xz
org.eclipse.cdt-e2e88cfedbe510bf7c9c356267425b6d77083b24.zip
Bug 286922 - DND of a folder onto a file will cause exception
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorDropAdapterAssistant.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorDropAdapterAssistant.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorDropAdapterAssistant.java
index dfcf096d363..4d590c33d42 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorDropAdapterAssistant.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/navigator/CNavigatorDropAdapterAssistant.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 Wind River Systems, Inc. and others.
+ * Copyright (c) 2006, 2009 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -84,7 +84,7 @@ public class CNavigatorDropAdapterAssistant extends CommonDropAdapterAssistant {
if (target instanceof ICContainer ||
target instanceof ICProject ||
target instanceof IContainer ||
- (event.detail == DND.DROP_COPY && (
+ (dropAdapter.getCurrentOperation() == DND.DROP_COPY && (
target instanceof IFile ||
target instanceof ITranslationUnit))) {
@@ -246,6 +246,11 @@ public class CNavigatorDropAdapterAssistant extends CommonDropAdapterAssistant {
return Status.CANCEL_STATUS;
if (target instanceof ISourceReference) {
+ for (ICElement cElement : cElements) {
+ if (cElement.getElementType() <= ICElement.C_UNIT) {
+ return Status.CANCEL_STATUS;
+ }
+ }
return Status.OK_STATUS;
}
@@ -269,6 +274,11 @@ public class CNavigatorDropAdapterAssistant extends CommonDropAdapterAssistant {
return Status.CANCEL_STATUS;
}
if (target instanceof ISourceReference) {
+ for (ICElement cElement : cElements) {
+ if (cElement.getElementType() <= ICElement.C_UNIT) {
+ return Status.CANCEL_STATUS;
+ }
+ }
return Status.OK_STATUS;
}

Back to the top