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
* 	of the Yes, Yes to All, No, Cancel options has been selected by 
     * 	the user.
     */
    private int queryDeleteOutOfSync(IResource resource) {
        final MessageDialog dialog = new MessageDialog(
                shell,
                IDEWorkbenchMessages.DeleteResourceAction_messageTitle,
                null,
                NLS.bind(IDEWorkbenchMessages.DeleteResourceAction_outOfSyncQuestion, resource.getName()),
                MessageDialog.QUESTION, new String[] {
                        IDialogConstants.YES_LABEL,
                        IDialogConstants.YES_TO_ALL_LABEL,
                        IDialogConstants.NO_LABEL,
                        IDialogConstants.CANCEL_LABEL }, 0);
        shell.getDisplay().syncExec(new Runnable() {
            public void run() {
                dialog.open();
            }
        });
        int result = dialog.getReturnCode();
        if (result == 0)
            return IDialogConstants.YES_ID;
        if (result == 1)
            return IDialogConstants.YES_TO_ALL_ID;
        if (result == 2)
            return IDialogConstants.NO_ID;
        return IDialogConstants.CANCEL_ID;
    }
}