Validating input in a WizardPage
Does anyone have a simple example of validating the input for a text field
in a org.eclipse.jface.wizard.WizardPage? (To prevent the user from going to the next page)
The example I am following is
http://www.eclipse.org/articles/article.php?file=Article-JFaceWizards/index.html
Is this typically how it is done in Jazz?
in a org.eclipse.jface.wizard.WizardPage? (To prevent the user from going to the next page)
The example I am following is
http://www.eclipse.org/articles/article.php?file=Article-JFaceWizards/index.html
Is this typically how it is done in Jazz?
2 answers
Does anyone have a simple example of validating the input for a text
field
in a org.eclipse.jface.wizard.WizardPage? (To prevent the user from
going to the next page)
You may want to take a look at WizardPage#canFlipToNextPage():
/**
* The <code>WizardPage</code> implementation of this
<code>IWizardPage</code>
* method returns <code>true</code> if this page is complete
(<code>isPageComplete</code>)
* and there is a next page to flip to. Subclasses may override
(extend or reimplement).
*
* @see #getNextPage
* @see #isPageComplete()
*/
public boolean canFlipToNextPage() {
return isPageComplete() && getNextPage() != null;
}
--
Regards,
Patrick
Jazz Work Item Team
Thank you!
I did 2 things.
In the example, the author has the WizardPage implement Listener.
I usehandleEvent() to display Messages to the user
viasetMessage() and setErrorMessage() . Also in handleEvent() , I call
I am usingcanFlipToNextPage() to validate the page in my 1st 2 wizard pages. In my last page, canFlipToNextPage() should be false because there is not a next page.
I did 2 things.
In the example, the author has the WizardPage implement Listener.
I use
via
getWizard().getContainer().updateButtons()
I am using