Bug 123496 [IDE] Use operation validation API for IDE actions
We should use the Resources/Core operation validation API in the IDE actions for manipulating resources.
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/MoveFilesAndFoldersOperation.java
/* (non-Javadoc)
     * Overrides method in CopyFilesAndFoldersOperation
     *
     * Note this method is for internal use only. It is not API.
     *
     */
    public String validateDestination(IContainer destination,
            IResource[] sourceResources) {
        IPath destinationLocation = destination.getLocation();
        for (int i = 0; i < sourceResources.length; i++) {
            IResource sourceResource = sourceResources[i];
            
            if (sourceResource.getParent().equals(destination)) {
                return NLS.bind(IDEWorkbenchMessages.MoveFilesAndFoldersOperation_sameSourceAndDest, sourceResource.getName());
            }
            
            if (destinationLocation != null) {
                IPath sourceLocation = sourceResource.getLocation();
                IPath destinationResource = destinationLocation
                        .append(sourceResource.getName());
                if (sourceLocation != null
                        && sourceLocation.isPrefixOf(destinationResource)) {
                    return NLS.bind(IDEWorkbenchMessages.MoveFilesAndFoldersOperation_sameSourceAndDest, sourceResource.getName());
                }
            }
        }
        return super.validateDestination(destination, sourceResources);
    }
}