简体   繁体   中英

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.

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
}

You can override the method setVisible( ... this is defined in the interface IDialogPage that is implemented in the WizardPage

Example:

@Override
    public void setVisible(boolean visible) {

        if (visible) {
            // the code when your page is getting displayed
        } else {
            // the code when your page is getting hide
        }
        super.setVisible(visible);

    };

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM