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;
}
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;
}
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();
}
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<>();
}
Aggregations