/** * Connect the validation result from the given data binding context to the * given wizard page. Upon creation, the wizard page support will use the * context's validation result to determine whether the page is complete. * The page's error message will not be set at this time ensuring that the * wizard page does not show an error right away. Upon any validation result * change, {@link WizardPage#setPageComplete(boolean)} will be called * reflecting the new validation result, and the wizard page's error message * will be updated according to the current validation result. * * @param wizardPage * @param dbc * @return an instance of WizardPageSupport */ public static WizardPageSupport create(WizardPage wizardPage, DataBindingContext dbc) { return new WizardPageSupport(wizardPage, dbc); }
@Override protected void handleStatusChanged() { super.handleStatusChanged(); boolean pageComplete = true; if (currentStatusStale) { pageComplete = false; } else if (currentStatus != null) { pageComplete = !currentStatus.matches(IStatus.ERROR | IStatus.CANCEL); } ((WizardPage) getDialogPage()).setPageComplete(pageComplete); } }
WizardPage wizardPage = getContainer(WizardPage.class); if (wizardPage != null) { WizardPageSupport.create(wizardPage, bindingContext); } else { DialogPage page = getContainer(DialogPage.class);