Netbeans平台中的通信beetwen模块

时间:2018-06-26 07:49:37

标签: java netbeans netbeans-platform netbeans-plugins

我想在我的应用程序启动时创建一些对象。我创建了模块并创建了安装程序:

public class Installer extends ModuleInstall {

    private SmbpConfigurationSelectForm selectForm = new SmbpConfigurationSelectForm();
    final MySomeConfiguration configuration = new MySomeConfiguration();


    @Override
    public void restored() {
        // build and work with configuration
    }
}

这是在启动应用程序之前发生的。我希望将此对象作为单例对象,并且可以在其他模块中使用。

我创建了另一个模块,该模块具有从TopComponent开始的某些类:

public final class MainWindow extends TopComponent {
@Override
    public void componentOpened() {
        //I want get my MySomeConfiguration here
        initSession(null);
    }
}

我想在加载此组件之前获取MySomeConfiguration。我该怎么办?

0 个答案:

没有答案