Project: Eclipse_Platform_UI
Bug 16179 [Wizards] Wizard API: confusion over notifying of pages being entered, left
Reported: 2002-05-16 12:54:32 | Status: verified fixed

Its not clear what a wizard writer is supposed to do to for notification of page transition. This is important for complex wizards which have to compute expensive information based on a previous page, or where it must compute something expensive for availability of the next page. The goal is optimal delaying of computing information and of setting page control state (e.g. setting input on a tree). This may just be a javadoc/doc issue, or may be an API improvement issue. I would understand if we were hesitant to change any API here since there are already a lot of wizards written against the current API. At present the writer can do one of two things: 1. supplement DialogPage.setVisible(boolean) - Although the javadoc says you can supplement it, it feels like a hack to do so (I assumed it was wrong until I saw the javadoc and spoke with Randy). Perhaps its just because it looks more like a setter than a notification of visibility. I have a bit of concern that the framework may wish to distinguish notification from setting of a field state. It would be clearer to have methods like: entering() leaving() which are more clearly there solely for notification. 2. The other trick is to override getNextPage(). There are two problems here: - the API isn't clear that its ok to compute information for the next page by overriding this method. Its also not clear that you could dynimally compute the next page using this. The javadoc comment in the method in IWizardPage isn't clear, and the class javadoc for WizardPage doesn't list it in the section titled " * Subclasses may override these methods if required:" - this method gets called a lot (e.g. to determine if Next> should be enabled). Optimal use would involve overriding other methods which by default send it. The javadoc should at least say that if you override it to do real work, you need to override other methods as well. This is indicative of a problem in the framework though. For example, if the method was called computeNextPage(), it would be clear that senders should minimize their use and that implementors can rely on that.

Files changed in fix:
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/IPageTransitionListener.java bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/IPageTransitionProvider.java bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/PageTransitionEvent.java bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/Wizard.java bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/WizardDialog.java