Summary: | [Wizards] Wizard API: confusion over notifying of pages being entered, left | ||
---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Kevin McGuire <Kevin_McGuire> |
Component: | UI | Assignee: | Karice McIntyre <Karice_McIntyre> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | enhancement | ||
Priority: | P3 | CC: | bradleyjames, craig, curtispd, dcorbin, michael.acker, n.a.edgar, pascal, schtoo, zvonov |
Version: | 2.0 | Keywords: | api, contributed, investigate |
Target Milestone: | 3.3 M3 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: | |||
Attachments: |
Description
Kevin McGuire
2002-05-16 12:54:32 EDT
Should clarify / enhance API for 2.0, time permitting. *** Bug 16803 has been marked as a duplicate of this bug. *** So many people are requesting this (take a look at the newsgroup)...we should really provide an API for this. This will need to happen for a time when we can add API - post 2.1. I have been working around this problem for a while. I'd also like to request a programatic way to push the next/back buttons - there are times when the default button() won't get called, such as: focus is in a text field (not multi-line), enter key is hit....I want to press next(), but I can't seem to do this in a realistic way. Not for 3.0. Created attachment 24492 [details]
Adds Page Changing Events
This patch adds a new IPageChangingListener and associated events/provider
classes. The code was modeled after the page changed events mechanism added in
3.1.
The intention of this addition is to allow pages to perform intensive
processing between page navigation, and specifically allow pages to prevent
page navigation is this processing fails. For example, I have a wizard where a
user types in database connection parameters. Connecting to a database server
is a relatively time intensive tasks (at some customer sites, over WANs and
such it can take as much as 20 seconds), therefore I cannot try the connection
and perform the validation as the user types. Instead I need to wait until the
user clicks Next, validate the connection, then allow the navigation to the
next page, or if the connection failed, stay on the same page.
*** This bug has been marked as a duplicate of 20319 *** Sorry meant to dupe the other way around *** Bug 20319 has been marked as a duplicate of this bug. *** Thanks for the patch Chris. I prefer the idea of the listener myself (like you have in your patch) but my question was how you expect wizards to register themselves? Right now they only have access through the IWizardContainer. Are you suggesting calling getWizardContainer and then checking instanceof IPageChangeListener? If we went with the other option of adding API to WizardPage this check would require us to see if the currentPage was a WizardPage (or some other interface) before we applied it. My feeling is that we should go with the event listening idea and implement a method getPageChangingProvider() in WizardPage that can this casting and checking for you. This is a nice idea that is long overdue - I am upping priority. Let we know what you think and we can proceed. Tod thanks for looking into this. I have the same concern. I would definitely agree that adding getPageChangingProvider() to WizardPage is the way to go. I hesitated doing that originally because it wasn't done for the page changed provider. I was/am wondering if I missed anything. Perhaps the use case for the page changed provider is different, or perhaps there is some other method to get the provider that I'm missing. Or maybe not, and we should add getPageChangedProvider() to WizardPage as well. *** Bug 46385 has been marked as a duplicate of this bug. *** *** Bug 77426 has been marked as a duplicate of this bug. *** We also need control over the pages List themselves, Wizards should have the ability to add/remove pages dynamically based on questions being asked of the users. Currently, we can only Add pages, we cannot remove them/replace them. Craig, the wizard framework was not designed to dynamically add and remove pages in the manner you mentioned, so retroactivally adding this function will likely be an intensive effort and difficult to get right without breaking existing function. Your request should be logged as a separate bug (an enhancement request) with keyword 'helpwanted'. Created attachment 51264 [details]
updated patch for 3.3; apply patch to org.eclipse.jface
Here is an updated patch of Chris' original patch submission. I want to look at it a bit more and see if JUnit tests can be created for it before releasing.
Created attachment 51375 [details]
apply patch to org.eclipse.jface
Here is the patch I propose we use. I renamed the provider/listener/event classes to use the word 'transition' instead of 'changing', since I think it will be easily confused with the page changed listener/provider/event classes. Also, I removed the Finish event type since validation can be done in Wizard#performFinish().
released to HEAD for build > 20061004 Created attachment 53025 [details] simple new wizard to demo page transition listener/provider/event *File > New > Other > Bug 16179 Sample > Page transition listener test. *Enter a non-number to see the page transition listener fail on Next case, enter a number and click Next to advance to last page. *Enter a non-number then click Back to see the page transition fail on Back case *Enter a non-number on last page and click Finish to see the page transition listener fail on finish case. *Enter a number then click Finish for success - a project called Test# will be created. verified in I20061031-0656. It would be great to get some feedback from clients by the end of January (2007) on this. See bug 168888 for changes made to the original patch. |