* the destination of the copy or move
* @return whether the operation should proceed
* @since 3.2
*/
private boolean validateOperation(IResource[] resources, IPath destinationPath) {
IResourceChangeDescriptionFactory factory = ResourceChangeValidator.getValidator().createDeltaFactory();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
if (isMove()) {
factory.move(resource, destinationPath.append(resource.getName()));
} else {
factory.copy(resource, destinationPath.append(resource.getName()));
}
}
String title;
String message;
if (isMove()) {
title = IDEWorkbenchMessages.CopyFilesAndFoldersOperation_confirmMove;
message = IDEWorkbenchMessages.CopyFilesAndFoldersOperation_warningMove;
} else {
title = IDEWorkbenchMessages.CopyFilesAndFoldersOperation_confirmCopy;
message = IDEWorkbenchMessages.CopyFilesAndFoldersOperation_warningCopy;
}
return IDE
.promptToConfirm(messageShell, title, message, factory.getDelta(), modelProviderIds, true /* syncExec */);
}