use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-community by JetBrains.
the class ProjectStartupTaskManager method getConfigurations.
private Collection<RunnerAndConfigurationSettings> getConfigurations(ProjectStartupConfigurationBase configuration) {
if (configuration.isEmpty())
return Collections.emptyList();
final List<RunnerAndConfigurationSettings> result = new ArrayList<>();
final List<ProjectStartupConfigurationBase.ConfigurationDescriptor> list = configuration.getList();
for (ProjectStartupConfigurationBase.ConfigurationDescriptor descriptor : list) {
final RunnerAndConfigurationSettings settings = ((RunManagerImpl) myRunManager).getConfigurationById(descriptor.getId());
if (settings != null && settings.getName().equals(descriptor.getName())) {
result.add(settings);
} else {
NOTIFICATION_GROUP.createNotification(PREFIX + " Run Configuration '" + descriptor.getName() + "' not found, removed from list.", MessageType.WARNING).notify(myProject);
}
}
return result;
}
use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-community by JetBrains.
the class BaseRCSettingsConfigurable method isModified.
@Override
public boolean isModified() {
try {
RunnerAndConfigurationSettings original = getSettings();
RunnerAndConfigurationSettings snapshot = getEditor().getSnapshot();
final RunManagerImpl runManager = RunManagerImpl.getInstanceImpl(original.getConfiguration().getProject());
if (runManager.findExistingConfigurationId(original) == null)
return true;
if (!super.isModified())
return false;
if (!original.isTemplate() && runManager.findExistingConfigurationId(original) == null) {
return true;
}
if (isSnapshotSpecificallyModified(runManager, original, snapshot)) {
return true;
}
if (!runManager.getBeforeRunTasks(original.getConfiguration()).equals(runManager.getBeforeRunTasks(snapshot.getConfiguration()))) {
return true;
}
if (original instanceof JDOMExternalizable && snapshot instanceof JDOMExternalizable) {
applySnapshotToComparison(original, snapshot);
Element originalElement = new Element("config");
Element snapshotElement = new Element("config");
((JDOMExternalizable) original).writeExternal(originalElement);
((JDOMExternalizable) snapshot).writeExternal(snapshotElement);
patchElementsIfNeed(originalElement, snapshotElement);
boolean result = !JDOMUtil.areElementsEqual(originalElement, snapshotElement, true);
if (!result) {
super.setModified(false);
}
return result;
}
} catch (ConfigurationException e) {
//ignore
}
return super.isModified();
}
use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-community by JetBrains.
the class AbstractRunConfigurationTypeUsagesCollector method getProjectUsages.
@NotNull
@Override
public final Set<UsageDescriptor> getProjectUsages(@NotNull final Project project) {
final Set<String> runConfigurationTypes = new HashSet<>();
UIUtil.invokeAndWaitIfNeeded(new Runnable() {
@Override
public void run() {
if (project.isDisposed())
return;
final RunManager runManager = RunManager.getInstance(project);
for (RunnerAndConfigurationSettings settings : runManager.getAllSettings()) {
RunConfiguration runConfiguration = settings.getConfiguration();
if (runConfiguration != null && isApplicable(runManager, settings)) {
final ConfigurationFactory configurationFactory = runConfiguration.getFactory();
final ConfigurationType configurationType = configurationFactory.getType();
final StringBuilder keyBuilder = new StringBuilder();
keyBuilder.append(configurationType.getId());
if (configurationType.getConfigurationFactories().length > 1) {
keyBuilder.append(".").append(configurationFactory.getName());
}
runConfigurationTypes.add(keyBuilder.toString());
}
}
}
});
return ContainerUtil.map2Set(runConfigurationTypes, runConfigurationType -> new UsageDescriptor(runConfigurationType, 1));
}
use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-community by JetBrains.
the class ConfigurationTypeDashboardGroupingRule method getGroup.
@Nullable
@Override
public DashboardGroup getGroup(AbstractTreeNode<?> node) {
if (node instanceof DashboardRunConfigurationNode) {
RunnerAndConfigurationSettings configurationSettings = ((DashboardRunConfigurationNode) node).getConfigurationSettings();
ConfigurationType type = configurationSettings.getType();
if (type != null) {
return new DashboardGroupImpl<>(type, type.getDisplayName(), type.getIcon());
}
}
return null;
}
use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-community by JetBrains.
the class FolderDashboardGroupingRule method getGroup.
@Nullable
@Override
public DashboardGroup getGroup(AbstractTreeNode<?> node) {
if (node instanceof DashboardRunConfigurationNode) {
RunnerAndConfigurationSettings configurationSettings = ((DashboardRunConfigurationNode) node).getConfigurationSettings();
String folderName = configurationSettings.getFolderName();
if (folderName != null) {
return new DashboardGroupImpl<>(folderName, folderName, AllIcons.Nodes.Folder);
}
}
return null;
}
Aggregations