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
public static final String ID = PlatformUI.PLUGIN_ID
            + ".CloseResourceAction"; 
    /**
     * Creates a new action.
     *
     * @param shell the shell for any dialogs
     */
    public CloseResourceAction(Shell shell) {
        super(shell, IDEWorkbenchMessages.CloseResourceAction_text);
        setId(ID);
        setToolTipText(IDEWorkbenchMessages.CloseResourceAction_toolTip);
        PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
				IIDEHelpContextIds.CLOSE_RESOURCE_ACTION);
    }
    /**
     * Return a list of dirty editors associated with the given projects.  Return
     * editors from all perspectives.
     * 
     * @return List the dirty editors
     */
    List getDirtyEditors(List projects) {
        List dirtyEditors = new ArrayList(0);
        IWorkbenchWindow[] windows = PlatformUI.getWorkbench()
                .getWorkbenchWindows();
        for (int i = 0; i < windows.length; i++) {
            IWorkbenchPage[] pages = windows[i].getPages();
            for (int j = 0; j < pages.length; j++) {
                IWorkbenchPage page = pages[j];
                IEditorPart[] editors = page.getDirtyEditors();
                for (int k = 0; k < editors.length; k++) {