Class CommonTerminalExecutionConsole

  • All Implemented Interfaces:
    com.intellij.execution.ui.ConsoleView, com.intellij.execution.ui.ExecutionConsole, com.intellij.execution.ui.ObservableConsoleView, com.intellij.openapi.Disposable, com.intellij.openapi.ui.ComponentContainer

    public class CommonTerminalExecutionConsole
    extends java.lang.Object
    implements com.intellij.execution.ui.ConsoleView, com.intellij.execution.ui.ObservableConsoleView
    This class is similar to the TerminalExecutionConsole class by JetBrains (v. 2019.3) with the difference that can support multiple processes and print their outputs in one tab. TerminalExecutionConsole could not be extended due to its private AppendableTerminalDataStream and `printText(@NotNull String text, @Nullable ConsoleViewContentType contentType)` method which prevented to change the behavior of the terminal from the extender. This class recreates the whole terminalWidgets and streams to customize their behavior.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.intellij.openapi.Disposable

        com.intellij.openapi.Disposable.Parent
      • Nested classes/interfaces inherited from interface com.intellij.execution.ui.ObservableConsoleView

        com.intellij.execution.ui.ObservableConsoleView.ChangeListener
    • Field Summary

      • Fields inherited from interface com.intellij.execution.ui.ExecutionConsole

        CONSOLE_CONTENT_ID
    • Constructor Summary

      Constructors 
      Constructor Description
      CommonTerminalExecutionConsole​(@NotNull com.intellij.openapi.project.Project project, @Nullable com.intellij.execution.process.ProcessHandler processHandler, java.lang.String tabTitle)  
    • Constructor Detail

      • CommonTerminalExecutionConsole

        public CommonTerminalExecutionConsole​(@NotNull
                                              @NotNull com.intellij.openapi.project.Project project,
                                              @Nullable
                                              @Nullable com.intellij.execution.process.ProcessHandler processHandler,
                                              java.lang.String tabTitle)
    • Method Detail

      • withEnterKeyDefaultCodeEnabled

        @NotNull
        public @NotNull CommonTerminalExecutionConsole withEnterKeyDefaultCodeEnabled​(boolean enterKeyDefaultCodeEnabled)
      • addMessageFilter

        @ScheduledForRemoval(inVersion="2020.3")
        @Deprecated
        public void addMessageFilter​(com.intellij.openapi.project.Project project,
                                     com.intellij.execution.filters.Filter filter)
        Deprecated.
        Parameters:
        project - the project
        filter - the filter to use
      • print

        public void print​(@NotNull
                          @NotNull java.lang.String text,
                          @NotNull
                          @NotNull com.intellij.execution.ui.ConsoleViewContentType contentType)
        Specified by:
        print in interface com.intellij.execution.ui.ConsoleView
      • clear

        public void clear()
        Clears history and screen buffers, positions the cursor at the top left corner.
        Specified by:
        clear in interface com.intellij.execution.ui.ConsoleView
      • scrollTo

        public void scrollTo​(int offset)
        Specified by:
        scrollTo in interface com.intellij.execution.ui.ConsoleView
      • attachToProcess

        public void attachToProcess​(com.intellij.execution.process.ProcessHandler processHandler)
        Specified by:
        attachToProcess in interface com.intellij.execution.ui.ConsoleView
      • attachToProcess

        protected final void attachToProcess​(@NotNull
                                             @NotNull com.intellij.execution.process.ProcessHandler processHandler,
                                             boolean attachToProcessOutput)
        Parameters:
        processHandler - ProcessHandler instance wrapping underlying PtyProcess
        attachToProcessOutput - true if process output should be printed in the console, false if output printing is managed externally, e.g. by testing console BaseTestsOutputConsoleView
      • setOutputPaused

        public void setOutputPaused​(boolean value)
        Specified by:
        setOutputPaused in interface com.intellij.execution.ui.ConsoleView
      • isOutputPaused

        public boolean isOutputPaused()
        Specified by:
        isOutputPaused in interface com.intellij.execution.ui.ConsoleView
      • hasDeferredOutput

        public boolean hasDeferredOutput()
        Specified by:
        hasDeferredOutput in interface com.intellij.execution.ui.ConsoleView
      • performWhenNoDeferredOutput

        public void performWhenNoDeferredOutput​(@NotNull
                                                @NotNull java.lang.Runnable runnable)
        Specified by:
        performWhenNoDeferredOutput in interface com.intellij.execution.ui.ConsoleView
      • setHelpId

        public void setHelpId​(@NotNull
                              @NotNull java.lang.String helpId)
        Specified by:
        setHelpId in interface com.intellij.execution.ui.ConsoleView
      • addMessageFilter

        public void addMessageFilter​(@NotNull
                                     @NotNull com.intellij.execution.filters.Filter filter)
        Specified by:
        addMessageFilter in interface com.intellij.execution.ui.ConsoleView
      • printHyperlink

        public void printHyperlink​(@NotNull
                                   @NotNull java.lang.String hyperlinkText,
                                   @Nullable
                                   @Nullable com.intellij.execution.filters.HyperlinkInfo info)
        Specified by:
        printHyperlink in interface com.intellij.execution.ui.ConsoleView
      • getContentSize

        public int getContentSize()
        Specified by:
        getContentSize in interface com.intellij.execution.ui.ConsoleView
      • canPause

        public boolean canPause()
        Specified by:
        canPause in interface com.intellij.execution.ui.ConsoleView
      • detachConsoleActions

        @Deprecated
        @NotNull
        @ScheduledForRemoval(inVersion="2020.3")
        public @NotNull com.intellij.openapi.actionSystem.AnAction[] detachConsoleActions​(boolean prependSeparatorIfNonEmpty)
        Deprecated.
      • createConsoleActions

        @NotNull
        public @NotNull com.intellij.openapi.actionSystem.AnAction[] createConsoleActions()
        Specified by:
        createConsoleActions in interface com.intellij.execution.ui.ConsoleView
      • allowHeavyFilters

        public void allowHeavyFilters()
        Specified by:
        allowHeavyFilters in interface com.intellij.execution.ui.ConsoleView
      • getComponent

        public javax.swing.JComponent getComponent()
        Specified by:
        getComponent in interface com.intellij.openapi.ui.ComponentContainer
      • getPreferredFocusableComponent

        public javax.swing.JComponent getPreferredFocusableComponent()
        Specified by:
        getPreferredFocusableComponent in interface com.intellij.openapi.ui.ComponentContainer
      • dispose

        public void dispose()
        Specified by:
        dispose in interface com.intellij.openapi.Disposable
      • isAcceptable

        public static boolean isAcceptable​(@NotNull
                                           @NotNull com.intellij.execution.process.ProcessHandler processHandler)
      • addChangeListener

        public void addChangeListener​(@NotNull
                                      com.intellij.execution.ui.ObservableConsoleView.ChangeListener listener,
                                      @NotNull
                                      @NotNull com.intellij.openapi.Disposable parent)
        Specified by:
        addChangeListener in interface com.intellij.execution.ui.ObservableConsoleView