Search in sources :

Example 16 with ExternalProjectPojo

use of com.intellij.openapi.externalSystem.model.project.ExternalProjectPojo in project intellij-community by JetBrains.

the class AbstractExternalSystemLocalSettings method forgetExternalProjects.

/**
   * Asks current settings to drop all information related to external projects which root configs are located at the given paths.
   *
   * @param linkedProjectPathsToForget  target root external project paths
   */
public void forgetExternalProjects(@NotNull Set<String> linkedProjectPathsToForget) {
    Map<ExternalProjectPojo, Collection<ExternalProjectPojo>> projects = myAvailableProjects.get();
    for (Iterator<Map.Entry<ExternalProjectPojo, Collection<ExternalProjectPojo>>> it = projects.entrySet().iterator(); it.hasNext(); ) {
        Map.Entry<ExternalProjectPojo, Collection<ExternalProjectPojo>> entry = it.next();
        if (linkedProjectPathsToForget.contains(entry.getKey().getPath())) {
            it.remove();
        }
    }
    for (Iterator<Map.Entry<String, Collection<ExternalTaskPojo>>> it = myAvailableTasks.get().entrySet().iterator(); it.hasNext(); ) {
        Map.Entry<String, Collection<ExternalTaskPojo>> entry = it.next();
        if (linkedProjectPathsToForget.contains(entry.getKey()) || linkedProjectPathsToForget.contains(ExternalSystemApiUtil.getRootProjectPath(entry.getKey(), myExternalSystemId, myProject))) {
            it.remove();
        }
    }
    for (Iterator<ExternalTaskExecutionInfo> it = myRecentTasks.get().iterator(); it.hasNext(); ) {
        ExternalTaskExecutionInfo taskInfo = it.next();
        String path = taskInfo.getSettings().getExternalProjectPath();
        if (linkedProjectPathsToForget.contains(path) || linkedProjectPathsToForget.contains(ExternalSystemApiUtil.getRootProjectPath(path, myExternalSystemId, myProject))) {
            it.remove();
        }
    }
    for (Iterator<Map.Entry<String, ExternalProjectBuildClasspathPojo>> it = myProjectBuildClasspath.get().entrySet().iterator(); it.hasNext(); ) {
        Map.Entry<String, ExternalProjectBuildClasspathPojo> entry = it.next();
        if (linkedProjectPathsToForget.contains(entry.getKey()) || linkedProjectPathsToForget.contains(ExternalSystemApiUtil.getRootProjectPath(entry.getKey(), myExternalSystemId, myProject))) {
            it.remove();
        }
    }
    Map<String, Long> modificationStamps = myExternalConfigModificationStamps.get();
    for (String path : linkedProjectPathsToForget) {
        modificationStamps.remove(path);
    }
}
Also used : ExternalTaskPojo(com.intellij.openapi.externalSystem.model.execution.ExternalTaskPojo) ExternalTaskExecutionInfo(com.intellij.openapi.externalSystem.model.execution.ExternalTaskExecutionInfo) ExternalProjectBuildClasspathPojo(com.intellij.openapi.externalSystem.model.project.ExternalProjectBuildClasspathPojo) ExternalProjectPojo(com.intellij.openapi.externalSystem.model.project.ExternalProjectPojo)

Example 17 with ExternalProjectPojo

use of com.intellij.openapi.externalSystem.model.project.ExternalProjectPojo in project azure-tools-for-java by Microsoft.

the class GradleUtils method listGradleProjects.

public static List<ExternalProjectPojo> listGradleProjects(Project project) {
    GradleManager manager = (GradleManager) ExternalSystemApiUtil.getManager(GradleConstants.SYSTEM_ID);
    Map<ExternalProjectPojo, Collection<ExternalProjectPojo>> projects = manager.getLocalSettingsProvider().fun(project).getAvailableProjects();
    return new ArrayList(projects.keySet());
}
Also used : GradleManager(org.jetbrains.plugins.gradle.GradleManager) ExternalProjectPojo(com.intellij.openapi.externalSystem.model.project.ExternalProjectPojo)

Aggregations

ExternalProjectPojo (com.intellij.openapi.externalSystem.model.project.ExternalProjectPojo)17 AbstractExternalSystemLocalSettings (com.intellij.openapi.externalSystem.settings.AbstractExternalSystemLocalSettings)5 Collection (java.util.Collection)5 NotNull (org.jetbrains.annotations.NotNull)5 ExternalTaskExecutionInfo (com.intellij.openapi.externalSystem.model.execution.ExternalTaskExecutionInfo)4 ExternalTaskPojo (com.intellij.openapi.externalSystem.model.execution.ExternalTaskPojo)4 MultiMap (com.intellij.util.containers.MultiMap)3 Map (java.util.Map)3 ExternalSystemUiAware (com.intellij.openapi.externalSystem.ExternalSystemUiAware)2 ModuleData (com.intellij.openapi.externalSystem.model.project.ModuleData)2 ProjectData (com.intellij.openapi.externalSystem.model.project.ProjectData)2 ExternalSystemTasksTree (com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTree)2 EditorTextField (com.intellij.ui.EditorTextField)2 CompletionResultSet (com.intellij.codeInsight.completion.CompletionResultSet)1 Editor (com.intellij.openapi.editor.Editor)1 DataNode (com.intellij.openapi.externalSystem.model.DataNode)1 ProjectSystemId (com.intellij.openapi.externalSystem.model.ProjectSystemId)1 InternalExternalProjectInfo (com.intellij.openapi.externalSystem.model.internal.InternalExternalProjectInfo)1 ExternalProjectBuildClasspathPojo (com.intellij.openapi.externalSystem.model.project.ExternalProjectBuildClasspathPojo)1 TaskData (com.intellij.openapi.externalSystem.model.task.TaskData)1