简体   繁体   English

Netbeans向导,方法storeSettings运行两次

[英]Netbeans Wizard, method storeSettings run twice

I develop plugin for Netbeans IDE and I use Wizard with 1 step. 我为Netbeans IDE开发了插件,并且只用了1步就使用了向导。 (Just finish button on the first panel no other panels). (仅在第一个面板上的完成按钮上没有其他面板)。

When I run I saw that the method storeSetting is called twice. 运行时,我看到方法storeSetting被调用了两次。 How do I prevent running this method two times? 如何防止两次运行此方法?

Solwed, here is code which will execute just one time: 解决了,这是只执行一次的代码:

@Override
public void storeSettings(WizardDescriptor wiz) {

    if (wiz.getProperty("isSaved") == null) {
        // here operations to store data from wizzard


        // now we set property to inform WizardDescriptor is finish 
        wiz.putProperty("isSaved", true);

    }

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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