Search in sources :

Example 1 with ModuleStructureConfigurable

use of com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable in project intellij-community by JetBrains.

the class ProjectStructureValidator method showDialogAndAddLibraryToDependencies.

public static void showDialogAndAddLibraryToDependencies(final Library library, final Project project, boolean allowEmptySelection) {
    for (ProjectStructureValidator validator : EP_NAME.getExtensions()) {
        if (validator.addLibraryToDependencies(library, project, allowEmptySelection)) {
            return;
        }
    }
    final ModuleStructureConfigurable moduleStructureConfigurable = ModuleStructureConfigurable.getInstance(project);
    final List<Module> modules = LibraryEditingUtil.getSuitableModules(moduleStructureConfigurable, ((LibraryEx) library).getKind(), library);
    if (modules.isEmpty())
        return;
    final ChooseModulesDialog dlg = new ChooseModulesDialog(moduleStructureConfigurable.getProject(), modules, ProjectBundle.message("choose.modules.dialog.title"), ProjectBundle.message("choose.modules.dialog.description", library.getName()));
    if (dlg.showAndGet()) {
        final List<Module> chosenModules = dlg.getChosenElements();
        for (Module module : chosenModules) {
            moduleStructureConfigurable.addLibraryOrderEntry(module, library);
        }
    }
}
Also used : ModuleStructureConfigurable(com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable) ChooseModulesDialog(com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog) Module(com.intellij.openapi.module.Module)

Example 2 with ModuleStructureConfigurable

use of com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable in project intellij-plugins by JetBrains.

the class FlexBCConfigurator method createConfigurableNode.

private void createConfigurableNode(ModifiableFlexBuildConfiguration bc, Module module, Runnable treeNodeNameUpdater) {
    CompositeConfigurable wrapped = createBcConfigurable(module, bc, treeNodeNameUpdater);
    myConfigurablesMap.put(bc, wrapped);
    final MasterDetailsComponent.MyNode node = new BuildConfigurationNode(wrapped);
    final ModuleStructureConfigurable moduleStructureConfigurable = ModuleStructureConfigurable.getInstance(module.getProject());
    moduleStructureConfigurable.addNode(node, moduleStructureConfigurable.findModuleNode(module));
    Place place = new Place().putPath(ProjectStructureConfigurable.CATEGORY, moduleStructureConfigurable).putPath(MasterDetailsComponent.TREE_OBJECT, bc);
    ProjectStructureConfigurable.getInstance(module.getProject()).navigateTo(place, true);
}
Also used : ModuleStructureConfigurable(com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable) CompositeConfigurable(com.intellij.lang.javascript.flex.projectStructure.ui.CompositeConfigurable) MasterDetailsComponent(com.intellij.openapi.ui.MasterDetailsComponent) Place(com.intellij.ui.navigation.Place)

Example 3 with ModuleStructureConfigurable

use of com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable in project intellij-plugins by JetBrains.

the class FlexBCConfigurator method reset.

public void reset(Project project) {
    myModifiableModelInitializer.ensureInitialized(project);
    ModuleStructureConfigurable moduleStructureConfigurable = ModuleStructureConfigurable.getInstance(project);
    for (final CompositeConfigurable configurable : myConfigurablesMap.values()) {
        moduleStructureConfigurable.ensureInitialized(configurable);
    }
}
Also used : ModuleStructureConfigurable(com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable) CompositeConfigurable(com.intellij.lang.javascript.flex.projectStructure.ui.CompositeConfigurable)

Example 4 with ModuleStructureConfigurable

use of com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable in project intellij-community by JetBrains.

the class CreateNewLibraryAction method createActionOrGroup.

public static AnAction[] createActionOrGroup(@NotNull String text, @NotNull BaseLibrariesConfigurable librariesConfigurable, @NotNull final Project project) {
    final LibraryType<?>[] extensions = LibraryType.EP_NAME.getExtensions();
    List<LibraryType<?>> suitableTypes = new ArrayList<>();
    if (librariesConfigurable instanceof ProjectLibrariesConfigurable || !project.isDefault()) {
        final ModuleStructureConfigurable configurable = ModuleStructureConfigurable.getInstance(project);
        for (LibraryType<?> extension : extensions) {
            if (!LibraryEditingUtil.getSuitableModules(configurable, extension.getKind(), null).isEmpty()) {
                suitableTypes.add(extension);
            }
        }
    } else {
        Collections.addAll(suitableTypes, extensions);
    }
    if (suitableTypes.isEmpty()) {
        return new AnAction[] { new CreateNewLibraryAction(text, PlatformIcons.LIBRARY_ICON, null, librariesConfigurable, project) };
    }
    List<AnAction> actions = new ArrayList<>();
    actions.add(new CreateNewLibraryAction(IdeBundle.message("create.default.library.type.action.name"), PlatformIcons.LIBRARY_ICON, null, librariesConfigurable, project));
    for (LibraryType<?> type : suitableTypes) {
        final String actionName = type.getCreateActionName();
        if (actionName != null) {
            actions.add(new CreateNewLibraryAction(actionName, type.getIcon(null), type, librariesConfigurable, project));
        }
    }
    return actions.toArray(new AnAction[actions.size()]);
}
Also used : ModuleStructureConfigurable(com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable) LibraryType(com.intellij.openapi.roots.libraries.LibraryType) ArrayList(java.util.ArrayList) ProjectLibrariesConfigurable(com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectLibrariesConfigurable) AnAction(com.intellij.openapi.actionSystem.AnAction)

Example 5 with ModuleStructureConfigurable

use of com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable in project intellij-community by JetBrains.

the class ProjectJdkConfigurable method clearCaches.

private void clearCaches() {
    final ModuleStructureConfigurable rootConfigurable = ModuleStructureConfigurable.getInstance(myProject);
    Module[] modules = rootConfigurable.getModules();
    for (Module module : modules) {
        final StructureConfigurableContext context = rootConfigurable.getContext();
        context.getDaemonAnalyzer().queueUpdate(new ModuleProjectStructureElement(context, module));
    }
}
Also used : ModuleStructureConfigurable(com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable) ModuleProjectStructureElement(com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ModuleProjectStructureElement) StructureConfigurableContext(com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext) Module(com.intellij.openapi.module.Module)

Aggregations

ModuleStructureConfigurable (com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable)7 CompositeConfigurable (com.intellij.lang.javascript.flex.projectStructure.ui.CompositeConfigurable)3 Module (com.intellij.openapi.module.Module)2 FacetEditorImpl (com.intellij.facet.impl.ui.FacetEditorImpl)1 AnAction (com.intellij.openapi.actionSystem.AnAction)1 Project (com.intellij.openapi.project.Project)1 LibraryType (com.intellij.openapi.roots.libraries.LibraryType)1 ChooseModulesDialog (com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog)1 ProjectLibrariesConfigurable (com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectLibrariesConfigurable)1 StructureConfigurableContext (com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext)1 ModuleProjectStructureElement (com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ModuleProjectStructureElement)1 MasterDetailsComponent (com.intellij.openapi.ui.MasterDetailsComponent)1 Place (com.intellij.ui.navigation.Place)1 ArrayList (java.util.ArrayList)1