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/CloseResourceAction.java
runInBackground(rule);
    }
    /**
     * Causes all dirty editors associated to the resource(s) to be saved, if so
     * specified by the user, and closed.
     */
    boolean saveDirtyEditors() {
        
        List projects = getSelectedResources();
        if (projects == null || projects.isEmpty())
            
            return false;
        
        
        final List dirtyEditors = getDirtyEditors(projects);
        
        final List saveEditors = getEditorsToSave(dirtyEditors);
        if (saveEditors == null)
            
            return false;
        
        BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
            public void run() {
                Iterator iter = dirtyEditors.iterator();
                while (iter.hasNext()) {
                    IEditorPart editor = (IEditorPart) iter.next();
                    IWorkbenchPage page = editor.getEditorSite().getPage();
                    if (saveEditors.contains(editor)) {