Search in sources :

Example 1 with RunManagerEx

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);
    }
}
Also used : Project(com.intellij.openapi.project.Project) RunManagerEx(com.intellij.execution.RunManagerEx) RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings)

Example 2 with RunManagerEx

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();
}
Also used : RunManagerEx(com.intellij.execution.RunManagerEx) RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings)

Example 3 with RunManagerEx

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);
    }
}
Also used : BeforeRunTask(com.intellij.execution.BeforeRunTask) RunManagerEx(com.intellij.execution.RunManagerEx)

Example 4 with RunManagerEx

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);
}
Also used : Project(com.intellij.openapi.project.Project) RunManagerEx(com.intellij.execution.RunManagerEx)

Example 5 with RunManagerEx

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);
}
Also used : RunManagerEx(com.intellij.execution.RunManagerEx) RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings) AbstractExternalSystemTaskConfigurationType(com.intellij.openapi.externalSystem.service.execution.AbstractExternalSystemTaskConfigurationType)

Aggregations

RunManagerEx (com.intellij.execution.RunManagerEx)19 RunnerAndConfigurationSettings (com.intellij.execution.RunnerAndConfigurationSettings)14 Project (com.intellij.openapi.project.Project)5 ConfigurationFactoryEx (com.intellij.execution.configuration.ConfigurationFactoryEx)3 ExternalTaskExecutionInfo (com.intellij.openapi.externalSystem.model.execution.ExternalTaskExecutionInfo)3 ConfigurationContext (com.intellij.execution.actions.ConfigurationContext)2 ConfigurationFactory (com.intellij.execution.configurations.ConfigurationFactory)2 DataContext (com.intellij.openapi.actionSystem.DataContext)2 ArrayList (java.util.ArrayList)2 CfmlRunConfiguration (com.intellij.coldFusion.UI.runner.CfmlRunConfiguration)1 BeforeRunTask (com.intellij.execution.BeforeRunTask)1 RunManagerListener (com.intellij.execution.RunManagerListener)1 ConfigurationType (com.intellij.execution.configurations.ConfigurationType)1 RunnerAndConfigurationSettingsImpl (com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl)1 AntBeforeRunTask (com.intellij.lang.ant.config.impl.AntBeforeRunTask)1 ExecuteCompositeTargetEvent (com.intellij.lang.ant.config.impl.ExecuteCompositeTargetEvent)1 MetaTarget (com.intellij.lang.ant.config.impl.MetaTarget)1 TextAttributes (com.intellij.openapi.editor.markup.TextAttributes)1 ExternalSystemTaskExecutionSettings (com.intellij.openapi.externalSystem.model.execution.ExternalSystemTaskExecutionSettings)1 AbstractExternalSystemTaskConfigurationType (com.intellij.openapi.externalSystem.service.execution.AbstractExternalSystemTaskConfigurationType)1