void () { 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 = new CommonContentEntriesEditor(myModule.getName(), moduleConfigurationState, true, myRootTypes) { @Override protected List<ContentEntry> addContentEntries(VirtualFile[] files) { List<ContentEntry> entries = super.addContentEntries(files); addContentEntryPanels(entries.toArray(new ContentEntry[0])); return entries; } }; JComponent component = ReadAction.compute(() -> myEditor.createComponent()); myTopPanel.add(component, BorderLayout.CENTER); }