如何重写JFace向导的next按钮事件?

时间:2021-11-02 23:07:52

I have a wizard comprising of three pages page1 , page2, page3.

我有一个由3页page1, page2, page3组成的向导。

I'm in page 2 and I press "Next" button , where some validations for duplicate creation needs to verified based on inputs form page1 and a selection inputs entered in page2.

我在第2页,我按下“Next”按钮,在这里,一些验证重复创建的验证需要根据输入表单page1和在page2中输入的选择输入进行验证。

Which method should i override inorder to include my validations and pop up a message box(complaining about duplicacy) on click of Next button of page2.

我应该重写该方法,以包含我的验证,并弹出一个消息框(抱怨重复),单击page2的Next按钮。

1 个解决方案

#1


5  

You can override WizardPage.getNextPage() and return null to prevent the next button from operating.

您可以重载向导页面。getnextpage()并返回null以防止下一个按钮操作。

It is more usual to validate the user input as it happens and call WizardPage.setPageComplete(false) to disable the next button completely until the page is valid.

更常用的方法是验证用户输入的情况,并调用向导。setpagecomplete (false),使下一个按钮完全禁用,直到页面有效为止。

Call WizardPage.setErrorMessage(msg) or WizardPage.setMessage(msg, type) to display messages.

调用WizardPage.setErrorMessage(味精)或WizardPage。显示消息的setMessage(msg, type)。

#1


5  

You can override WizardPage.getNextPage() and return null to prevent the next button from operating.

您可以重载向导页面。getnextpage()并返回null以防止下一个按钮操作。

It is more usual to validate the user input as it happens and call WizardPage.setPageComplete(false) to disable the next button completely until the page is valid.

更常用的方法是验证用户输入的情况,并调用向导。setpagecomplete (false),使下一个按钮完全禁用,直到页面有效为止。

Call WizardPage.setErrorMessage(msg) or WizardPage.setMessage(msg, type) to display messages.

调用WizardPage.setErrorMessage(味精)或WizardPage。显示消息的setMessage(msg, type)。