Package: groovy.console.ui

## [Groovy] Class Console

- groovy.console.ui.Console

- All Implemented Interfaces and Traits:
    CaretListener, HyperlinkListener, ComponentListener, FocusListener

      class Console
      extends Object

  Groovy Swing console. Allows user to interactively enter and execute Groovy.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static URL` | `ICON_PATH` |
    `static URL` | `NODE_ICON_PATH` |

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `private static String` | `DEFAULT_SCRIPT_NAME_START`
    `private Closure` | `afterExecution`
    `private boolean` | `autoClearOutput`
    `private Action` | `autoClearOutputAction`
    `private CompilerConfiguration` | `baseConfig`
    `private Closure` | `beforeExecution`
    `private Component` | `blank`
    `private static boolean` | `captureStdErr`
    `private static boolean` | `captureStdOut`
    `private int` | `colNum`
    `private Style` | `commandStyle`
    `private CompilerConfiguration` | `config`
    `private static Object` | `consoleControllers`
    `private ConsolePreferences` | `consolePreferences`
    `private Component` | `copyFromComponent`
    `private File` | `currentClasspathDir`
    `private File` | `currentClasspathJarDir`
    `private File` | `currentFileChooserDir`
    `private int` | `cursorPos`
    `private boolean` | `detachedOutput`
    `private Action` | `detachedOutputAction`
    `private boolean` | `dirty`
    `private RootPaneContainer` | `frame`
    `private static Object` | `frameConsoleDelegates`
    `private boolean` | `fullStackTraces`
    `private Action` | `fullStackTracesAction`
    `private static Object` | `groovyFileFilter`
    `private Action` | `hideOutputWindowAction1`
    `private Action` | `hideOutputWindowAction2`
    `private Action` | `hideOutputWindowAction3`
    `private Action` | `hideOutputWindowAction4`
    `private List` | `history`
    `private int` | `historyIndex`
    `private Style` | `hyperlinkStyle`
    `private boolean` | `indy`
    `private Action` | `indyAction`
    `private JTextPane` | `inputArea`
    `private int` | `inputAreaContentHash`
    `private ConsoleTextEditor` | `inputEditor`
    `private Action` | `interruptAction`
    `private boolean` | `loopMode`
    `private Action` | `loopModeAction`
    `private int` | `maxHistory`
    `private int` | `maxOutputChars`
    `private Action` | `nextHistoryAction`
    `private boolean` | `orientationVertical`
    `private Action` | `orientationVerticalAction`
    `private int` | `origDividerSize`
    `private JTextPane` | `outputArea`
    `private PrintWriter` | `outputPrintWriter`
    `private Style` | `outputStyle`
    `private Component` | `outputWindow`
    `private HistoryRecord` | `pendingRecord`
    `private Action` | `prevHistoryAction`
    `private Style` | `promptStyle`
    `private Style` | `resultStyle`
    `private Element` | `rootElement`
    `private int` | `rowNum`
    `private JLabel` | `rowNumAndColNum`
    `private Thread` | `runThread`
    `private Action` | `saveAction`
    `private boolean` | `saveOnRun`
    `private Action` | `saveOnRunAction`
    `private Object` | `scriptFile`
    `private int` | `scriptNameCounter`
    `private boolean` | `scriptRunning`
    `private Component` | `scrollArea`
    `private Action` | `selectPreviousWordAction`
    `private Action` | `selectWordAction`
    `private GroovyShell` | `shell`
    `private Action` | `showOutputWindowAction`
    `private boolean` | `showScriptInOutput`
    `private Action` | `showScriptInOutputAction`
    `private boolean` | `showToolbar`
    `private Action` | `showToolbarAction`
    `private static boolean` | `smartHighlighter`
    `private JSplitPane` | `splitPane`
    `private boolean` | `stackOverFlowError`
    `private Style` | `stacktraceStyle`
    `private JLabel` | `statusLabel`
    `private SwingBuilder` | `swing`
    `private SystemOutputInterceptor` | `systemErrorInterceptor`
    `private SystemOutputInterceptor` | `systemOutInterceptor`
    `private int` | `textSelectionEnd`
    `private int` | `textSelectionStart`
    `private boolean` | `threadInterrupt`
    `private Action` | `threadInterruptAction`
    `private Component` | `toolbar`
    `private boolean` | `useScriptClassLoaderForScriptExecution`
    `private boolean` | `visualizeScriptResults`
    `private Action` | `visualizeScriptResultsAction`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `Console (Binding binding)`
    `Console (ClassLoader parent, Binding binding, CompilerConfiguration baseConfig)`
    `Console ()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `addClasspathDir(EventObject evt)`
    `` | `void` | `addClasspathJar(EventObject evt)`
    `` | `void` | `addToHistory(Object record)`
    `` | `void` | `appendOutput(String text, AttributeSet style)`
    `` | `void` | `appendOutput(Window window, AttributeSet style)`
    `` | `void` | `appendOutput(Object object, AttributeSet style)`
    `` | `void` | `appendOutput(Component component, AttributeSet style)`
    `` | `void` | `appendOutput(Icon icon, AttributeSet style)`
    `` | `void` | `appendOutputLines(Object text, Object style)`
    `` | `void` | `appendOutputNl(Object text, Object style)`
    `` | `void` | `appendStacktrace(Object text)`
    `` | `Object` | `askToInterruptScript()`
    `` | `boolean` | `askToSaveFile()`
    `` | `void` | `autoClearOutput(EventObject evt)`
    `` | `void` | `beep()`
    `` | `void` | `bindResults()`
    `` | `static void` | `captureStdErr(EventObject evt)`
    `` | `static void` | `captureStdOut(EventObject evt)`
    `` | `void` | `caretUpdate(CaretEvent e)`
    `` | `void` | `clearContext(EventObject evt)`
    `` | `void` | `clearOutput(EventObject evt)`
    `` | `void` | `closeOutputPrintWriter()`
    `` | `void` | `comment(EventObject evt)`
    `` | `Object` | `compileFinishNormal()`
    `` | `void` | `compileScript(EventObject evt)`
    `` | `void` | `componentHidden(ComponentEvent e)`
    `` | `void` | `componentMoved(ComponentEvent e)`
    `` | `void` | `componentResized(ComponentEvent e)`
    `` | `void` | `componentShown(ComponentEvent e)`
    `` | `void` | `copy(EventObject evt)`
    `` | `void` | `createOutputPrintWriter(File outputFile)`
    `` | `void` | `cut(EventObject evt)`
    `` | `void` | `detachedOutput(EventObject evt)`
    `` | `void` | `doInterrupt(EventObject evt)`
    `` | `int` | `dot(CaretEvent e)`
    `` | `boolean` | `exit(EventObject evt)`
    `` | `void` | `exitDesktop(EventObject evt, Object quitResponse)`
    `` | `void` | `fileNewFile(EventObject evt)`
    `` | `void` | `fileNewWindow(EventObject evt)`
    `` | `void` | `fileOpen(EventObject evt)`
    `` | `boolean` | `fileSave(EventObject evt)`
    `` | `boolean` | `fileSaveAs(EventObject evt)`
    `` | `void` | `find(EventObject evt)`
    `` | `void` | `findNext(EventObject evt)`
    `` | `void` | `findPrevious(EventObject evt)`
    `` | `Object` | `finishException(Throwable t, boolean executing)`
    `` | `Object` | `finishNormal(Object result)`
    `` | `void` | `focusGained(FocusEvent e)`
    `` | `void` | `focusLost(FocusEvent e)`
    `` | `void` | `fullStackTraces(EventObject evt)`
    `` | `int` | `getConsoleId()`
    `` | `Object` | `getLastResult()`
    `` | `void` | `hideAndClearOutputWindow(EventObject evt)`
    `` | `void` | `hideOutputWindow(EventObject evt)`
    `` | `void` | `historyNext(EventObject evt)`
    `` | `void` | `historyPrev(EventObject evt)`
    `` | `void` | `hyperlinkUpdate(HyperlinkEvent e)`
    `` | `void` | `indy(EventObject evt)`
    `` | `void` | `insertString(Document doc, int offset, String text, AttributeSet attributeSet, boolean outputToFile)`
    `` | `void` | `inspectAst(EventObject evt)`
    `` | `void` | `inspectCst(EventObject evt)`
    `` | `void` | `inspectLast(EventObject evt)`
    `` | `void` | `inspectTokens(EventObject evt)`
    `` | `void` | `inspectVariables(EventObject evt)`
    `` | `void` | `installInterceptor()`
    `` | `void` | `invokeTextAction(Object evt, Object closure, Object area)`
    `` | `void` | `largerFont(EventObject evt)`
    `` | `void` | `listClasspath(EventObject evt)`
    `` | `int` | `loadMaxOutputChars()`
    `` | `void` | `loadScriptFile(File file)`
    `` | `void` | `loopMode(EventObject evt)`
    `` | `static void` | `main(Object args)`
    `` | `int` | `mark(CaretEvent e)`
    `` | `void` | `newScript(ClassLoader parent, Binding binding)`
    `` | `static boolean` | `notifySystemErr(int consoleId, String str)`
    `` | `static boolean` | `notifySystemOut(int consoleId, String str)`
    `` | `void` | `orientationVertical(EventObject evt)`
    `` | `void` | `paste(EventObject evt)`
    `` | `void` | `preferences(EventObject evt)`
    `` | `void` | `print(EventObject evt)`
    `` | `void` | `redo(EventObject evt)`
    `` | `void` | `replace(EventObject evt)`
    `` | `void` | `run()`
    `` | `void` | `run(JApplet applet)`
    `` | `void` | `run(Map defaults)`
    `` | `void` | `runScript(EventObject evt)`
    `` | `void` | `runSelectedScript(EventObject evt)`
    `` | `void` | `saveOnRun(EventObject evt)`
    `` | `void` | `selectAll(EventObject evt)`
    `` | `void` | `selectBlock(EventObject evt)`
    `` | `Object` | `selectFilename(Object name)`
    `` | `void` | `setDirty(boolean newDirty)`
    `` | `void` | `setOutputPreferences(boolean useOutputFile, File outputFile)`
    `` | `void` | `setRowNumAndColNum()`
    `` | `void` | `setVariable(String name, Object value)`
    `` | `void` | `showAbout(EventObject evt)`
    `` | `void` | `showCompilingMessage()`
    `` | `void` | `showExecutingMessage()`
    `` | `void` | `showMessage(String message)`
    `` | `void` | `showOutputWindow(EventObject evt)`
    `` | `void` | `showScriptInOutput(EventObject evt)`
    `` | `void` | `showToolbar(EventObject evt)`
    `` | `void` | `smallerFont(EventObject evt)`
    `` | `void` | `smartHighlighter(EventObject evt)`
    `` | `void` | `threadInterruption(EventObject evt)`
    `` | `void` | `undo(EventObject evt)`
    `` | `void` | `updateTitle()`
    `` | `void` | `visualizeScriptResults(EventObject evt)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Field Detail

    - #### public static URL ICON_PATH

    - #### public static URL NODE_ICON_PATH

  - ### Property Detail

    - #### private static final String DEFAULT_SCRIPT_NAME_START

    - #### private Closure afterExecution

    - #### private boolean autoClearOutput

    - #### private Action autoClearOutputAction

    - #### private CompilerConfiguration baseConfig

    - #### private Closure beforeExecution

    - #### private Component blank

    - #### private static boolean captureStdErr

    - #### private static boolean captureStdOut

    - #### private int colNum

    - #### private Style commandStyle

    - #### private CompilerConfiguration config

    - #### private static Object consoleControllers

    - #### private ConsolePreferences consolePreferences

    - #### private Component copyFromComponent

    - #### private File currentClasspathDir

    - #### private File currentClasspathJarDir

    - #### private File currentFileChooserDir

    - #### private int cursorPos

    - #### private boolean detachedOutput

    - #### private Action detachedOutputAction

    - #### private boolean dirty

    - #### private RootPaneContainer frame

    - #### private static Object frameConsoleDelegates

    - #### private boolean fullStackTraces

    - #### private Action fullStackTracesAction

    - #### private static Object groovyFileFilter

    - #### private Action hideOutputWindowAction1

    - #### private Action hideOutputWindowAction2

    - #### private Action hideOutputWindowAction3

    - #### private Action hideOutputWindowAction4

    - #### private List history

    - #### private int historyIndex

    - #### private Style hyperlinkStyle

    - #### private boolean indy

    - #### private Action indyAction

    - #### private JTextPane inputArea

    - #### private int inputAreaContentHash

    - #### private ConsoleTextEditor inputEditor

    - #### private Action interruptAction

    - #### private boolean loopMode

    - #### private Action loopModeAction

    - #### private int maxHistory

    - #### private int maxOutputChars

    - #### private Action nextHistoryAction

    - #### private boolean orientationVertical

    - #### private Action orientationVerticalAction

    - #### private int origDividerSize

    - #### private JTextPane outputArea

    - #### private PrintWriter outputPrintWriter

    - #### private Style outputStyle

    - #### private Component outputWindow

    - #### private HistoryRecord pendingRecord

    - #### private Action prevHistoryAction

    - #### private Style promptStyle

    - #### private Style resultStyle

    - #### private Element rootElement

    - #### private int rowNum

    - #### private JLabel rowNumAndColNum

    - #### private Thread runThread

    - #### private Action saveAction

    - #### private boolean saveOnRun

    - #### private Action saveOnRunAction

    - #### private Object scriptFile

    - #### private int scriptNameCounter

    - #### private boolean scriptRunning

    - #### private Component scrollArea

    - #### private Action selectPreviousWordAction

    - #### private Action selectWordAction

    - #### private GroovyShell shell

    - #### private Action showOutputWindowAction

    - #### private boolean showScriptInOutput

    - #### private Action showScriptInOutputAction

    - #### private boolean showToolbar

    - #### private Action showToolbarAction

    - #### private static boolean smartHighlighter

    - #### private JSplitPane splitPane

    - #### private boolean stackOverFlowError

    - #### private Style stacktraceStyle

    - #### private JLabel statusLabel

    - #### private SwingBuilder swing

    - #### private SystemOutputInterceptor systemErrorInterceptor

    - #### private SystemOutputInterceptor systemOutInterceptor

    - #### private int textSelectionEnd

    - #### private int textSelectionStart

    - #### private boolean threadInterrupt

    - #### private Action threadInterruptAction

    - #### private Component toolbar

    - #### private boolean useScriptClassLoaderForScriptExecution

    - #### private boolean visualizeScriptResults

    - #### private Action visualizeScriptResultsAction

  - ### Constructor Detail

    - #### Console(Binding binding)

    - #### Console(ClassLoader parent, Binding binding, CompilerConfiguration baseConfig)

    - #### Console()

  - ### Method Detail

    - #### void addClasspathDir(EventObject evt)

    - #### void addClasspathJar(EventObject evt)

    - #### void addToHistory(Object record)

    - #### void appendOutput(String text, AttributeSet style)

    - #### void appendOutput(Window window, AttributeSet style)

    - #### void appendOutput(Object object, AttributeSet style)

    - #### void appendOutput(Component component, AttributeSet style)

    - #### void appendOutput(Icon icon, AttributeSet style)

    - #### void appendOutputLines(Object text, Object style)

    - #### void appendOutputNl(Object text, Object style)

    - #### void appendStacktrace(Object text)

    - #### Object askToInterruptScript()

    - #### boolean askToSaveFile()

    - #### void autoClearOutput(EventObject evt)

    - #### void beep()

    - #### void bindResults()

    - #### static void captureStdErr(EventObject evt)

    - #### static void captureStdOut(EventObject evt)

    - #### void caretUpdate(CaretEvent e)

    - #### void clearContext(EventObject evt)

    - #### void clearOutput(EventObject evt)

    - #### void closeOutputPrintWriter()

    - #### void comment(EventObject evt)

    - #### Object compileFinishNormal()

    - #### void compileScript(EventObject evt)

    - #### void componentHidden(ComponentEvent e)

    - #### void componentMoved(ComponentEvent e)

    - #### void componentResized(ComponentEvent e)

    - #### void componentShown(ComponentEvent e)

    - #### void copy(EventObject evt)

    - #### void createOutputPrintWriter(File outputFile)

    - #### void cut(EventObject evt)

    - #### void detachedOutput(EventObject evt)

    - #### void doInterrupt(EventObject evt)

    - #### @CompileStaticCompileStatic int dot(CaretEvent e)

    - #### boolean exit(EventObject evt)

    - #### void exitDesktop(EventObject evt, Object quitResponse)

    - #### void fileNewFile(EventObject evt)

    - #### void fileNewWindow(EventObject evt)

    - #### void fileOpen(EventObject evt)

    - #### boolean fileSave(EventObject evt)

    - #### boolean fileSaveAs(EventObject evt)

    - #### void find(EventObject evt)

    - #### void findNext(EventObject evt)

    - #### void findPrevious(EventObject evt)

    - #### Object finishException(Throwable t, boolean executing)

    - #### Object finishNormal(Object result)

    - #### void focusGained(FocusEvent e)

    - #### void focusLost(FocusEvent e)

    - #### void fullStackTraces(EventObject evt)

    - #### int getConsoleId()

    - #### Object getLastResult()

    - #### void hideAndClearOutputWindow(EventObject evt)

    - #### void hideOutputWindow(EventObject evt)

    - #### void historyNext(EventObject evt)

    - #### void historyPrev(EventObject evt)

    - #### void hyperlinkUpdate(HyperlinkEvent e)

    - #### void indy(EventObject evt)

    - #### void insertString(Document doc, int offset, String text, AttributeSet attributeSet, boolean outputToFile)

    - #### void inspectAst(EventObject evt)

    - #### @CompileStaticCompileStatic void inspectCst(EventObject evt)

    - #### void inspectLast(EventObject evt)

    - #### void inspectTokens(EventObject evt)

    - #### void inspectVariables(EventObject evt)

    - #### void installInterceptor()

    - #### void invokeTextAction(Object evt, Object closure, Object area)

    - #### void largerFont(EventObject evt)

    - #### void listClasspath(EventObject evt)

    - #### int loadMaxOutputChars()

    - #### void loadScriptFile(File file)

    - #### void loopMode(EventObject evt)

    - #### static void main(Object args)

    - #### @CompileStaticCompileStatic int mark(CaretEvent e)

    - #### void newScript(ClassLoader parent, Binding binding)

    - #### static boolean notifySystemErr(int consoleId, String str)

    - #### static boolean notifySystemOut(int consoleId, String str)

    - #### void orientationVertical(EventObject evt)

    - #### void paste(EventObject evt)

    - #### void preferences(EventObject evt)

    - #### void print(EventObject evt)

    - #### void redo(EventObject evt)

    - #### void replace(EventObject evt)

    - #### void run()

    - #### @DeprecatedDeprecated void run(JApplet applet)

    - #### void run(Map defaults)

    - #### void runScript(EventObject evt)

    - #### void runSelectedScript(EventObject evt)

    - #### void saveOnRun(EventObject evt)

    - #### void selectAll(EventObject evt)

    - #### void selectBlock(EventObject evt)

    - #### Object selectFilename(Object name)

    - #### void setDirty(boolean newDirty)

    - #### void setOutputPreferences(boolean useOutputFile, File outputFile)

    - #### void setRowNumAndColNum()

    - #### void setVariable(String name, Object value)

    - #### void showAbout(EventObject evt)

    - #### void showCompilingMessage()

    - #### void showExecutingMessage()

    - #### void showMessage(String message)

    - #### void showOutputWindow(EventObject evt)

    - #### void showScriptInOutput(EventObject evt)

    - #### void showToolbar(EventObject evt)

    - #### void smallerFont(EventObject evt)

    - #### void smartHighlighter(EventObject evt)

    - #### void threadInterruption(EventObject evt)

    - #### void undo(EventObject evt)

    - #### void updateTitle()

    - #### void visualizeScriptResults(EventObject evt)