use of com.intellij.execution.RunManagerEx in project intellij-community by JetBrains.
the class RemoveMavenRunConfigurationAction method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
Project project = e.getProject();
RunnerAndConfigurationSettings settings = MavenDataKeys.RUN_CONFIGURATION.getData(e.getDataContext());
assert settings != null && project != null;
int res = Messages.showYesNoDialog(project, "Delete \"" + settings.getName() + "\"?", "Confirmation", Messages.getQuestionIcon());
if (res == Messages.YES) {
((RunManagerEx) RunManager.getInstance(project)).removeConfiguration(settings);
}
}
use of com.intellij.execution.RunManagerEx in project intellij-community by JetBrains.
the class ConfigurationsTest method createConfiguration.
private static TestNGConfiguration createConfiguration(final Project project) {
final RunManagerEx manager = RunManagerEx.getInstanceEx(project);
final RunnerAndConfigurationSettings settings = manager.createRunConfiguration("testt", TestNGConfigurationType.getInstance().getConfigurationFactories()[0]);
manager.addConfiguration(settings, false);
return (TestNGConfiguration) settings.getConfiguration();
}
use of com.intellij.execution.RunManagerEx in project intellij-community by JetBrains.
the class BuildArtifactsBeforeRunTaskProvider method setBuildArtifactBeforeRun.
public static void setBuildArtifactBeforeRun(@NotNull Project project, @NotNull RunConfiguration configuration, @NotNull Artifact artifact) {
RunManagerEx runManager = RunManagerEx.getInstanceEx(project);
final List<BuildArtifactsBeforeRunTask> buildArtifactsTasks = runManager.getBeforeRunTasks(configuration, ID);
if (buildArtifactsTasks.isEmpty()) {
//Add new task if absent
BuildArtifactsBeforeRunTask task = new BuildArtifactsBeforeRunTask(project);
buildArtifactsTasks.add(task);
List<BeforeRunTask> tasks = runManager.getBeforeRunTasks(configuration);
tasks.add(task);
runManager.setBeforeRunTasks(configuration, tasks, false);
}
for (BuildArtifactsBeforeRunTask task : buildArtifactsTasks) {
task.setEnabled(true);
task.addArtifact(artifact);
}
}
use of com.intellij.execution.RunManagerEx in project intellij-community by JetBrains.
the class RunConfigurationNode method handleDoubleClickOrEnter.
@Override
public void handleDoubleClickOrEnter(SimpleTree tree, InputEvent inputEvent) {
final Project project = getExternalProjectsView().getProject();
ProgramRunnerUtil.executeConfiguration(project, mySettings, DefaultRunExecutor.getRunExecutorInstance());
final RunManagerEx runManagerEx = RunManagerEx.getInstanceEx(project);
runManagerEx.setSelectedConfiguration(mySettings);
}
use of com.intellij.execution.RunManagerEx in project intellij-community by JetBrains.
the class ExternalSystemRunManagerListener method attach.
public void attach() {
myMap.clear();
for (ExternalSystemManager<?, ?, ?, ?, ?> systemManager : ExternalSystemApiUtil.getAllManagers()) {
final AbstractExternalSystemTaskConfigurationType configurationType = ExternalSystemUtil.findConfigurationType(systemManager.getSystemId());
if (configurationType == null)
continue;
final List<RunnerAndConfigurationSettings> configurationSettingsList = RunManager.getInstance(myManager.getProject()).getConfigurationSettingsList(configurationType);
for (RunnerAndConfigurationSettings configurationSettings : configurationSettingsList) {
add(myMap, configurationSettings);
}
}
((RunManagerEx) RunManager.getInstance(myManager.getProject())).addRunManagerListener(this);
}
Aggregations