void () { if (myModule == null) return; myModifiableModel = ReadAction.compute(() -> ModuleRootManager.getInstance(myModule).getModifiableModel()); final ModuleConfigurationStateImpl moduleConfigurationState = new ModuleConfigurationStateImpl(myModule.getProject(), new DefaultModulesProvider(myModule.getProject())) { @Override public ModifiableRootModel getModifiableRootModel() { return myModifiableModel; } @Override public ModuleRootModel getCurrentRootModel() { return myModifiableModel; } }; myEditor = createEditor(myModule, moduleConfigurationState); JComponent component = ReadAction.compute(() -> myEditor.createComponent()); myTopPanel.add(component, BorderLayout.CENTER); }