mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 16:55:38 +02:00
Bug 286922 - DND of a folder onto a file will cause exception
This commit is contained in:
parent
9c73a9327a
commit
b82a765a3f
1 changed files with 12 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue