IResource[] selectedResources = getSelectedResources();
if (selectedResources.length == 0) {
message = WorkbenchNavigatorMessages.DropAdapter_dropOperationErrorOther;
} else {
CopyFilesAndFoldersOperation operation;
if (aDropOperation == DND.DROP_COPY) {
if (DEBUG) {
System.out.println("ResourceDropAdapterAssistant.validateDrop validating COPY."); //$NON-NLS-1$
}
operation = new CopyFilesAndFoldersOperation(getShell());
} else {
if (DEBUG) {
System.out.println("ResourceDropAdapterAssistant.validateDrop validating MOVE."); //$NON-NLS-1$
}
operation = new MoveFilesAndFoldersOperation(getShell());
}
message = operation.validateDestination(destination, selectedResources);
}
} // file import?
else if (FileTransfer.getInstance().isSupportedType(transferType)) {
String[] sourceNames = (String[]) FileTransfer.getInstance().nativeToJava(transferType);
if (sourceNames == null) {
// source names will be null on Linux. Use empty names to do
// destination validation.
// Fixes bug 29778
sourceNames = new String[0];
}
CopyFilesAndFoldersOperation copyOperation = new CopyFilesAndFoldersOperation(getShell());
message = copyOperation.validateImportDestination(destination, sourceNames);
}
if (message != null) {
return WorkbenchNavigatorPlugin.createErrorStatus(0, message, null);
}
return Status.OK_STATUS;