Overview | Package | Class | Deprecated | Index | Help
| Groovy 1.7.10
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD

## groovy.ui
[Groovy] Class Console

    java.lang.Object
      groovy.ui.Console

All Implemented Interfaces:
  CaretListener, HyperlinkListener, ComponentListener, FocusListener

    class Console
    extends Object

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

Authors:
  Danno Ferrin
  Dierk Koenig, changed Layout, included Selection sensitivity, included ObjectBrowser
  Alan Green more features: history, System.out capture, bind result to _
  Guillaume Laforge, stacktrace hyperlinking to the current script line
  Hamlet D'Arcy, AST browser
  Roshan Dawrani
  Paul King

Version:
  \$Id: Console.groovy 21493 2011-02-06 07:21:30Z paulk \$

Field Summary
`static String` | `ICON_PATH`
`static String` | `NODE_ICON_PATH`

Property Summary
`static String` | `DEFAULT_SCRIPT_NAME_START`
`Closure` | `afterExecution`
`boolean` | `autoClearOutput`
`Action` | `autoClearOutputAction`
`Closure` | `beforeExecution`
`Component` | `blank`
`static boolean` | `captureStdErr`
`static boolean` | `captureStdOut`
`int` | `colNum`
`Style` | `commandStyle`
`static def` | `consoleControllers`
`Component` | `copyFromComponent`
`File` | `currentClasspathDir`
`File` | `currentClasspathJarDir`
`File` | `currentFileChooserDir`
`int` | `cursorPos`
`boolean` | `detachedOutput`
`Action` | `detachedOutputAction`
`boolean` | `dirty`
`RootPaneContainer` | `frame`
`static def` | `frameConsoleDelegates`
`boolean` | `fullStackTraces`
`Action` | `fullStackTracesAction`
`Action` | `hideOutputWindowAction1`
`Action` | `hideOutputWindowAction2`
`Action` | `hideOutputWindowAction3`
`Action` | `hideOutputWindowAction4`
`List` | `history`
`int` | `historyIndex`
`Style` | `hyperlinkStyle`
`JTextPane` | `inputArea`
`ConsoleTextEditor` | `inputEditor`
`Action` | `interruptAction`
`int` | `maxHistory`
`int` | `maxOutputChars`
`Action` | `nextHistoryAction`
`int` | `origDividerSize`
`JTextPane` | `outputArea`
`Style` | `outputStyle`
`Component` | `outputWindow`
`HistoryRecord` | `pendingRecord`
`Action` | `prevHistoryAction`
`Style` | `promptStyle`
`Style` | `resultStyle`
`Element` | `rootElement`
`int` | `rowNum`
`JLabel` | `rowNumAndColNum`
`Thread` | `runThread`
`Action` | `saveAction`
`def` | `scriptFile`
`int` | `scriptNameCounter`
`Component` | `scrollArea`
`GroovyShell` | `shell`
`Action` | `showOutputWindowAction`
`boolean` | `showScriptInOutput`
`Action` | `showScriptInOutputAction`
`boolean` | `showToolbar`
`Action` | `showToolbarAction`
`JSplitPane` | `splitPane`
`Style` | `stacktraceStyle`
`JLabel` | `statusLabel`
`SwingBuilder` | `swing`
`SystemOutputInterceptor` | `systemErrorInterceptor`
`SystemOutputInterceptor` | `systemOutInterceptor`
`int` | `textSelectionEnd`
`int` | `textSelectionStart`
`Component` | `toolbar`
`boolean` | `visualizeScriptResults`
`Action` | `visualizeScriptResultsAction`

Constructor Summary
`Console()`
`Console(Binding binding)`
`Console(ClassLoader parent)`
`Console(ClassLoader parent, Binding binding)`

Method Summary
`void` | `addClasspathDir(EventObject evt = null)`
`void` | `addClasspathJar(EventObject evt = null)`
`void` | `addToHistory(def 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(def text, def style)`
`void` | `appendOutputNl(def text, def style)`
`void` | `appendStacktrace(def text)`
`def` | `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 = null)`
`void` | `clearOutput(EventObject evt = null)`
`def` | `compileFinishNormal()`
`void` | `compileScript(EventObject evt = null)`
`void` | `componentHidden(ComponentEvent e)`
`void` | `componentMoved(ComponentEvent e)`
`void` | `componentResized(ComponentEvent e)`
`void` | `componentShown(ComponentEvent e)`
`void` | `copy(EventObject evt = null)`
`void` | `cut(EventObject evt = null)`
`void` | `detachedOutput(EventObject evt)`
`void` | `doInterrupt(EventObject evt = null)`
`void` | `exit(EventObject evt = null)`
`void` | `fileNewFile(EventObject evt = null)`
`void` | `fileNewWindow(EventObject evt = null)`
`void` | `fileOpen(EventObject evt = null)`
`boolean` | `fileSave(EventObject evt = null)`
`boolean` | `fileSaveAs(EventObject evt = null)`
`void` | `find(EventObject evt = null)`
`void` | `findNext(EventObject evt = null)`
`void` | `findPrevious(EventObject evt = null)`
`def` | `finishException(Throwable t, boolean executing)`
`def` | `finishNormal(Object result)`
`void` | `focusGained(FocusEvent e)`
`void` | `focusLost(FocusEvent e)`
`void` | `fullStackTraces(EventObject evt)`
`def` | `getLastResult()`
`void` | `hideAndClearOutputWindow(EventObject evt = null)`
`void` | `hideOutputWindow(EventObject evt = null)`
`void` | `historyNext(EventObject evt = null)`
`void` | `historyPrev(EventObject evt = null)`
`void` | `hyperlinkUpdate(HyperlinkEvent e)`
`void` | `inspectAst(EventObject evt = null)`
`void` | `inspectLast(EventObject evt = null)`
`void` | `inspectVariables(EventObject evt = null)`
`void` | `installInterceptor()`
`void` | `invokeTextAction(def evt, def closure, def area = inputArea)`
`void` | `largerFont(EventObject evt = null)`
`void` | `loadScriptFile(File file)`
`static void` | `main(def args)`
`void` | `newScript(ClassLoader parent, Binding binding)`
`static boolean` | `notifySystemErr(String str)`
`static boolean` | `notifySystemOut(String str)`
`void` | `paste(EventObject evt = null)`
`void` | `print(EventObject evt = null)`
`void` | `redo(EventObject evt = null)`
`void` | `replace(EventObject evt = null)`
`void` | `run()`
`void` | `run(JApplet applet)`
`void` | `run(Map defaults)`
`void` | `runScript(EventObject evt = null)`
`void` | `runSelectedScript(EventObject evt = null)`
`void` | `selectAll(EventObject evt = null)`
`def` | `selectFilename(def name = "Open")`
`void` | `setDirty(boolean newDirty)`
`void` | `setRowNumAndColNum()`
`void` | `setVariable(String name, Object value)`
`void` | `showAbout(EventObject evt = null)`
`void` | `showCompilingMessage()`
`void` | `showExecutingMessage()`
`void` | `showMessage(String message)`
`void` | `showOutputWindow(EventObject evt = null)`
`void` | `showScriptInOutput(EventObject evt)`
`void` | `showToolbar(EventObject evt)`
`void` | `smallerFont(EventObject evt = null)`
`void` | `undo(EventObject evt = null)`
`void` | `updateTitle()`
`void` | `visualizeScriptResults(EventObject evt)`

Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll

Field Detail

### ICON_PATH

    public static String ICON_PATH

### NODE_ICON_PATH

    public static String NODE_ICON_PATH

Property Detail

### DEFAULT_SCRIPT_NAME_START

    static final String DEFAULT_SCRIPT_NAME_START

### afterExecution

    Closure afterExecution

### autoClearOutput

    boolean autoClearOutput

### autoClearOutputAction

    Action autoClearOutputAction

### beforeExecution

    Closure beforeExecution

### blank

    Component blank

### captureStdErr

    static boolean captureStdErr

### captureStdOut

    static boolean captureStdOut

### colNum

    int colNum

### commandStyle

    Style commandStyle

### consoleControllers

    static def consoleControllers

### copyFromComponent

    Component copyFromComponent

### currentClasspathDir

    File currentClasspathDir

### currentClasspathJarDir

    File currentClasspathJarDir

### currentFileChooserDir

    File currentFileChooserDir

### cursorPos

    int cursorPos

### detachedOutput

    boolean detachedOutput

### detachedOutputAction

    Action detachedOutputAction

### dirty

    boolean dirty

### frame

    RootPaneContainer frame

### frameConsoleDelegates

    static def frameConsoleDelegates

### fullStackTraces

    boolean fullStackTraces

### fullStackTracesAction

    Action fullStackTracesAction

### hideOutputWindowAction1

    Action hideOutputWindowAction1

### hideOutputWindowAction2

    Action hideOutputWindowAction2

### hideOutputWindowAction3

    Action hideOutputWindowAction3

### hideOutputWindowAction4

    Action hideOutputWindowAction4

### history

    List history

### historyIndex

    int historyIndex

### hyperlinkStyle

    Style hyperlinkStyle

### inputArea

    JTextPane inputArea

### inputEditor

    ConsoleTextEditor inputEditor

### interruptAction

    Action interruptAction

### maxHistory

    int maxHistory

### maxOutputChars

    int maxOutputChars

### nextHistoryAction

    Action nextHistoryAction

### origDividerSize

    int origDividerSize

### outputArea

    JTextPane outputArea

### outputStyle

    Style outputStyle

### outputWindow

    Component outputWindow

### pendingRecord

    HistoryRecord pendingRecord

### prevHistoryAction

    Action prevHistoryAction

### promptStyle

    Style promptStyle

### resultStyle

    Style resultStyle

### rootElement

    Element rootElement

### rowNum

    int rowNum

### rowNumAndColNum

    JLabel rowNumAndColNum

### runThread

    Thread runThread

### saveAction

    Action saveAction

### scriptFile

    def scriptFile

### scriptNameCounter

    int scriptNameCounter

### scrollArea

    Component scrollArea

### shell

    GroovyShell shell

### showOutputWindowAction

    Action showOutputWindowAction

### showScriptInOutput

    boolean showScriptInOutput

### showScriptInOutputAction

    Action showScriptInOutputAction

### showToolbar

    boolean showToolbar

### showToolbarAction

    Action showToolbarAction

### splitPane

    JSplitPane splitPane

### stacktraceStyle

    Style stacktraceStyle

### statusLabel

    JLabel statusLabel

### swing

    SwingBuilder swing

### systemErrorInterceptor

    SystemOutputInterceptor systemErrorInterceptor

### systemOutInterceptor

    SystemOutputInterceptor systemOutInterceptor

### textSelectionEnd

    int textSelectionEnd

### textSelectionStart

    int textSelectionStart

### toolbar

    Component toolbar

### visualizeScriptResults

    boolean visualizeScriptResults

### visualizeScriptResultsAction

    Action visualizeScriptResultsAction

Constructor Detail

### Console

    Console()

### Console

    Console(Binding binding)

### Console

    Console(ClassLoader parent)

### Console

    Console(ClassLoader parent, Binding binding)

Method Detail

### addClasspathDir

    void addClasspathDir(EventObject evt = null)

### addClasspathJar

    void addClasspathJar(EventObject evt = null)

### addToHistory

    void addToHistory(def record)

### appendOutput

    void appendOutput(String text, AttributeSet style)

### appendOutput

    void appendOutput(Window window, AttributeSet style)

### appendOutput

    void appendOutput(Object object, AttributeSet style)

### appendOutput

    void appendOutput(Component component, AttributeSet style)

### appendOutput

    void appendOutput(Icon icon, AttributeSet style)

### appendOutputLines

    void appendOutputLines(def text, def style)

### appendOutputNl

    void appendOutputNl(def text, def style)

### appendStacktrace

    void appendStacktrace(def text)

### askToInterruptScript

    def askToInterruptScript()

### askToSaveFile

    boolean askToSaveFile()

### autoClearOutput

    void autoClearOutput(EventObject evt)

### beep

    void beep()

### bindResults

    void bindResults()

### captureStdErr

    static void captureStdErr(EventObject evt)

### captureStdOut

    static void captureStdOut(EventObject evt)

### caretUpdate

    void caretUpdate(CaretEvent e)

### clearContext

    void clearContext(EventObject evt = null)

### clearOutput

    void clearOutput(EventObject evt = null)

### compileFinishNormal

    def compileFinishNormal()

### compileScript

    void compileScript(EventObject evt = null)

### componentHidden

    void componentHidden(ComponentEvent e)

### componentMoved

    void componentMoved(ComponentEvent e)

### componentResized

    void componentResized(ComponentEvent e)

### componentShown

    void componentShown(ComponentEvent e)

### copy

    void copy(EventObject evt = null)

### cut

    void cut(EventObject evt = null)

### detachedOutput

    void detachedOutput(EventObject evt)

### doInterrupt

    void doInterrupt(EventObject evt = null)

### exit

    void exit(EventObject evt = null)

### fileNewFile

    void fileNewFile(EventObject evt = null)

### fileNewWindow

    void fileNewWindow(EventObject evt = null)

### fileOpen

    void fileOpen(EventObject evt = null)

### fileSave

    boolean fileSave(EventObject evt = null)

### fileSaveAs

    boolean fileSaveAs(EventObject evt = null)

### find

    void find(EventObject evt = null)

### findNext

    void findNext(EventObject evt = null)

### findPrevious

    void findPrevious(EventObject evt = null)

### finishException

    def finishException(Throwable t, boolean executing)

### finishNormal

    def finishNormal(Object result)

### focusGained

    void focusGained(FocusEvent e)

### focusLost

    void focusLost(FocusEvent e)

### fullStackTraces

    void fullStackTraces(EventObject evt)

### getLastResult

    def getLastResult()

### hideAndClearOutputWindow

    void hideAndClearOutputWindow(EventObject evt = null)

### hideOutputWindow

    void hideOutputWindow(EventObject evt = null)

### historyNext

    void historyNext(EventObject evt = null)

### historyPrev

    void historyPrev(EventObject evt = null)

### hyperlinkUpdate

    void hyperlinkUpdate(HyperlinkEvent e)

### inspectAst

    void inspectAst(EventObject evt = null)

### inspectLast

    void inspectLast(EventObject evt = null)

### inspectVariables

    void inspectVariables(EventObject evt = null)

### installInterceptor

    void installInterceptor()

### invokeTextAction

    void invokeTextAction(def evt, def closure, def area = inputArea)

### largerFont

    void largerFont(EventObject evt = null)

### loadScriptFile

    void loadScriptFile(File file)

### main

    static void main(def args)

### newScript

    void newScript(ClassLoader parent, Binding binding)

### notifySystemErr

    static boolean notifySystemErr(String str)

### notifySystemOut

    static boolean notifySystemOut(String str)

### paste

    void paste(EventObject evt = null)

### print

    void print(EventObject evt = null)

### redo

    void redo(EventObject evt = null)

### replace

    void replace(EventObject evt = null)

### run

    void run()

### run

    void run(JApplet applet)

### run

    void run(Map defaults)

### runScript

    void runScript(EventObject evt = null)

### runSelectedScript

    void runSelectedScript(EventObject evt = null)

### selectAll

    void selectAll(EventObject evt = null)

### selectFilename

    def selectFilename(def name = "Open")

### setDirty

    void setDirty(boolean newDirty)

### setRowNumAndColNum

    void setRowNumAndColNum()

### setVariable

    void setVariable(String name, Object value)

### showAbout

    void showAbout(EventObject evt = null)

### showCompilingMessage

    void showCompilingMessage()

### showExecutingMessage

    void showExecutingMessage()

### showMessage

    void showMessage(String message)

### showOutputWindow

    void showOutputWindow(EventObject evt = null)

### showScriptInOutput

    void showScriptInOutput(EventObject evt)

### showToolbar

    void showToolbar(EventObject evt)

### smallerFont

    void smallerFont(EventObject evt = null)

### undo

    void undo(EventObject evt = null)

### updateTitle

    void updateTitle()

### visualizeScriptResults

    void visualizeScriptResults(EventObject evt)

Copyright © 2003-2010 The Codehaus. All rights reserved.