use of com.intellij.execution.impl.ConsoleViewImpl in project intellij-community by JetBrains.
the class StudyCheckUtils method showTestResultsToolWindow.
public static void showTestResultsToolWindow(@NotNull final Project project, @NotNull final String message, boolean solved) {
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
ToolWindow window = toolWindowManager.getToolWindow(StudyTestResultsToolWindowFactoryKt.ID);
if (window == null) {
toolWindowManager.registerToolWindow(StudyTestResultsToolWindowFactoryKt.ID, true, ToolWindowAnchor.BOTTOM);
window = toolWindowManager.getToolWindow(StudyTestResultsToolWindowFactoryKt.ID);
new StudyTestResultsToolWindowFactory().createToolWindowContent(project, window);
}
final Content[] contents = window.getContentManager().getContents();
for (Content content : contents) {
final JComponent component = content.getComponent();
if (component instanceof ConsoleViewImpl) {
((ConsoleViewImpl) component).clear();
if (!solved) {
((ConsoleViewImpl) component).print(message, ConsoleViewContentType.ERROR_OUTPUT);
} else {
((ConsoleViewImpl) component).print(message, ConsoleViewContentType.NORMAL_OUTPUT);
}
window.setAvailable(true, () -> {
});
window.show(() -> {
});
return;
}
}
}
use of com.intellij.execution.impl.ConsoleViewImpl in project intellij-community by JetBrains.
the class RemoteStateState method execute.
public ExecutionResult execute(final Executor executor, @NotNull final ProgramRunner runner) throws ExecutionException {
ConsoleViewImpl consoleView = new ConsoleViewImpl(myProject, false);
RemoteDebugProcessHandler process = new RemoteDebugProcessHandler(myProject);
consoleView.attachToProcess(process);
return new DefaultExecutionResult(consoleView, process);
}
use of com.intellij.execution.impl.ConsoleViewImpl in project azure-tools-for-java by Microsoft.
the class SparkBatchJobSubmissionState method execute.
@Nullable
@Override
public ExecutionResult execute(Executor executor, @NotNull ProgramRunner programRunner) throws ExecutionException {
if (programRunner instanceof SparkBatchJobDebuggerRunner) {
ConsoleViewImpl consoleView = new ConsoleViewImpl(myProject, false);
RemoteDebugProcessHandler process = new RemoteDebugProcessHandler(myProject);
consoleView.attachToProcess(process);
return new DefaultExecutionResult(consoleView, process);
} else if (programRunner instanceof SparkBatchJobRunner) {
SparkBatchJobRunner jobRunner = (SparkBatchJobRunner) programRunner;
jobRunner.submitJob(getSubmitModel());
}
return null;
}
use of com.intellij.execution.impl.ConsoleViewImpl in project intellij-community by JetBrains.
the class RunIdeConsoleAction method selectContent.
private static void selectContent(RunContentDescriptor descriptor) {
Executor executor = DefaultRunExecutor.getRunExecutorInstance();
ConsoleViewImpl consoleView = ObjectUtils.assertNotNull((ConsoleViewImpl) descriptor.getExecutionConsole());
ExecutionManager.getInstance(consoleView.getProject()).getContentManager().toFrontRunContent(executor, descriptor);
}
use of com.intellij.execution.impl.ConsoleViewImpl in project intellij-community by JetBrains.
the class AnalyzeStacktraceUtil method addConsole.
public static RunContentDescriptor addConsole(Project project, @Nullable ConsoleFactory consoleFactory, final String tabTitle, String text, @Nullable Icon icon) {
final TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(project);
builder.filters(Extensions.getExtensions(EP_NAME, project));
final ConsoleView consoleView = builder.getConsole();
final DefaultActionGroup toolbarActions = new DefaultActionGroup();
JComponent consoleComponent = consoleFactory != null ? consoleFactory.createConsoleComponent(consoleView, toolbarActions) : new MyConsolePanel(consoleView, toolbarActions);
final RunContentDescriptor descriptor = new RunContentDescriptor(consoleView, null, consoleComponent, tabTitle, icon) {
@Override
public boolean isContentReuseProhibited() {
return true;
}
};
final Executor executor = DefaultRunExecutor.getRunExecutorInstance();
for (AnAction action : consoleView.createConsoleActions()) {
toolbarActions.add(action);
}
final ConsoleViewImpl console = (ConsoleViewImpl) consoleView;
ConsoleViewUtil.enableReplaceActionForConsoleViewEditor(console.getEditor());
console.getEditor().getSettings().setCaretRowShown(true);
toolbarActions.add(new AnnotateStackTraceAction(console.getEditor(), console.getHyperlinks()));
toolbarActions.add(new CloseAction(executor, descriptor, project));
ExecutionManager.getInstance(project).getContentManager().showRunContent(executor, descriptor);
consoleView.allowHeavyFilters();
if (consoleFactory == null) {
printStacktrace(consoleView, text);
}
return descriptor;
}
Aggregations