Constructor
Assign ID to be able to access the page from other pages or from the Wizard. Initialize the page with setPageComplete(false).
public FlatRatePage() {
super("flatRate"); // this is the ID assignment
setTitle("New Flat Rate");
setDescription("Build a new flat rate");
this.setPageComplete(false);
}
Through the Wizard, the page can then be referenced as follows:
public IWizardPage getNextPage() {
if (this.flatRateButton.getSelection()) {
return this.getWizard().getPage("flatRate"); // from the constructor shown above
}
if (this.weightBreakButton.getSelection()) {
return this.getWizard().getPage("weightBreak1");
}
}
Default Focus
To assign focus when the WizardPage becomes visible, override the setVisible method (inherited from org.eclipse.jface.dialogs.DialogPage):
@Override
public void setVisible(boolean visible) {
super.setVisible(visible);
if(visible){
this.weightBreakEditorComposite.forceFocus();
}
}