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
if (inputFile != null) {
                
                
                if (!dirtyInputs.contains(inputFile)) {
                    dirtyInputs.add(inputFile);
                    saveEditors.add(editor);
                }
            }
        }
        AdaptableList input = new AdaptableList(saveEditors);
        ListSelectionDialog dlg = new ListSelectionDialog(getShell(), input,
                new WorkbenchContentProvider(),
                new WorkbenchPartLabelProvider(), IDEWorkbenchMessages.EditorManager_saveResourcesMessage);
        dlg.setInitialSelections(saveEditors.toArray(new Object[saveEditors
                .size()]));
        dlg.setTitle(IDEWorkbenchMessages.EditorManager_saveResourcesTitle);
        int result = dlg.open();
        if (result == IDialogConstants.CANCEL_ID)
            return null;
        return Arrays.asList(dlg.getResult());
    }
    /* (non-Javadoc)
     * Method declared on WorkspaceAction.
     */
    protected String getOperationMessage() {
        return IDEWorkbenchMessages.CloseResourceAction_operationMessage;
    }
    /* (non-Javadoc)
     * Method declared on WorkspaceAction.
     */