use of com.intellij.execution.RunManagerEx in project intellij-community by JetBrains.
the class ToggleBeforeRunTaskAction method doIsSelected.
@Override
protected boolean doIsSelected(AnActionEvent e) {
final DataContext context = e.getDataContext();
final Pair<MavenProject, String> desc = getTaskDesc(context);
if (desc != null) {
final RunManagerEx runManager = getRunManager(context);
if (runManager == null)
return false;
for (MavenBeforeRunTask each : runManager.getBeforeRunTasks(MavenBeforeRunTasksProvider.ID)) {
if (each.isFor(desc.first, desc.second))
return true;
}
}
return false;
}
use of com.intellij.execution.RunManagerEx in project intellij-community by JetBrains.
the class MavenTasksManager method getDescription.
public String getDescription(MavenProject project, String goal) {
List<String> result = new ArrayList<>();
MavenCompilerTask compilerTask = new MavenCompilerTask(project.getPath(), goal);
synchronized (this) {
for (Phase phase : Phase.values()) {
if (myState.getTasks(phase).contains(compilerTask)) {
result.add(TasksBundle.message(phase.myMessageKey));
}
}
}
RunManagerEx runManager = RunManagerEx.getInstanceEx(myProject);
for (MavenBeforeRunTask each : runManager.getBeforeRunTasks(MavenBeforeRunTasksProvider.ID)) {
if (each.isFor(project, goal)) {
result.add(TasksBundle.message("maven.tasks.goal.before.run"));
break;
}
}
return StringUtil.join(result, ", ");
}
use of com.intellij.execution.RunManagerEx 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();
}
});
}
use of com.intellij.execution.RunManagerEx in project intellij-plugins by JetBrains.
the class CfmlRunConfigurationTest method getContextRunConfiguration.
private static CfmlRunConfiguration getContextRunConfiguration(Editor editor) {
final DataContext dataContext = DataManager.getInstance().getDataContext(editor.getComponent());
final ConfigurationContext configurationContext = ConfigurationContext.getFromContext(dataContext);
//this block emulates RunContextAction.perform()
RunnerAndConfigurationSettings configuration = configurationContext.findExisting();
if (configuration == null) {
configuration = configurationContext.getConfiguration();
if (configuration == null) {
return null;
}
((RunManagerEx) configurationContext.getRunManager()).setTemporaryConfiguration(configuration);
}
//end of the emulated block
return (CfmlRunConfiguration) configuration.getConfiguration();
}
Aggregations