use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-community by JetBrains.
the class ConfigurationContext method findExisting.
/**
* Finds an existing run configuration matching the context.
*
* @return an existing configuration, or null if none was found.
*/
@Nullable
public RunnerAndConfigurationSettings findExisting() {
if (myExistingConfiguration != null)
return myExistingConfiguration.get();
myExistingConfiguration = new Ref<>();
if (myLocation == null) {
return null;
}
final PsiElement psiElement = myLocation.getPsiElement();
if (!psiElement.isValid()) {
return null;
}
final List<RuntimeConfigurationProducer> producers = findPreferredProducers();
if (myRuntimeConfiguration != null) {
if (producers != null) {
for (RuntimeConfigurationProducer producer : producers) {
final RunnerAndConfigurationSettings configuration = producer.findExistingConfiguration(myLocation, this);
if (configuration != null && configuration.getConfiguration() == myRuntimeConfiguration) {
myExistingConfiguration.set(configuration);
}
}
}
for (RunConfigurationProducer producer : RunConfigurationProducer.getProducers(getProject())) {
RunnerAndConfigurationSettings configuration = producer.findExistingConfiguration(this);
if (configuration != null && configuration.getConfiguration() == myRuntimeConfiguration) {
myExistingConfiguration.set(configuration);
}
}
}
if (producers != null) {
for (RuntimeConfigurationProducer producer : producers) {
final RunnerAndConfigurationSettings configuration = producer.findExistingConfiguration(myLocation, this);
if (configuration != null) {
myExistingConfiguration.set(configuration);
}
}
}
for (RunConfigurationProducer producer : RunConfigurationProducer.getProducers(getProject())) {
RunnerAndConfigurationSettings configuration = producer.findExistingConfiguration(this);
if (configuration != null) {
myExistingConfiguration.set(configuration);
}
}
return myExistingConfiguration.get();
}
use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-community by JetBrains.
the class ConfigurationSettingsEditorWrapper method getSnapshot.
@Override
public RunnerAndConfigurationSettings getSnapshot() throws ConfigurationException {
RunnerAndConfigurationSettings result = myEditor.getSnapshot();
doApply(result);
return result;
}
use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-community by JetBrains.
the class ProjectStartupTaskManager method verifyState.
private void verifyState() {
if (!myShared.isEmpty()) {
final Collection<RunnerAndConfigurationSettings> sharedConfigurations = getSharedConfigurations();
final List<RunnerAndConfigurationSettings> canNotBeShared = new ArrayList<>();
final Iterator<RunnerAndConfigurationSettings> iterator = sharedConfigurations.iterator();
while (iterator.hasNext()) {
final RunnerAndConfigurationSettings configuration = iterator.next();
if (!myRunManager.isConfigurationShared(configuration)) {
iterator.remove();
canNotBeShared.add(configuration);
}
}
if (!canNotBeShared.isEmpty()) {
canNotBeShared.addAll(getLocalConfigurations());
setStartupConfigurations(sharedConfigurations, canNotBeShared);
}
}
}
use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-community by JetBrains.
the class ProjectStartupTasksTableModel method reValidateConfigurations.
public void reValidateConfigurations(final Processor<RunnerAndConfigurationSettings> existenceChecker) {
final Iterator<RunnerAndConfigurationSettings> iterator = myAllConfigurations.iterator();
while (iterator.hasNext()) {
final RunnerAndConfigurationSettings settings = iterator.next();
if (!existenceChecker.process(settings)) {
iterator.remove();
mySharedConfigurations.remove(settings);
}
}
}
use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-community by JetBrains.
the class ProjectStartupTasksTableModel method removeRow.
@Override
public void removeRow(int idx) {
final RunnerAndConfigurationSettings settings = myAllConfigurations.remove(idx);
if (settings != null) {
mySharedConfigurations.remove(settings);
fireTableDataChanged();
}
}
Aggregations