I have created a JFace wizard PCWizard
extending Wizard
and have four pages PCPageOne
, PCPageTwo
, PCPageThree
and PCPageFour
extending WizardPage
.
I have also captured the data collected in another class, if u want me to override the WizardDialog
class and do the action how do I do it . I'm new to java and SWT a more elaborate explanation would be fine.Thanx in advance
To disable the back button do the following in the last page:
@Override
public IWizardPage getPreviousPage() {
// prevent going back
return null;
}
Also clearing the input in pages might be done in a IPageChangedListener
:
WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
dialog.addPageChangedListener(new IPageChangedListener() {
public void pageChanged(PageChangedEvent event) {
// this is just a suggestion..
IClearablePage page = (IClearablePage)event.getSelectedPage();
page.clear();
}
});
Where IClearablePage
is your own interface with a clear()
, and all your pages implement IClearablePage
.
EDIT: override setVisible
as greg stated in his answer is probably more convenient.
Override the WizardPage
setVisible
method to clear fields when the page becomes active:
@Override
public void setVisible(final boolean visible)
{
super.setVisible(visible);
if (visible) {
// TODO clear your fields
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.