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
* @param parent the parent composite to contain the button bar
     * @return the button bar control
     */
    protected Control createButtonBar(Composite parent) {
        Composite composite = (Composite) super.createButtonBar(parent);
        ((GridLayout) composite.getLayout()).makeColumnsEqualWidth = false;
        return composite;
    }
    /* (non-Javadoc)
     * Method declared on Dialog.
     */
    protected void createButtonsForButtonBar(Composite parent) {
        if (wizard.isHelpAvailable()) {
            helpButton = createButton(parent, IDialogConstants.HELP_ID,
                    IDialogConstants.HELP_LABEL, false);
        }
        if (wizard.needsPreviousAndNextButtons())
            createPreviousAndNextButtons(parent);
        finishButton = createButton(parent, IDialogConstants.FINISH_ID,
                IDialogConstants.FINISH_LABEL, true);
        cancelButton = createCancelButton(parent);
    }
    /**
     * Creates the Cancel button for this wizard dialog.
     * Creates a standard (<code>SWT.PUSH</code>) button and registers for its
     * selection events. Note that the number of columns in the button bar composite
     * is incremented. The Cancel button is created specially to give it a 
     * removeable listener.
     *
     * @param parent the parent button bar