Bug 87111 [Dialogs] Feature: add general-purpose page change notification for dialogs
New dynamic help pane attaches itself to all the dialogs that JFace provides. Some of these dialogs manage multiple pages but dynamic help has no way of registering for page change notification. Examples of dialogs that exhibit this behaviour are WizardDialog, PreferenceDialog, LaunchConfigurationDialog (in Debug), PropertiesDialog etc. Attached is the code for the following proposed enhancement: 1) A new interface 'IBaseDialogPage' that interfaces like IDialogPage and ILaunchConfigurationTab can extend 2) A class PageChangedEvent for page change notification 3) A new interface 'IPageChangeProvider' 4) A new interface 'IPageChangedListener' In the attached patch, WizardDialog and PreferenceDialog implement IPageChangeProvider and notify page changed listeners whenever current page changes. This allows dynamic help to update its content and show the relevant help for the currently selected page. Since IBaseDialogPage is now a base interface for IDialogPage, two methods (getTitle() and getControl()) are moved up from IDialogPage. This is consistent with ILaunchConfigurationTab and does not clash with any existing method.
bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/WizardDialog.java
* @return the new Cancel button
     */
    private Button createCancelButton(Composite parent) {
        
        ((GridLayout) parent.getLayout()).numColumns++;
        Button button = new Button(parent, SWT.PUSH);
        button.setText(IDialogConstants.CANCEL_LABEL);
        setButtonLayoutData(button);
        button.setFont(parent.getFont());
        button.setData(new Integer(IDialogConstants.CANCEL_ID));
        button.addSelectionListener(cancelListener);
        return button;
    }
    /**
     * 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