use of com.intellij.execution.configurations.UnknownRunConfiguration in project intellij-community by JetBrains.
the class ProjectRunConfigurationManager method loadState.
@Override
public void loadState(Element state) {
if (myUnloadedElements != null) {
myUnloadedElements.clear();
}
Set<String> existing = new THashSet<>();
for (Iterator<Element> iterator = state.getChildren().iterator(); iterator.hasNext(); ) {
Element child = iterator.next();
RunnerAndConfigurationSettings configuration = myManager.loadConfiguration(child, true);
if (configuration != null) {
existing.add(configuration.getUniqueID());
} else if (child.getName().equals(RunManagerImpl.CONFIGURATION)) {
if (myUnloadedElements == null) {
myUnloadedElements = new SmartList<>();
}
iterator.remove();
myUnloadedElements.add(child);
}
}
myManager.removeNotExistingSharedConfigurations(existing);
if (myManager.getSelectedConfiguration() == null) {
final List<RunConfiguration> allConfigurations = myManager.getAllConfigurationsList();
for (final RunConfiguration configuration : allConfigurations) {
final RunnerAndConfigurationSettings settings = myManager.getSettings(allConfigurations.get(0));
if (!(configuration instanceof UnknownRunConfiguration)) {
myManager.setSelectedConfiguration(settings);
break;
}
}
}
// IDEA-60004: configs may never be sorted before write, so call it manually after shared configs read
myManager.setOrdered(false);
myManager.getSortedConfigurations();
}
Aggregations