Search in sources :

Example 6 with FrameworkSupportInModuleProvider

use of com.intellij.framework.addSupport.FrameworkSupportInModuleProvider in project intellij-community by JetBrains.

the class FrameworkSupportProviderTestCase method selectFramework.

protected FrameworkSupportInModuleConfigurable selectFramework(@NotNull String id) {
    final FrameworkSupportInModuleProvider provider = FrameworkSupportUtil.findProvider(id, FrameworkSupportUtil.getAllProviders());
    if (provider != null) {
        return selectFramework(provider);
    }
    fail("Framework provider with id='" + id + "' not found");
    return null;
}
Also used : FrameworkSupportInModuleProvider(com.intellij.framework.addSupport.FrameworkSupportInModuleProvider)

Example 7 with FrameworkSupportInModuleProvider

use of com.intellij.framework.addSupport.FrameworkSupportInModuleProvider in project intellij-community by JetBrains.

the class FrameworkSupportUtil method getProviders.

private static List<FrameworkSupportInModuleProvider> getProviders(@NotNull ModuleType moduleType, @Nullable Module module, @NotNull FacetsProvider facetsProvider) {
    List<FrameworkSupportInModuleProvider> allProviders = getAllProviders();
    ArrayList<FrameworkSupportInModuleProvider> result = new ArrayList<>();
    for (FrameworkSupportInModuleProvider provider : allProviders) {
        if (provider.isEnabledForModuleType(moduleType) && (module == null || provider.canAddSupport(module, facetsProvider))) {
            result.add(provider);
        }
    }
    return result;
}
Also used : FrameworkSupportInModuleProvider(com.intellij.framework.addSupport.FrameworkSupportInModuleProvider)

Example 8 with FrameworkSupportInModuleProvider

use of com.intellij.framework.addSupport.FrameworkSupportInModuleProvider in project intellij-community by JetBrains.

the class AddSupportForFrameworksPanel method createNodes.

private Collection<FrameworkSupportNodeBase> createNodes(List<FrameworkSupportInModuleProvider> providers, Set<String> associated, final Set<String> preselected) {
    Map<String, FrameworkSupportNode> nodes = new HashMap<>();
    Map<FrameworkGroup<?>, FrameworkGroupNode> groups = new HashMap<>();
    List<FrameworkSupportNodeBase> roots = new ArrayList<>();
    Map<String, FrameworkSupportNodeBase> associatedNodes = new LinkedHashMap<>();
    for (FrameworkSupportInModuleProvider provider : providers) {
        createNode(provider, nodes, groups, roots, providers, associated, associatedNodes);
    }
    FrameworkSupportNodeBase.sortByName(roots, (o1, o2) -> Comparing.compare(preselected.contains(o2.getId()), preselected.contains(o1.getId())));
    myRoots = roots;
    return associatedNodes.values();
}
Also used : FrameworkSupportInModuleProvider(com.intellij.framework.addSupport.FrameworkSupportInModuleProvider) FrameworkGroup(com.intellij.framework.FrameworkGroup)

Example 9 with FrameworkSupportInModuleProvider

use of com.intellij.framework.addSupport.FrameworkSupportInModuleProvider in project intellij-community by JetBrains.

the class FrameworkSupportProviderTestCase method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    final Project project = getProject();
    myFrameworkSupportModel = new FrameworkSupportModelImpl(project, "", LibrariesContainerFactory.createContainer(project));
    myNodes = new LinkedHashMap<>();
    final List<FrameworkSupportInModuleProvider> providers = FrameworkSupportUtil.getAllProviders();
    Collections.sort(providers, FrameworkSupportUtil.getFrameworkSupportProvidersComparator(providers));
    for (FrameworkSupportInModuleProvider provider : providers) {
        final FrameworkSupportNode node = new FrameworkSupportNode(provider, null, myFrameworkSupportModel, getTestRootDisposable());
        myNodes.put(provider.getFrameworkType(), node);
        myFrameworkSupportModel.registerComponent(provider, node);
    }
    myConfigurables = new HashMap<>();
}
Also used : Project(com.intellij.openapi.project.Project) FrameworkSupportNode(com.intellij.ide.util.newProjectWizard.FrameworkSupportNode) FrameworkSupportInModuleProvider(com.intellij.framework.addSupport.FrameworkSupportInModuleProvider)

Aggregations

FrameworkSupportInModuleProvider (com.intellij.framework.addSupport.FrameworkSupportInModuleProvider)9 FrameworkSupportProvider (com.intellij.ide.util.frameworkSupport.FrameworkSupportProvider)2 ProjectFacetsConfigurator (com.intellij.facet.impl.ProjectFacetsConfigurator)1 LibraryCompositionSettings (com.intellij.facet.impl.ui.libraries.LibraryCompositionSettings)1 FacetBasedFrameworkSupportProvider (com.intellij.facet.ui.FacetBasedFrameworkSupportProvider)1 FrameworkGroup (com.intellij.framework.FrameworkGroup)1 FrameworkSupportInModuleConfigurable (com.intellij.framework.addSupport.FrameworkSupportInModuleConfigurable)1 FrameworkSupportConfigurable (com.intellij.ide.util.frameworkSupport.FrameworkSupportConfigurable)1 FrameworkSupportNode (com.intellij.ide.util.newProjectWizard.FrameworkSupportNode)1 OldFrameworkSupportProviderWrapper (com.intellij.ide.util.newProjectWizard.OldFrameworkSupportProviderWrapper)1 FrameworkSupportCommunicator (com.intellij.ide.util.newProjectWizard.impl.FrameworkSupportCommunicator)1 Module (com.intellij.openapi.module.Module)1 Project (com.intellij.openapi.project.Project)1 IdeaModifiableModelsProvider (com.intellij.openapi.roots.IdeaModifiableModelsProvider)1 Library (com.intellij.openapi.roots.libraries.Library)1 LibrariesContainer (com.intellij.openapi.roots.ui.configuration.projectRoot.LibrariesContainer)1 Nullable (org.jetbrains.annotations.Nullable)1