Search code examples
javaeclipsercp

callbacks of "org.eclipse.jface.wizard.WizardPage"


I have a WizardPage is displayed by org.eclipse.jface.wizard.Wizard through [Next] and [Back] buttons. I would like some operations will be always executed once this WizardPage is displayed and disappeared. I check all the methods defined in WizardPage but I do not find anything like "OnEnter()" or "OnLeave()". Does WizardPage provide this mechanism? If not, does that imply I have to implement this mechanism in org.eclipse.jface.wizard.Wizard? If so, what might be a good entry point to implement this? Thank you.


Solution

  • Use the WizardPage setVisible method to do something when the page is made visible or invisible:

    @Override
    public void setVisible(boolean visible)
    {
      super.setVisible(visible);   // You should always call the super method
    
      // TODO your code
    }