Search in sources :

Example 6 with FacetEditorImpl

use of com.intellij.facet.impl.ui.FacetEditorImpl in project intellij-community by JetBrains.

the class ModulesConfigurator method showFacetSettingsDialog.

public static boolean showFacetSettingsDialog(@NotNull final Facet facet, @Nullable final String tabNameToSelect) {
    final Project project = facet.getModule().getProject();
    final ProjectStructureConfigurable config = ProjectStructureConfigurable.getInstance(project);
    return ShowSettingsUtil.getInstance().editConfigurable(project, config, () -> {
        final ModuleStructureConfigurable modulesConfig = config.getModulesConfig();
        config.select(facet, true).doWhenDone(() -> {
            if (tabNameToSelect != null) {
                FacetEditorImpl facetEditor = modulesConfig.getFacetConfigurator().getOrCreateEditor(facet);
                facetEditor.setSelectedTabName(tabNameToSelect);
            }
        });
    });
}
Also used : Project(com.intellij.openapi.project.Project) ModuleStructureConfigurable(com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable) FacetEditorImpl(com.intellij.facet.impl.ui.FacetEditorImpl)

Aggregations

FacetEditorImpl (com.intellij.facet.impl.ui.FacetEditorImpl)6 FacetTreeModel (com.intellij.facet.impl.ui.FacetTreeModel)1 FacetEditorContext (com.intellij.facet.ui.FacetEditorContext)1 Module (com.intellij.openapi.module.Module)1 Project (com.intellij.openapi.project.Project)1 ModuleStructureConfigurable (com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable)1 NotNull (org.jetbrains.annotations.NotNull)1