Search in sources :

Example 86 with RunnerAndConfigurationSettings

use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-community by JetBrains.

the class MavenProjectsNavigator method listenForProjectsChanges.

private void listenForProjectsChanges() {
    myProjectsManager.addProjectsTreeListener(new MyProjectsListener());
    myShortcutsManager.addListener(new MavenShortcutsManager.Listener() {

        @Override
        public void shortcutsUpdated() {
            scheduleStructureRequest(() -> myStructure.updateGoals());
        }
    });
    myTasksManager.addListener(new MavenTasksManager.Listener() {

        @Override
        public void compileTasksChanged() {
            scheduleStructureRequest(() -> myStructure.updateGoals());
        }
    });
    RunManagerEx.getInstanceEx(myProject).addRunManagerListener(new RunManagerListener() {

        @Override
        public void beforeRunTasksChanged() {
            scheduleStructureRequest(() -> myStructure.updateGoals());
        }
    });
    MavenRunner.getInstance(myProject).getSettings().addListener(new MavenRunnerSettings.Listener() {

        @Override
        public void skipTestsChanged() {
            scheduleStructureRequest(() -> myStructure.updateGoals());
        }
    });
    ((RunManagerEx) RunManager.getInstance(myProject)).addRunManagerListener(new RunManagerListener() {

        private void changed() {
            scheduleStructureRequest(() -> myStructure.updateRunConfigurations());
        }

        @Override
        public void runConfigurationAdded(@NotNull RunnerAndConfigurationSettings settings) {
            changed();
        }

        @Override
        public void runConfigurationRemoved(@NotNull RunnerAndConfigurationSettings settings) {
            changed();
        }

        @Override
        public void runConfigurationChanged(@NotNull RunnerAndConfigurationSettings settings) {
            changed();
        }
    });
}
Also used : MavenRunnerSettings(org.jetbrains.idea.maven.execution.MavenRunnerSettings) RunManagerEx(com.intellij.execution.RunManagerEx) RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings) MavenTasksManager(org.jetbrains.idea.maven.tasks.MavenTasksManager) RunManagerListener(com.intellij.execution.RunManagerListener) MavenShortcutsManager(org.jetbrains.idea.maven.tasks.MavenShortcutsManager)

Example 87 with RunnerAndConfigurationSettings

use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-community by JetBrains.

the class EditMavenRunConfigurationAction 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;
    RunManager.getInstance(project).setSelectedConfiguration(settings);
    EditConfigurationsDialog dialog = new EditConfigurationsDialog(project);
    dialog.show();
}
Also used : Project(com.intellij.openapi.project.Project) EditConfigurationsDialog(com.intellij.execution.impl.EditConfigurationsDialog) RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings)

Example 88 with RunnerAndConfigurationSettings

use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-community by JetBrains.

the class EditMavenRunConfigurationAction method update.

@Override
public void update(@NotNull AnActionEvent e) {
    Project project = e.getProject();
    RunnerAndConfigurationSettings settings = MavenDataKeys.RUN_CONFIGURATION.getData(e.getDataContext());
    boolean enabled = settings != null && project != null;
    e.getPresentation().setEnabledAndVisible(enabled);
}
Also used : Project(com.intellij.openapi.project.Project) RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings)

Example 89 with RunnerAndConfigurationSettings

use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-community by JetBrains.

the class CloudGitRemoteDetector method projectOpened.

@Override
public void projectOpened() {
    myProject.getMessageBus().connect().subscribe(GitRepository.GIT_REPO_CHANGE, this);
    myRunManager.addRunManagerListener(new RunManagerListener() {

        @Override
        public void runConfigurationAdded(@NotNull RunnerAndConfigurationSettings settings) {
            onRunConfigurationAddedOrChanged(settings);
        }

        @Override
        public void runConfigurationChanged(@NotNull RunnerAndConfigurationSettings settings) {
            onRunConfigurationAddedOrChanged(settings);
        }
    });
}
Also used : RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings) RunManagerListener(com.intellij.execution.RunManagerListener)

Example 90 with RunnerAndConfigurationSettings

use of com.intellij.execution.RunnerAndConfigurationSettings in project intellij-community by JetBrains.

the class PluginProjectWizardTest method testPluginProject.

public void testPluginProject() throws Exception {
    createSdk("devkit", IdeaJdk.getInstance());
    Project project = createProjectFromTemplate(PluginModuleType.getInstance().getName(), null, null);
    VirtualFile virtualFile = project.getBaseDir().findFileByRelativePath("resources/META-INF/plugin.xml");
    assertNotNull(virtualFile);
    RunnerAndConfigurationSettings configuration = RunManager.getInstance(project).getSelectedConfiguration();
    assertNotNull(configuration);
    ConfigurationType type = configuration.getType();
    assertNotNull(type);
    assertEquals(DevKitBundle.message("run.configuration.title"), type.getDisplayName());
    VirtualFile[] files = FileEditorManager.getInstance(project).getOpenFiles();
    assertEquals(1, files.length);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) ConfigurationType(com.intellij.execution.configurations.ConfigurationType) Project(com.intellij.openapi.project.Project) RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings)

Aggregations

RunnerAndConfigurationSettings (com.intellij.execution.RunnerAndConfigurationSettings)104 Project (com.intellij.openapi.project.Project)24 RunConfiguration (com.intellij.execution.configurations.RunConfiguration)16 RunManagerEx (com.intellij.execution.RunManagerEx)14 Nullable (org.jetbrains.annotations.Nullable)14 RunManager (com.intellij.execution.RunManager)12 VirtualFile (com.intellij.openapi.vfs.VirtualFile)11 Module (com.intellij.openapi.module.Module)10 NotNull (org.jetbrains.annotations.NotNull)9 ConfigurationFactory (com.intellij.execution.configurations.ConfigurationFactory)7 ConfigurationType (com.intellij.execution.configurations.ConfigurationType)7 ExternalSystemRunConfiguration (com.intellij.openapi.externalSystem.service.execution.ExternalSystemRunConfiguration)7 ExternalSystemTaskExecutionSettings (com.intellij.openapi.externalSystem.model.execution.ExternalSystemTaskExecutionSettings)6 Executor (com.intellij.execution.Executor)4 RunManagerImpl (com.intellij.execution.impl.RunManagerImpl)4 AbstractExternalSystemTaskConfigurationType (com.intellij.openapi.externalSystem.service.execution.AbstractExternalSystemTaskConfigurationType)4 ExternalSystemNode (com.intellij.openapi.externalSystem.view.ExternalSystemNode)4 RunConfigurationNode (com.intellij.openapi.externalSystem.view.RunConfigurationNode)4 PsiElement (com.intellij.psi.PsiElement)4 ConfigurationContext (com.intellij.execution.actions.ConfigurationContext)3