Search in sources :

Example 1 with ModuleConfigurationStateImpl

use of com.intellij.openapi.module.impl.ModuleConfigurationStateImpl in project intellij-community by JetBrains.

the class PlatformContentEntriesConfigurable method createEditor.

private void createEditor() {
    myModifiableModel = ApplicationManager.getApplication().runReadAction(new Computable<ModifiableRootModel>() {

        @Override
        public ModifiableRootModel compute() {
            return ModuleRootManager.getInstance(myModule).getModifiableModel();
        }
    });
    final ModuleConfigurationStateImpl moduleConfigurationState = new ModuleConfigurationStateImpl(myModule.getProject(), new DefaultModulesProvider(myModule.getProject())) {

        @Override
        public ModifiableRootModel getRootModel() {
            return myModifiableModel;
        }

        @Override
        public FacetsProvider getFacetsProvider() {
            return DefaultFacetsProvider.INSTANCE;
        }
    };
    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[entries.size()]));
            return entries;
        }
    };
    JComponent component = ApplicationManager.getApplication().runReadAction(new Computable<JComponent>() {

        @Override
        public JComponent compute() {
            return myEditor.createComponent();
        }
    });
    myTopPanel.add(component, BorderLayout.CENTER);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) List(java.util.List) ModuleConfigurationStateImpl(com.intellij.openapi.module.impl.ModuleConfigurationStateImpl) Computable(com.intellij.openapi.util.Computable)

Example 2 with ModuleConfigurationStateImpl

use of com.intellij.openapi.module.impl.ModuleConfigurationStateImpl in project intellij-community by JetBrains.

the class PyContentEntriesModuleConfigurable method createEditor.

private void createEditor() {
    if (myModule == null)
        return;
    myModifiableModel = ApplicationManager.getApplication().runReadAction(new Computable<ModifiableRootModel>() {

        @Override
        public ModifiableRootModel compute() {
            return ModuleRootManager.getInstance(myModule).getModifiableModel();
        }
    });
    final ModuleConfigurationStateImpl moduleConfigurationState = new ModuleConfigurationStateImpl(myModule.getProject(), new DefaultModulesProvider(myModule.getProject())) {

        @Override
        public ModifiableRootModel getRootModel() {
            return myModifiableModel;
        }

        @Override
        public FacetsProvider getFacetsProvider() {
            return DefaultFacetsProvider.INSTANCE;
        }
    };
    myEditor = createEditor(myModule, moduleConfigurationState);
    JComponent component = ApplicationManager.getApplication().runReadAction(new Computable<JComponent>() {

        @Override
        public JComponent compute() {
            return myEditor.createComponent();
        }
    });
    myTopPanel.add(component, BorderLayout.CENTER);
}
Also used : DefaultModulesProvider(com.intellij.openapi.roots.ui.configuration.DefaultModulesProvider) ModuleConfigurationStateImpl(com.intellij.openapi.module.impl.ModuleConfigurationStateImpl) Computable(com.intellij.openapi.util.Computable)

Aggregations

ModuleConfigurationStateImpl (com.intellij.openapi.module.impl.ModuleConfigurationStateImpl)2 Computable (com.intellij.openapi.util.Computable)2 DefaultModulesProvider (com.intellij.openapi.roots.ui.configuration.DefaultModulesProvider)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 List (java.util.List)1