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
/**
     * Return the cancel button if the id is a the cancel id.
     * @param id the button id
     * @return the button corresponding to the button id
     */
    protected Button getButton(int id) {
        if (id == IDialogConstants.CANCEL_ID)
            return cancelButton;
        return super.getButton(id);
    }
    /**
     * The <code>WizardDialog</code> implementation of this <code>Window</code>
     * method calls call <code>IWizard.addPages</code> to allow the current
     * wizard to add extra pages, then <code>super.createContents</code> to create
     * the controls. It then calls <code>IWizard.createPageControls</code>
     * to allow the wizard to pre-create their page controls prior to opening,
     * so that the wizard opens to the correct size. And finally it
     * shows the first page.
     */
    protected Control createContents(Composite parent) {
        
        
        
        wizard.addPages();
        Control contents = super.createContents(parent);
        
        createPageControls();
        
        showStartingPage();
        return contents;