Search in sources :

Example 1 with ModuleConfigurationEditor

use of com.intellij.openapi.module.ModuleConfigurationEditor in project go-lang-idea-plugin by go-lang-plugin-org.

the class GoModuleEditorsProvider method createEditors.

@Override
public ModuleConfigurationEditor[] createEditors(@NotNull ModuleConfigurationState state) {
    ModifiableRootModel rootModel = state.getRootModel();
    Module module = rootModel.getModule();
    if (!(ModuleType.get(module) instanceof GoModuleType)) {
        return ModuleConfigurationEditor.EMPTY;
    }
    String moduleName = module.getName();
    List<ModuleConfigurationEditor> editors = ContainerUtil.newArrayList();
    editors.add(new ContentEntriesEditor(moduleName, state));
    editors.add(new OutputEditorEx(state));
    editors.add(new ClasspathEditor(state));
    return editors.toArray(new ModuleConfigurationEditor[editors.size()]);
}
Also used : ModifiableRootModel(com.intellij.openapi.roots.ModifiableRootModel) ModuleConfigurationEditor(com.intellij.openapi.module.ModuleConfigurationEditor) Module(com.intellij.openapi.module.Module) GoModuleType(com.goide.GoModuleType)

Example 2 with ModuleConfigurationEditor

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

the class PythonModuleConfigurationEditorProvider method createEditors.

public ModuleConfigurationEditor[] createEditors(final ModuleConfigurationState state) {
    final Module module = state.getRootModel().getModule();
    if (!(ModuleType.get(module) instanceof PythonModuleType))
        return ModuleConfigurationEditor.EMPTY;
    final DefaultModuleConfigurationEditorFactory editorFactory = DefaultModuleConfigurationEditorFactory.getInstance();
    final List<ModuleConfigurationEditor> editors = new ArrayList<>();
    editors.add(new PyContentEntriesEditor(module, state, false, JavaSourceRootType.SOURCE));
    editors.add(editorFactory.createClasspathEditor(state));
    return editors.toArray(new ModuleConfigurationEditor[editors.size()]);
}
Also used : DefaultModuleConfigurationEditorFactory(com.intellij.openapi.roots.ui.configuration.DefaultModuleConfigurationEditorFactory) ModuleConfigurationEditor(com.intellij.openapi.module.ModuleConfigurationEditor) ArrayList(java.util.ArrayList) Module(com.intellij.openapi.module.Module)

Example 3 with ModuleConfigurationEditor

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

the class ModuleEditor method createEditors.

private void createEditors(@Nullable Module module) {
    if (module == null)
        return;
    ModuleConfigurationState state = createModuleConfigurationState();
    for (ModuleConfigurationEditorProvider provider : collectProviders(module)) {
        ModuleConfigurationEditor[] editors = provider.createEditors(state);
        if (editors.length > 0 && provider instanceof ModuleConfigurationEditorProviderEx && ((ModuleConfigurationEditorProviderEx) provider).isCompleteEditorSet()) {
            myEditors.clear();
            ContainerUtil.addAll(myEditors, editors);
            break;
        } else {
            ContainerUtil.addAll(myEditors, editors);
        }
    }
    for (Configurable moduleConfigurable : ServiceKt.getComponents(module, Configurable.class)) {
        reportDeprecatedModuleEditor(moduleConfigurable.getClass());
        myEditors.add(new ModuleConfigurableWrapper(moduleConfigurable));
    }
    for (ModuleConfigurableEP extension : module.getExtensions(MODULE_CONFIGURABLES)) {
        if (extension.canCreateConfigurable()) {
            Configurable configurable = extension.createConfigurable();
            if (configurable != null) {
                reportDeprecatedModuleEditor(configurable.getClass());
                myEditors.add(new ModuleConfigurableWrapper(configurable));
            }
        }
    }
}
Also used : ModuleConfigurationEditor(com.intellij.openapi.module.ModuleConfigurationEditor) Configurable(com.intellij.openapi.options.Configurable) ModuleConfigurableEP(com.intellij.openapi.options.ModuleConfigurableEP)

Example 4 with ModuleConfigurationEditor

use of com.intellij.openapi.module.ModuleConfigurationEditor in project android by JetBrains.

the class AndroidModuleEditor method apply.

public void apply() throws ConfigurationException {
    String appId = getApplicationId(myProject);
    for (ModuleConfigurationEditor editor : myEditors) {
        if (appId != null) {
            UsageTracker.getInstance().log(AndroidStudioEvent.newBuilder().setCategory(AndroidStudioEvent.EventCategory.PROJECT_STRUCTURE_DIALOG).setKind(AndroidStudioEvent.EventKind.PROJECT_STRUCTURE_DIALOG_TOP_TAB_SAVE).setProjectId(AndroidStudioUsageTracker.anonymizeUtf8(appId)));
        }
        editor.saveData();
        editor.apply();
    }
}
Also used : ModuleConfigurationEditor(com.intellij.openapi.module.ModuleConfigurationEditor)

Example 5 with ModuleConfigurationEditor

use of com.intellij.openapi.module.ModuleConfigurationEditor in project android by JetBrains.

the class AndroidModuleEditor method dispose.

@Override
public void dispose() {
    for (final ModuleConfigurationEditor myEditor : myEditors) {
        myEditor.disposeUIResources();
    }
    myEditors.clear();
    myGenericSettingsPanel = null;
}
Also used : ModuleConfigurationEditor(com.intellij.openapi.module.ModuleConfigurationEditor)

Aggregations

ModuleConfigurationEditor (com.intellij.openapi.module.ModuleConfigurationEditor)13 Module (com.intellij.openapi.module.Module)5 ArrayList (java.util.ArrayList)3 ModifiableRootModel (com.intellij.openapi.roots.ModifiableRootModel)2 DefaultModuleConfigurationEditorFactory (com.intellij.openapi.roots.ui.configuration.DefaultModuleConfigurationEditorFactory)2 GoModuleType (com.goide.GoModuleType)1 JavaModuleType (com.intellij.openapi.module.JavaModuleType)1 Configurable (com.intellij.openapi.options.Configurable)1 ModuleConfigurableEP (com.intellij.openapi.options.ModuleConfigurableEP)1 TabbedPaneWrapper (com.intellij.ui.TabbedPaneWrapper)1 JBTabbedPane (com.intellij.ui.components.JBTabbedPane)1 ChangeEvent (javax.swing.event.ChangeEvent)1 AndroidFacet (org.jetbrains.android.facet.AndroidFacet)1 NotNull (org.jetbrains.annotations.NotNull)1 PluginModuleBuildConfEditor (org.jetbrains.idea.devkit.build.PluginModuleBuildConfEditor)1