Search in sources :

Example 21 with ConsoleView

use of com.intellij.execution.ui.ConsoleView in project freeline by alibaba.

the class FreelineUtil method processConsole.

/* process attach to console,show the log */
// TODO: 2016/9/14 0014 need refactor console method
private static void processConsole(Project project, ProcessHandler processHandler) {
    ConsoleView consoleView = FreeUIManager.getInstance(project).getConsoleView(project);
    consoleView.clear();
    consoleView.attachToProcess(processHandler);
    ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
    ToolWindow toolWindow;
    toolWindow = toolWindowManager.getToolWindow(TOOL_ID);
    // if already exist tool window then show it
    if (toolWindow != null) {
        toolWindow.show(null);
        return;
    }
    toolWindow = toolWindowManager.registerToolWindow(TOOL_ID, true, ToolWindowAnchor.BOTTOM);
    toolWindow.setTitle("free....");
    toolWindow.setStripeTitle("Free Console");
    toolWindow.setShowStripeButton(true);
    toolWindow.setIcon(PluginIcons.ICON_TOOL_WINDOW);
    toolWindow.getContentManager().addContent(new ContentImpl(consoleView.getComponent(), "Build", true));
    toolWindow.show(null);
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) ConsoleView(com.intellij.execution.ui.ConsoleView) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager) ContentImpl(com.intellij.ui.content.impl.ContentImpl)

Example 22 with ConsoleView

use of com.intellij.execution.ui.ConsoleView in project intellij-elixir by KronicDeth.

the class ElixirXDebugProcess method createConsole.

@NotNull
@Override
public ExecutionConsole createConsole() {
    ConsoleView consoleView = myRunningState.createConsoleView(myExecutionEnvironment.getExecutor());
    consoleView.attachToProcess(getProcessHandler());
    myElixirProcessHandler.startNotify();
    return consoleView;
}
Also used : ConsoleView(com.intellij.execution.ui.ConsoleView) NotNull(org.jetbrains.annotations.NotNull)

Example 23 with ConsoleView

use of com.intellij.execution.ui.ConsoleView in project intellij-elixir by KronicDeth.

the class MixExUnitRunningState method execute.

@NotNull
@Override
public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
    ProcessHandler processHandler = startProcess();
    TestConsoleProperties properties = new SMTRunnerConsoleProperties(myConfiguration, TEST_FRAMEWORK_NAME, executor);
    ConsoleView console = createAndAttachConsole(TEST_FRAMEWORK_NAME, processHandler, properties);
    ElixirConsoleUtil.attachFilters(myConfiguration.getProject(), console);
    return new DefaultExecutionResult(console, processHandler, createActions(console, processHandler));
}
Also used : DefaultExecutionResult(com.intellij.execution.DefaultExecutionResult) ConsoleView(com.intellij.execution.ui.ConsoleView) ProcessHandler(com.intellij.execution.process.ProcessHandler) SMTRunnerConsoleProperties(com.intellij.execution.testframework.sm.runner.SMTRunnerConsoleProperties) TestConsoleProperties(com.intellij.execution.testframework.TestConsoleProperties) NotNull(org.jetbrains.annotations.NotNull)

Example 24 with ConsoleView

use of com.intellij.execution.ui.ConsoleView in project intellij-elixir by KronicDeth.

the class MixRunningState method execute.

@NotNull
@Override
public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
    TextConsoleBuilder consoleBuilder = new TextConsoleBuilderImpl(myConfiguration.getProject()) {

        @Override
        public ConsoleView getConsole() {
            ConsoleView consoleView = super.getConsole();
            ElixirConsoleUtil.attachFilters(myConfiguration.getProject(), consoleView);
            return consoleView;
        }
    };
    setConsoleBuilder(consoleBuilder);
    return super.execute(executor, runner);
}
Also used : TextConsoleBuilder(com.intellij.execution.filters.TextConsoleBuilder) ConsoleView(com.intellij.execution.ui.ConsoleView) TextConsoleBuilderImpl(com.intellij.execution.filters.TextConsoleBuilderImpl) NotNull(org.jetbrains.annotations.NotNull)

Example 25 with ConsoleView

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

the class DebuggerUtilsEx method addThreadDump.

public static void addThreadDump(Project project, List<ThreadState> threads, final RunnerLayoutUi ui, DebuggerSession session) {
    final TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(project);
    consoleBuilder.filters(ExceptionFilters.getFilters(session.getSearchScope()));
    final ConsoleView consoleView = consoleBuilder.getConsole();
    final DefaultActionGroup toolbarActions = new DefaultActionGroup();
    consoleView.allowHeavyFilters();
    final ThreadDumpPanel panel = new ThreadDumpPanel(project, consoleView, toolbarActions, threads);
    final String id = THREAD_DUMP_CONTENT_PREFIX + " #" + myCurrentThreadDumpId;
    final Content content = ui.createContent(id, panel, id, null, null);
    content.putUserData(RunnerContentUi.LIGHTWEIGHT_CONTENT_MARKER, Boolean.TRUE);
    content.setCloseable(true);
    content.setDescription("Thread Dump");
    ui.addContent(content);
    ui.selectAndFocus(content, true, true);
    myThreadDumpsCount++;
    myCurrentThreadDumpId++;
    Disposer.register(content, new Disposable() {

        @Override
        public void dispose() {
            myThreadDumpsCount--;
            if (myThreadDumpsCount == 0) {
                myCurrentThreadDumpId = 1;
            }
        }
    });
    Disposer.register(content, consoleView);
    ui.selectAndFocus(content, true, false);
    if (threads.size() > 0) {
        panel.selectStackFrame(0);
    }
}
Also used : Disposable(com.intellij.openapi.Disposable) TextConsoleBuilder(com.intellij.execution.filters.TextConsoleBuilder) ConsoleView(com.intellij.execution.ui.ConsoleView) Content(com.intellij.ui.content.Content) ThreadDumpPanel(com.intellij.unscramble.ThreadDumpPanel) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup)

Aggregations

ConsoleView (com.intellij.execution.ui.ConsoleView)42 NotNull (org.jetbrains.annotations.NotNull)20 ProcessHandler (com.intellij.execution.process.ProcessHandler)15 DefaultExecutionResult (com.intellij.execution.DefaultExecutionResult)9 SMTRunnerConsoleView (com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView)7 TextConsoleBuilder (com.intellij.execution.filters.TextConsoleBuilder)6 Content (com.intellij.ui.content.Content)6 ConsoleViewImpl (com.intellij.execution.impl.ConsoleViewImpl)5 ToolWindow (com.intellij.openapi.wm.ToolWindow)5 Executor (com.intellij.execution.Executor)4 TestConsoleProperties (com.intellij.execution.testframework.TestConsoleProperties)4 ToggleAutoTestAction (com.intellij.execution.testframework.autotest.ToggleAutoTestAction)4 RunContentDescriptor (com.intellij.execution.ui.RunContentDescriptor)4 Disposable (com.intellij.openapi.Disposable)4 DefaultRunExecutor (com.intellij.execution.executors.DefaultRunExecutor)3 BaseTestsOutputConsoleView (com.intellij.execution.testframework.ui.BaseTestsOutputConsoleView)3 CloseAction (com.intellij.execution.ui.actions.CloseAction)3 Project (com.intellij.openapi.project.Project)3 AndroidLogcatView (com.android.tools.idea.logcat.AndroidLogcatView)2 ExecutionException (com.intellij.execution.ExecutionException)2