|
||||||||||
| 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.RMIInteractionsModel
edu.rice.cs.drjava.plugins.eclipse.repl.EclipseInteractionsModel
public class EclipseInteractionsModel
Interactions model which can notify GlobalModelListeners on events.
| Field Summary | |
|---|---|
protected LinkedList<InteractionsListener> |
_listeners
List of listeners to this document. |
protected boolean |
_warnedToReset
Whether we have already warned the user to reset after a compilation occurs. |
protected static int |
HISTORY_SIZE
Number of lines to remember in the history |
static File |
WORKING_DIR
|
protected static int |
WRITE_DELAY
Milliseconds to wait after each println |
| Fields inherited from class edu.rice.cs.drjava.model.repl.RMIInteractionsModel |
|---|
_jvm |
| Fields inherited from class edu.rice.cs.drjava.model.repl.InteractionsModel |
|---|
_cDoc, _document, _inputListener, _lastError, _notifier, _pane, _secondToLastError, _waitingForFirstInterpreter, _workingDirectory, _writerLock, BANNER_PREFIX |
| Constructor Summary | |
|---|---|
EclipseInteractionsModel(MainJVM control,
SWTDocumentAdapter adapter)
Creates a new InteractionsModel. |
|
EclipseInteractionsModel(SWTDocumentAdapter adapter)
Creates a new InteractionsModel with a new MainJVM. |
|
| Method Summary | |
|---|---|
protected void |
_addChangeListener()
Adds a listener to Eclipse for any changes to Java projects. |
protected void |
_interpreterResetFailed(Throwable t)
Any extra action to perform (beyond notifying listeners) when the interpreter fails to reset. |
protected boolean |
_isCompilationUnit(org.eclipse.jdt.core.IJavaElement element)
Returns whether the given element is a compilation unit and not a working copy. |
protected void |
_notifyInteractionEnded()
Notifies listeners that an interaction has ended. |
protected void |
_notifyInteractionIncomplete()
Notifies the view that the current interaction is incomplete. |
void |
_notifyInteractionStarted()
Notifies listeners that an interaction has started. |
protected void |
_notifyInterpreterChanged(boolean inProgress)
Notifies listeners that the interpreter has changed. |
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 |
_notifySlaveJVMUsed()
Notifies listeners that the slave JVM has been used. |
protected void |
_notifySyntaxErrorOccurred(int offset,
int length)
Notifies listeners that an error was present in the interaction. |
protected void |
_resetInteractionsClasspath()
Adds each project's classpath to the Interactions pane. |
protected void |
_resetInterpreter(File wd)
Resets the warning flag after the Interactions Pane is reset. |
protected void |
_visitDelta(org.eclipse.jdt.core.IJavaElementDelta delta,
int depth)
Walks the tree of deltas, looking for changes to the classpath or compilation units. |
protected void |
_warnUserToReset()
Prints a message warning the user to reset the Interactions Pane once a compilation has occurred. |
void |
addBuildDirectoryClassPath(String path)
|
void |
addInteractionsListener(InteractionsListener l)
Adds a listener to this model. |
void |
addProjectFilesClassPath(String path)
|
void |
addToClassPath(String path)
|
void |
dispose()
Cleans up any resources this model created, including the Interactions JVM. |
Iterable<File> |
getClassPath()
Gets the interpreter classpath from the interpreter jvm. |
ConsoleDocument |
getConsoleDocument()
Gets the console tab document for this interactions model |
void |
interpreterReady(File wd)
Called when the Java interpreter is ready to use. |
void |
removeAllInteractionsListeners()
Removes all listeners from this model. |
void |
removeInteractionsListener(InteractionsListener l)
Removes the given listener from this model. |
void |
setOptionArgs(String optionArgString)
Sets the optional command-line arguments to the interpreter JVM. |
void |
setPrivateAccessible(boolean allow)
Sets whether to allow access to private members in the interactions pane. |
URL |
toURL(String path)
|
| Methods inherited from class edu.rice.cs.drjava.model.repl.RMIInteractionsModel |
|---|
_interpret, addBuildDirectoryClassPath, addExternalFilesClassPath, addExtraClassPath, addInterpreter, addProjectClassPath, addProjectFilesClassPath, enableRestart, getVariableToString, getVariableType, removeInterpreter, setActiveInterpreter, setToDefaultInterpreter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int HISTORY_SIZE
protected static final int WRITE_DELAY
public static final File WORKING_DIR
protected final LinkedList<InteractionsListener> _listeners
protected boolean _warnedToReset
| Constructor Detail |
|---|
public EclipseInteractionsModel(SWTDocumentAdapter adapter)
adapter - SWTDocumentAdapter to use for the document
public EclipseInteractionsModel(MainJVM control,
SWTDocumentAdapter adapter)
control - RMI interface to the Interpreter JVMadapter - SWTDocumentAdapter to use for the document| Method Detail |
|---|
public void dispose()
public Iterable<File> getClassPath()
RMIInteractionsModel
getClassPath in class RMIInteractionsModelpublic void addInteractionsListener(InteractionsListener l)
public void removeInteractionsListener(InteractionsListener l)
public void removeAllInteractionsListeners()
protected void _interpreterResetFailed(Throwable t)
_interpreterResetFailed in class InteractionsModelt - The Throwable thrown by System.exitpublic void interpreterReady(File wd)
interpreterReady in interface InteractionsModelCallbackinterpreterReady in class InteractionsModelprotected void _resetInterpreter(File wd)
_resetInterpreter in class RMIInteractionsModelpublic 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 _notifyInterpreterChanged(boolean inProgress)
_notifyInterpreterChanged in class RMIInteractionsModelinProgress - Whether the new interpreter is currently in progress.protected void _notifyInteractionIncomplete()
_notifyInteractionIncomplete in class InteractionsModelprotected void _notifySlaveJVMUsed()
_notifySlaveJVMUsed in class InteractionsModelprotected void _resetInteractionsClasspath()
protected void _warnUserToReset()
protected void _addChangeListener()
public URL toURL(String path)
public void addBuildDirectoryClassPath(String path)
public void addProjectFilesClassPath(String path)
public void addToClassPath(String path)
protected void _visitDelta(org.eclipse.jdt.core.IJavaElementDelta delta,
int depth)
delta - Tree to searchdepth - Current depth of original tree. Pass 0 on the first call.protected boolean _isCompilationUnit(org.eclipse.jdt.core.IJavaElement element)
element - JavaElement in questionpublic void setPrivateAccessible(boolean allow)
setPrivateAccessible in class RMIInteractionsModelallow - true iff access should be allowedpublic void setOptionArgs(String optionArgString)
public ConsoleDocument getConsoleDocument()
getConsoleDocument in class InteractionsModel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||