use of com.intellij.openapi.externalSystem.service.project.manage.ExternalSystemTaskActivator.Phase in project intellij-community by JetBrains.
the class ExternalSystemRunManagerListener method runConfigurationRemoved.
@Override
public void runConfigurationRemoved(@NotNull RunnerAndConfigurationSettings settings) {
if (settings.getConfiguration() instanceof ExternalSystemRunConfiguration) {
final Pair<String, RunnerAndConfigurationSettings> pair = myMap.remove(System.identityHashCode(settings));
if (pair == null)
return;
final ExternalProjectsManager.ExternalProjectsStateProvider stateProvider = myManager.getStateProvider();
final ExternalSystemTaskExecutionSettings taskExecutionSettings = ((ExternalSystemRunConfiguration) settings.getConfiguration()).getSettings();
if (taskExecutionSettings.getExternalProjectPath() == null)
return;
final TaskActivationState activation = stateProvider.getTasksActivation(taskExecutionSettings.getExternalSystemId(), taskExecutionSettings.getExternalProjectPath());
for (Phase phase : Phase.values()) {
for (Iterator<String> iterator = activation.getTasks(phase).iterator(); iterator.hasNext(); ) {
String task = iterator.next();
if (pair.first.equals(task)) {
iterator.remove();
break;
}
}
}
}
}
use of com.intellij.openapi.externalSystem.service.project.manage.ExternalSystemTaskActivator.Phase in project intellij-community by JetBrains.
the class ExternalSystemRunManagerListener method runConfigurationChanged.
@Override
public void runConfigurationChanged(@NotNull RunnerAndConfigurationSettings settings) {
if (settings.getConfiguration() instanceof ExternalSystemRunConfiguration) {
final Pair<String, RunnerAndConfigurationSettings> pair = myMap.get(System.identityHashCode(settings));
if (pair != null) {
final ExternalProjectsManager.ExternalProjectsStateProvider stateProvider = myManager.getStateProvider();
final ExternalSystemTaskExecutionSettings taskExecutionSettings = ((ExternalSystemRunConfiguration) settings.getConfiguration()).getSettings();
if (taskExecutionSettings.getExternalProjectPath() == null)
return;
final TaskActivationState activation = stateProvider.getTasksActivation(taskExecutionSettings.getExternalSystemId(), taskExecutionSettings.getExternalProjectPath());
for (Phase phase : Phase.values()) {
final List<String> modifiableActivationTasks = activation.getTasks(phase);
for (String task : ContainerUtil.newArrayList(modifiableActivationTasks)) {
if (pair.first.equals(task)) {
modifiableActivationTasks.remove(task);
final String runConfigurationActivationTaskName = getRunConfigurationActivationTaskName(settings);
modifiableActivationTasks.add(runConfigurationActivationTaskName);
myMap.put(System.identityHashCode(settings), Pair.create(runConfigurationActivationTaskName, settings));
break;
}
}
}
}
}
}
Aggregations