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/RenameResourceAction.java
if (resource.getType() == IResource.FILE
                        && newResource.getType() == IResource.FILE) {
                    IFile file = (IFile) resource;
                    IFile newFile = (IFile) newResource;
                    if (validateEdit(file, newFile, getShell())) {
                        IProgressMonitor subMonitor = new SubProgressMonitor(
                                monitor, 50);
                        newFile.setContents(file.getContents(),
                                IResource.KEEP_HISTORY, subMonitor);
                        file.delete(IResource.KEEP_HISTORY, subMonitor);
                    }
                    monitor.worked(100);
                    return;
                } 
                newResource.delete(IResource.KEEP_HISTORY,
                        new SubProgressMonitor(monitor, 50));
            } else {
                monitor.worked(100);
                return;
            }
        }
        if (resource.getType() == IResource.PROJECT) {
            IProject project = (IProject) resource;
            IProjectDescription description = project.getDescription();
            description.setName(newPath.segment(0));
            project.move(description, IResource.FORCE | IResource.SHALLOW,
                    monitor);
        } else
            resource.move(newPath, IResource.KEEP_HISTORY | IResource.SHALLOW,
                    new SubProgressMonitor(monitor, 50));