public abstract class ConsoleSupport
extends Object
Base support class for consoles that evaluate Groovy scripts and render styled output.
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected void |
addStylesToDocument(JTextPane outputArea)Initializes the styles used by the output document. |
|
protected Object |
evaluate(String text)Evaluates the supplied text and delegates failures to handleException(String, Exception). |
|
public Style |
getCommandStyle()Returns the style used for entered commands. |
|
public Style |
getOutputStyle()Returns the style used for evaluated output. |
|
public Style |
getPromptStyle()Returns the style used for prompts. |
|
public GroovyShell |
getShell()Returns the shell used for script evaluation. |
|
protected abstract void |
handleException(String text, Exception e)Handles an exception raised while evaluating the supplied script text. |
Initializes the styles used by the output document.
outputArea - text pane whose styled document should be configuredEvaluates the supplied text and delegates failures to handleException(String, Exception).
text - script text to evaluatenull when evaluation failsReturns the style used for entered commands.
Returns the style used for evaluated output.
Returns the style used for prompts.
Returns the shell used for script evaluation.