|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.model.repl.InteractionsModel
edu.rice.cs.drjava.model.repl.SimpleInteractionsModel
public class SimpleInteractionsModel
A simple implementation of InteractionsModel, which uses a DynamicJavaAdapter directly (in the same JVM) to interpret code. It can be used in a standalone interface, such as edu.rice.cs.drjava.ui.SimpleInteractionsWindow.
| Field Summary | |
|---|---|
protected ClassPathManager |
_classPathManager
|
protected Interpreter |
_interpreter
|
protected InteractionsPaneOptions |
_interpreterOptions
|
| Fields inherited from class edu.rice.cs.drjava.model.repl.InteractionsModel |
|---|
_autoImportSet, _cDoc, _document, _inputListener, _lastError, _notifier, _pane, _secondToLastError, _waitingForFirstInterpreter, _workingDirectory, _writerLock, BANNER_PREFIX, WRITE_DELAY |
| Constructor Summary | |
|---|---|
SimpleInteractionsModel()
Creates a new InteractionsModel using a InteractionsDJDocument. |
|
SimpleInteractionsModel(InteractionsDJDocument document)
Creates a new InteractionsModel with the given document adapter. |
|
| Method Summary | |
|---|---|
protected void |
_interpret(String toEval)
Interprets the given command. |
protected void |
_interpreterResetFailed(Throwable t)
Any extra action to perform (beyond notifying listeners) when the interpreter fails to reset. |
protected void |
_interpreterWontStart(Exception e)
Action to perform when the interpreter won't start. |
protected void |
_notifyInteractionEnded()
Notifies listeners that an interaction has ended. |
protected void |
_notifyInteractionIncomplete()
Notifies listeners that the interperaction was incomplete. |
void |
_notifyInteractionStarted()
Notifies listeners that an interaction has started. |
protected void |
_notifyInterpreterExited(int status)
Notifies listeners that the interpreter has exited unexpectedly. |
void |
_notifyInterpreterReady(File wd)
Notifies listeners that the interpreter is ready. |
protected void |
_notifyInterpreterResetFailed(Throwable t)
Notifies listeners that the interpreter reset failed. |
protected void |
_notifyInterpreterResetting()
Notifies listeners that the interpreter is resetting. |
protected void |
_notifySyntaxErrorOccurred(int offset,
int length)
Notifies listeners that an interaction contained a syntax error. |
protected void |
_resetInterpreter(File wd,
boolean force)
Resets the Java interpreter. |
void |
addBuildDirectoryClassPath(File path)
Adds the given path to the interpreter's classpath. |
void |
addExternalFilesClassPath(File path)
Adds the given path to the interpreter's classpath. |
void |
addExtraClassPath(File path)
Adds the given path to the interpreter's classpath. |
void |
addProjectClassPath(File path)
Adds the given path to the interpreter's classpath. |
void |
addProjectFilesClassPath(File path)
Adds the given path to the interpreter's classpath. |
List<File> |
getCompilerBootClassPath()
A compiler can instruct DrJava to include additional elements for the boot class path of the Interactions JVM. |
ConsoleDocument |
getConsoleDocument()
Returns null because console tab document is not supported in this model |
Pair<String,String> |
getVariableToString(String var)
Gets the string representation of the value of a variable in the current interpreter. |
void |
setEnforceAllAccess(boolean enforce)
Sets whether or not the interpreter should enforce access to all members. |
void |
setEnforcePrivateAccess(boolean enforce)
Sets whether or not the interpreter should enforce access to private members. |
void |
setRequireSemicolon(boolean require)
Require a semicolon at the end of statements. |
void |
setRequireVariableType(boolean require)
Require variable declarations to include an explicit type. |
String |
transformCommands(String interactionsString)
Transform the command line to be interpreted into something the Interactions JVM can use. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ClassPathManager _classPathManager
protected Interpreter _interpreter
protected final InteractionsPaneOptions _interpreterOptions
| Constructor Detail |
|---|
public SimpleInteractionsModel()
public SimpleInteractionsModel(InteractionsDJDocument document)
document - Toolkit-independent document adapter| Method Detail |
|---|
protected void _interpret(String toEval)
_interpret in class InteractionsModeltoEval - command to be evaluatedpublic Pair<String,String> getVariableToString(String var)
getVariableToString in class InteractionsModelvar - the name of the variable
null if the variable is not defined.public void addProjectClassPath(File path)
addProjectClassPath in class InteractionsModelpath - Path to addpublic void addBuildDirectoryClassPath(File path)
addBuildDirectoryClassPath in class InteractionsModelpath - Path to addpublic void addProjectFilesClassPath(File path)
addProjectFilesClassPath in class InteractionsModelpath - Path to addpublic void addExternalFilesClassPath(File path)
addExternalFilesClassPath in class InteractionsModelpath - Path to addpublic void addExtraClassPath(File path)
addExtraClassPath in class InteractionsModelpath - Path to addpublic void setEnforceAllAccess(boolean enforce)
public void setEnforcePrivateAccess(boolean enforce)
public void setRequireSemicolon(boolean require)
public void setRequireVariableType(boolean require)
protected void _interpreterResetFailed(Throwable t)
_interpreterResetFailed in class InteractionsModelt - The Throwable thrown by System.exitprotected void _interpreterWontStart(Exception e)
InteractionsModel
_interpreterWontStart in class InteractionsModel
protected void _resetInterpreter(File wd,
boolean force)
_resetInterpreter in class InteractionsModelpublic void _notifyInteractionStarted()
_notifyInteractionStarted in class InteractionsModelprotected void _notifyInteractionEnded()
_notifyInteractionEnded in class InteractionsModel
protected void _notifySyntaxErrorOccurred(int offset,
int length)
_notifySyntaxErrorOccurred in class InteractionsModeloffset - the first character of the error in the InteractionsDocumentlength - the length of the error.protected void _notifyInterpreterResetting()
_notifyInterpreterResetting in class InteractionsModelpublic void _notifyInterpreterReady(File wd)
_notifyInterpreterReady in class InteractionsModelprotected void _notifyInterpreterExited(int status)
_notifyInterpreterExited in class InteractionsModelstatus - Status code of the dead processprotected void _notifyInterpreterResetFailed(Throwable t)
_notifyInterpreterResetFailed in class InteractionsModelt - Throwable explaining why the reset failed.protected void _notifyInteractionIncomplete()
_notifyInteractionIncomplete in class InteractionsModelpublic ConsoleDocument getConsoleDocument()
getConsoleDocument in class InteractionsModelpublic List<File> getCompilerBootClassPath()
public String transformCommands(String interactionsString)
interactionsString - unprocessed command line
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||