Search in sources :

Example 16 with ConsoleView

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

the class OutgoingCodePointerLocalMessage method createConsoleMessage.

public ConsoleMessage createConsoleMessage(User user) {
    return new OwnConsoleMessage(user, StringUtil.getMsg("code.pointer"), getWhen()) {

        public void printMessage(Project project, ConsoleView console) {
            final IDEAFacade ideFacade = (IDEAFacade) Pico.getInstance().getComponentInstanceOfType(IDEFacade.class);
            IncomingCodePointerMessage printer = new IncomingCodePointerMessage(myEvent, ideFacade);
            printer.outputMessage(console);
        }
    };
}
Also used : Project(com.intellij.openapi.project.Project) IncomingCodePointerMessage(jetbrains.communicator.idea.codePointer.IncomingCodePointerMessage) ConsoleView(com.intellij.execution.ui.ConsoleView) OwnConsoleMessage(jetbrains.communicator.idea.messagesWindow.OwnConsoleMessage) IDEFacade(jetbrains.communicator.ide.IDEFacade)

Example 17 with ConsoleView

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

the class DartPubActionBase method showPubOutputConsole.

private static void showPubOutputConsole(@NotNull final Module module, @NotNull final GeneralCommandLine command, @NotNull final OSProcessHandler processHandler, @NotNull final VirtualFile pubspecYamlFile, @NotNull final String actionTitle) {
    final ConsoleView console;
    PubToolWindowContentInfo info = findExistingInfoForCommand(module.getProject(), command);
    if (info != null) {
        // rerunning the same pub command in the same tool window tab (corresponding tool window action invoked)
        console = info.console;
        console.clear();
    } else {
        console = createConsole(module.getProject(), pubspecYamlFile);
        info = new PubToolWindowContentInfo(module, pubspecYamlFile, command, actionTitle, console);
        final ActionToolbar actionToolbar = createToolWindowActionsBar(info);
        final SimpleToolWindowPanel toolWindowPanel = new SimpleToolWindowPanel(false, true);
        toolWindowPanel.setContent(console.getComponent());
        toolWindowPanel.setToolbar(actionToolbar.getComponent());
        final Content content = ContentFactory.SERVICE.getInstance().createContent(toolWindowPanel.getComponent(), actionTitle, true);
        content.putUserData(PUB_TOOL_WINDOW_CONTENT_INFO_KEY, info);
        Disposer.register(content, console);
        final ContentManager contentManager = MessageView.SERVICE.getInstance(module.getProject()).getContentManager();
        removeOldTabs(contentManager);
        contentManager.addContent(content);
        contentManager.setSelectedContent(content);
        final ToolWindow toolWindow = ToolWindowManager.getInstance(module.getProject()).getToolWindow(ToolWindowId.MESSAGES_WINDOW);
        toolWindow.activate(null, true);
    }
    info.rerunPubCommandAction.setProcessHandler(processHandler);
    info.stopProcessAction.setProcessHandler(processHandler);
    processHandler.addProcessListener(new ProcessAdapter() {

        @Override
        public void processTerminated(final ProcessEvent event) {
            console.print(IdeBundle.message("finished.with.exit.code.text.message", event.getExitCode()), ConsoleViewContentType.SYSTEM_OUTPUT);
        }
    });
    console.print(DartBundle.message("working.dir.0", FileUtil.toSystemDependentName(pubspecYamlFile.getParent().getPath())) + "\n", ConsoleViewContentType.SYSTEM_OUTPUT);
    console.attachToProcess(processHandler);
    processHandler.startNotify();
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) ProcessAdapter(com.intellij.execution.process.ProcessAdapter) ConsoleView(com.intellij.execution.ui.ConsoleView) ProcessEvent(com.intellij.execution.process.ProcessEvent) Content(com.intellij.ui.content.Content) ContentManager(com.intellij.ui.content.ContentManager) SimpleToolWindowPanel(com.intellij.openapi.ui.SimpleToolWindowPanel)

Example 18 with ConsoleView

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

the class DartTestRunningState method execute.

@Override
@NotNull
public ExecutionResult execute(@NotNull final Executor executor, @NotNull final ProgramRunner runner) throws ExecutionException {
    final ProcessHandler processHandler = startProcess();
    final ConsoleView consoleView = createConsole(getEnvironment());
    consoleView.attachToProcess(processHandler);
    final DefaultExecutionResult executionResult = new DefaultExecutionResult(consoleView, processHandler, createActions(consoleView, processHandler, executor));
    if (ActionManager.getInstance().getAction("RerunFailedTests") != null) {
        DartConsoleProperties properties = (DartConsoleProperties) ((SMTRunnerConsoleView) consoleView).getProperties();
        AbstractRerunFailedTestsAction rerunFailedTestsAction = properties.createRerunFailedTestsAction(consoleView);
        assert rerunFailedTestsAction != null;
        rerunFailedTestsAction.setModelProvider(((SMTRunnerConsoleView) consoleView)::getResultsViewer);
        executionResult.setRestartActions(rerunFailedTestsAction, new ToggleAutoTestAction());
    } else {
        executionResult.setRestartActions(new ToggleAutoTestAction());
    }
    return executionResult;
}
Also used : DefaultExecutionResult(com.intellij.execution.DefaultExecutionResult) SMTRunnerConsoleView(com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView) ConsoleView(com.intellij.execution.ui.ConsoleView) ProcessHandler(com.intellij.execution.process.ProcessHandler) AbstractRerunFailedTestsAction(com.intellij.execution.testframework.actions.AbstractRerunFailedTestsAction) ToggleAutoTestAction(com.intellij.execution.testframework.autotest.ToggleAutoTestAction) NotNull(org.jetbrains.annotations.NotNull)

Example 19 with ConsoleView

use of com.intellij.execution.ui.ConsoleView in project Intellij-Plugin by getgauge.

the class GaugeCommandLineState method execute.

@NotNull
@Override
public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
    if (GaugeVersion.isGreaterOrEqual(GaugeRunConfiguration.TEST_RUNNER_SUPPORT_VERSION, false) && GaugeSettingsService.getSettings().useIntelliJTestRunner()) {
        ProcessHandler handler = startProcess();
        GaugeConsoleProperties properties = new GaugeConsoleProperties(config, "Gauge", executor, handler);
        ConsoleView console = SMTestRunnerConnectionUtil.createAndAttachConsole("Gauge", handler, properties);
        DefaultExecutionResult result = new DefaultExecutionResult(console, handler, createActions(console, handler));
        if (ActionManager.getInstance().getAction("RerunFailedTests") != null) {
            AbstractRerunFailedTestsAction action = properties.createRerunFailedTestsAction(console);
            if (action != null) {
                action.setModelProvider(((SMTRunnerConsoleView) console)::getResultsViewer);
                result.setRestartActions(action);
            }
        }
        return result;
    }
    return super.execute(executor, runner);
}
Also used : DefaultExecutionResult(com.intellij.execution.DefaultExecutionResult) SMTRunnerConsoleView(com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView) ConsoleView(com.intellij.execution.ui.ConsoleView) GaugeConsoleProperties(com.thoughtworks.gauge.execution.runner.GaugeConsoleProperties) ProcessHandler(com.intellij.execution.process.ProcessHandler) AbstractRerunFailedTestsAction(com.intellij.execution.testframework.actions.AbstractRerunFailedTestsAction) NotNull(org.jetbrains.annotations.NotNull)

Example 20 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)

Aggregations

ConsoleView (com.intellij.execution.ui.ConsoleView)43 NotNull (org.jetbrains.annotations.NotNull)21 ProcessHandler (com.intellij.execution.process.ProcessHandler)16 DefaultExecutionResult (com.intellij.execution.DefaultExecutionResult)10 SMTRunnerConsoleView (com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView)8 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 AbstractRerunFailedTestsAction (com.intellij.execution.testframework.actions.AbstractRerunFailedTestsAction)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