use of com.intellij.execution.ui.RunContentDescriptor in project intellij-community by JetBrains.
the class AbstractAutoTestManager method restartAllAutoTests.
protected void restartAllAutoTests(int modificationStamp) {
RunContentManager contentManager = ExecutionManager.getInstance(myProject).getContentManager();
boolean active = false;
for (RunContentDescriptor descriptor : contentManager.getAllDescriptors()) {
if (isAutoTestEnabledForDescriptor(descriptor)) {
restartAutoTest(descriptor, modificationStamp, myWatcher);
active = true;
}
}
if (!active) {
myWatcher.deactivate();
}
}
use of com.intellij.execution.ui.RunContentDescriptor in project intellij-community by JetBrains.
the class AdjustAutotestDelayActionGroup method update.
@Override
public void update(AnActionEvent e) {
RunContentDescriptor descriptor = LangDataKeys.RUN_CONTENT_DESCRIPTOR.getData(myDataContext);
boolean visible = false;
if (descriptor != null) {
for (AnAction action : descriptor.getRestartActions()) {
if (action instanceof ToggleAutoTestAction) {
visible = ((ToggleAutoTestAction) action).isDelayApplicable();
break;
}
}
}
e.getPresentation().setVisible(visible);
}
use of com.intellij.execution.ui.RunContentDescriptor in project intellij-community by JetBrains.
the class ToggleAutoTestAction method isSelected.
@Override
public boolean isSelected(AnActionEvent e) {
Project project = e.getProject();
RunContentDescriptor descriptor = e.getData(LangDataKeys.RUN_CONTENT_DESCRIPTOR);
return project != null && descriptor != null && getAutoTestManager(project).isAutoTestEnabled(descriptor);
}
use of com.intellij.execution.ui.RunContentDescriptor in project intellij-community by JetBrains.
the class RerunFailedTestsAction method getAction.
private static boolean getAction(@NotNull AnActionEvent e, boolean execute) {
Project project = e.getProject();
if (project == null) {
return false;
}
RunContentDescriptor contentDescriptor = ExecutionManager.getInstance(project).getContentManager().getSelectedContent();
if (contentDescriptor == null) {
return false;
}
JComponent component = contentDescriptor.getComponent();
if (component == null) {
return false;
}
ExecutionEnvironment environment = LangDataKeys.EXECUTION_ENVIRONMENT.getData(DataManager.getInstance().getDataContext(component));
if (environment == null) {
return false;
}
AnAction[] actions = contentDescriptor.getRestartActions();
if (actions.length == 0) {
return false;
}
for (AnAction action : actions) {
if (action instanceof AbstractRerunFailedTestsAction) {
if (execute) {
((AbstractRerunFailedTestsAction) action).execute(e, environment);
}
return true;
}
}
return false;
}
use of com.intellij.execution.ui.RunContentDescriptor in project intellij-community by JetBrains.
the class AbstractTerminalRunner method initConsoleUI.
private void initConsoleUI(final T process) {
final Executor defaultExecutor = DefaultRunExecutor.getRunExecutorInstance();
final DefaultActionGroup toolbarActions = new DefaultActionGroup();
final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, toolbarActions, false);
final JPanel panel = new JPanel(new BorderLayout());
panel.add(actionToolbar.getComponent(), BorderLayout.WEST);
actionToolbar.setTargetComponent(panel);
ProcessHandler processHandler = createProcessHandler(process);
final RunContentDescriptor contentDescriptor = new RunContentDescriptor(null, processHandler, panel, getTerminalConnectionName(process));
contentDescriptor.setAutoFocusContent(true);
toolbarActions.add(createCloseAction(defaultExecutor, contentDescriptor));
final JBTerminalSystemSettingsProvider provider = new JBTerminalSystemSettingsProvider();
TerminalWidget widget = new JBTabbedTerminalWidget(myProject, provider, new Predicate<Pair<TerminalWidget, String>>() {
@Override
public boolean apply(Pair<TerminalWidget, String> widget) {
openSessionInDirectory(widget.getFirst(), widget.getSecond());
return true;
}
}, contentDescriptor);
createAndStartSession(widget, createTtyConnector(process));
panel.add(widget.getComponent(), BorderLayout.CENTER);
showConsole(defaultExecutor, contentDescriptor, widget.getComponent());
processHandler.startNotify();
}
Aggregations