Search in sources :

Example 1 with ExternalSystemTasksTreeModel

use of com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTreeModel 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;
}
Also used : ExternalSystemTasksTreeModel(com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTreeModel) AbstractExternalSystemLocalSettings(com.intellij.openapi.externalSystem.settings.AbstractExternalSystemLocalSettings) ExternalSystemTasksTree(com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTree) Collection(java.util.Collection) ExternalProjectPojo(com.intellij.openapi.externalSystem.model.project.ExternalProjectPojo) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ExternalProjectPojo (com.intellij.openapi.externalSystem.model.project.ExternalProjectPojo)1 ExternalSystemTasksTree (com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTree)1 ExternalSystemTasksTreeModel (com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTreeModel)1 AbstractExternalSystemLocalSettings (com.intellij.openapi.externalSystem.settings.AbstractExternalSystemLocalSettings)1 Collection (java.util.Collection)1 NotNull (org.jetbrains.annotations.NotNull)1