use of com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTree in project intellij-community by JetBrains.
the class ExternalProjectPathField method buildRegisteredProjectsTree.
@NotNull
private static Tree buildRegisteredProjectsTree(@NotNull Project project, @NotNull ProjectSystemId externalSystemId) {
ExternalSystemTasksTreeModel model = new ExternalSystemTasksTreeModel(externalSystemId);
ExternalSystemTasksTree result = new ExternalSystemTasksTree(model, ContainerUtilRt.<String, Boolean>newHashMap(), project, externalSystemId);
ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(externalSystemId);
assert manager != null;
AbstractExternalSystemLocalSettings settings = manager.getLocalSettingsProvider().fun(project);
Map<ExternalProjectPojo, Collection<ExternalProjectPojo>> projects = settings.getAvailableProjects();
List<ExternalProjectPojo> rootProjects = ContainerUtilRt.newArrayList(projects.keySet());
ContainerUtil.sort(rootProjects);
for (ExternalProjectPojo rootProject : rootProjects) {
model.ensureSubProjectsStructure(rootProject, projects.get(rootProject));
}
return result;
}
Aggregations