Search in sources :

Example 1 with RunManagerListener

use of com.intellij.execution.RunManagerListener 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 2 with RunManagerListener

use of com.intellij.execution.RunManagerListener 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)

Aggregations

RunManagerListener (com.intellij.execution.RunManagerListener)2 RunnerAndConfigurationSettings (com.intellij.execution.RunnerAndConfigurationSettings)2 RunManagerEx (com.intellij.execution.RunManagerEx)1 MavenRunnerSettings (org.jetbrains.idea.maven.execution.MavenRunnerSettings)1 MavenShortcutsManager (org.jetbrains.idea.maven.tasks.MavenShortcutsManager)1 MavenTasksManager (org.jetbrains.idea.maven.tasks.MavenTasksManager)1