Bug 68608 [Dialogs] Resource deletion could be run in the background
If I delete a resource in Eclipse and the deletion is blocked by another job, I get a blocked dialog. I then have to wait until the blocking job finishes. It would be nice if I could have the deletion run in the background and occur when it can. In essence, this is what happens in window except that windows uses a non-modal dialog instead of a "Run in Background" button.
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/DeleteResourceAction.java
*/
    private int queryDeleteOutOfSync(IResource resource) {
        final MessageDialog dialog = new MessageDialog(
                shell,
                IDEWorkbenchMessages
                        .getString("DeleteResourceAction.messageTitle"), 		
                null,
                IDEWorkbenchMessages
                        .format(
                                "DeleteResourceAction.outOfSyncQuestion", new Object[] { 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;
    }
}