Bug 93674 [Dialogs] ProgressMonitorDialog not cancellable when fork is set to false
Overview Description: Invoking the ProgressMonitorDialog::run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) method with the fork parameter set to false, the user can't cancel the running dialog -even if the cancelable parameter is set to true. Steps to Reproduce: Simply launch a ProgressMonitorDialog and invoke its run method with fork parameter == false and cancelable parameter == true Actual Results: The Cancel button is not responsive to user clicks and the IProgressMonitor::isCanceled() will always regardless. Expected Results: When the suer clicks the Cancel button on the dialog, calling IProgressMonitor::isCanceled() should return true so that the executing IRunnableWithProgress can have a chance to honour the user's request and exit.
bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/WizardDialog.java
lockedUI = true;
            ModalContext.run(runnable, fork, getProgressMonitor(), getShell()
                    .getDisplay());
            lockedUI = false;
        } finally {
            activeRunningOperations--;
            
            if (state != null)
                stopped(state);
        }
    }
    /**
     * Saves the enabled/disabled state of the given control in the
     * given map, which must be modifiable.
     *
     * @param w the control, or <code>null</code> if none
     * @param h the map (key type: <code>String</code>, element type:
     *   <code>Boolean</code>)
     * @param key the key
     * @param enabled <code>true</code> to enable the control, 
     *   and <code>false</code> to disable it
     * @see #restoreEnableState(Control, Map, String)
     */
    private void saveEnableStateAndSet(Control w, Map h, String key,
            boolean enabled) {
        if (w != null) {
            h.put(key, new Boolean(w.getEnabled()));
            w.setEnabled(enabled);
        }
    }