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/DeleteResourceAction.java
IProject project = (IProject) resourceToDelete;
                project.delete(deleteContent, force, monitor);
            } else {
                
                resourceToDelete.delete(IResource.KEEP_HISTORY, monitor);
            }
        } catch (CoreException exception) {
            if (resourceToDelete.getType() == IResource.FILE) {
                IStatus[] children = exception.getStatus().getChildren();
                if (children.length == 1
                        && children[0].getCode() == IResourceStatus.OUT_OF_SYNC_LOCAL) {
                    if (forceOutOfSyncDelete) {
                        resourceToDelete.delete(IResource.KEEP_HISTORY
                                | IResource.FORCE, monitor);
                    } else {
                        int result = queryDeleteOutOfSync(resourceToDelete);
                        if (result == IDialogConstants.YES_ID) {
                            resourceToDelete.delete(IResource.KEEP_HISTORY
                                    | IResource.FORCE, monitor);
                        } else if (result == IDialogConstants.YES_TO_ALL_ID) {
                            forceOutOfSyncDelete = true;
                            resourceToDelete.delete(IResource.KEEP_HISTORY
                                    | IResource.FORCE, monitor);
                        } else if (result == IDialogConstants.CANCEL_ID) {
                            throw new OperationCanceledException();
                        }
                    }
                } else {
                    throw exception;
                }