Public Member Functions | |
DefaultInterpreter (JConsole console, BSFEngine engine) | |
Creates a new instance of DefaultInterpreter. | |
DefaultInterpreter (JConsole console, BSFEngine engine, NameCompleter name) | |
JConsole | getConsole () |
String | toString () |
List | completeName (String curCmd) |
Invoked when we need to complete a name. | |
void | exec (String s, String source, int row, int column) |
Executes the string. | |
void | exec (String s) |
void | actionPerformed (ActionEvent e) |
Invoked when an action occurs. | |
Protected Member Functions | |
boolean | printObject (Object val) |
Should be overridden to return false when executing a line that returns void. | |
boolean | startBlock (String line) |
Returns true if this line starts a block. | |
boolean | endBlock (String line) |
Return true if this line ends a block. | |
boolean | continueLine (String line) |
Default behaviour is to see if line ends with a line continuation character. | |
int | nestLevel () |
void | incIndent () |
Prints an indent - helpful for the user when typing in blocks. | |
void | decIndent () |
void | setIndent (int level) |
void | printStartMaterial () |
Prints the initial blurb you see Sub-classes should override to tell the user how to get the help text at least. | |
void | printHelp () |
Prints some help for the user. | |
void | consoleCommand (String command) |
Executes a console command The string should include the initial char. | |
void | loadFile (String file) |
Load the contents of file and execute them. | |
Protected Attributes | |
JConsole | console |
BSFEngine | engine |
NameCompleter | completer |
String | defaultPath |
String | consoleCommandString = "." |
char | endCommandChar = '\n' |
char | lineContinueChar = '\\' |
char | blockStartChar = '{' |
char | blockEndChar = '}' |
Private Attributes | |
int | nestLevel = 0 |
StringBuffer | buffered = new StringBuffer() |
It would use the GUIConsole interface from bsh except the interface doesn't have half the methods of JConsole! So we just use JConsole directly for now. This is less likely to need sub-classing, but you never know!
Most of what this class does is sit in a loop trying to read from the console input stream. It also provides some useful functions that it processes rather than passing them to the underlying scripting engine
Definition at line 28 of file DefaultInterpreter.java.
|
Invoked when we need to complete a name. Do some minimal filtering and pass it onto the NameCompleter objects. Implements GuiComponents.Console.NameCompletionListener. Definition at line 185 of file DefaultInterpreter.java. References GuiComponents.scripting.NameCompleter.completeName(). |
Here is the call graph for this function:
|
Should be overridden to return false when executing a line that returns void. Note, should always return false if the return value is null Reimplemented in GuiComponents.scripting.BeanShellInterpreter. Definition at line 68 of file DefaultInterpreter.java. Referenced by GuiComponents.scripting.JythonInterpreter.exec(), and GuiComponents.scripting.DefaultInterpreter.exec(). |