|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.model.AbstractGlobalModel
edu.rice.cs.drjava.model.DefaultGlobalModel
public class DefaultGlobalModel
Handles the bulk of DrJava's program logic. The UI components interface with the GlobalModel through its public methods, and the GlobalModel responds via the GlobalModelListener interface. This removes the dependency on the UI for the logical flow of the program's features. With the current implementation, we can finally test the compile functionality of DrJava, along with many other things.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface edu.rice.cs.drjava.config.OptionConstants |
|---|
OptionConstants.AccessLevelChoices, OptionConstants.DefaultFont, OptionConstants.HeapSizeChoices, OptionConstants.LookAndFeels, OptionConstants.PlasticThemes, OptionConstants.VersionNotificationChoices |
| Field Summary | |
|---|---|
protected InteractionsDJDocument |
_interactionsDocument
The document used in the Interactions model. |
protected InteractionsListener |
_interactionsListener
Core listener attached to interactions model |
protected DefaultInteractionsModel |
_interactionsModel
Interface between the InteractionsDocument and the JavaInterpreter, which runs in a separate JVM. |
protected JavadocModel |
_javadocModel
Manages all Javadoc functionality. |
| Fields inherited from class edu.rice.cs.drjava.model.AbstractGlobalModel |
|---|
_bookmarkManager, _breakpointManager, _browserHistoryManager, _cache, _consoleDoc, _consoleDocAdapter, _documentNavigator, _editorKit, _findResultsManagers, _log, _notifier, _pageFormat, _state, DIFF_THRESHOLD, WRITE_DELAY |
| Fields inherited from interface edu.rice.cs.drjava.model.GlobalModel |
|---|
RUNTIME_CLASS_PATH |
| Constructor Summary | |
|---|---|
DefaultGlobalModel()
Constructs a new GlobalModel. |
|
| Method Summary | |
|---|---|
protected edu.rice.cs.drjava.model.DefaultGlobalModel.ConcreteOpenDefDoc |
_createOpenDefinitionsDocument(File f)
Creates a ConcreteOpenDefDoc for a given file f |
protected edu.rice.cs.drjava.model.DefaultGlobalModel.ConcreteOpenDefDoc |
_createOpenDefinitionsDocument(NullFile f)
Creates a ConcreteOpenDefDoc for a new DefinitionsDocument. |
protected void |
addDocToClassPath(OpenDefinitionsDocument doc)
Adds the source root for doc to the interactions classpath; this function is a helper to _openFiles. |
void |
clearHistory()
Clears the interactions history |
void |
dispose()
Prepares this model to be thrown away. |
void |
disposeExternalResources()
Disposes of external resources. |
Iterable<File> |
getClassPath()
Get the class path to be used in all class-related operations. |
CompilerModel |
getCompilerModel()
Gets the CompilerModel, which provides all methods relating to compilers. |
Debugger |
getDebugger()
Gets the Debugger used by DrJava. |
int |
getDebugPort()
Returns an available port number to use for debugging the interactions JVM. |
String |
getHistoryAsString()
Returns the entire history as a String. |
String |
getHistoryAsStringWithSemicolons()
Returns the entire history as a String with semicolons as needed. |
Iterable<File> |
getInteractionsClassPath()
Returns the current classpath in use by the Interpreter JVM. |
InteractionsDocument |
getInteractionsDocument()
throws UnsupportedOperationException |
DefaultInteractionsModel |
getInteractionsModel()
throws UnsupportedOperationException |
JavadocModel |
getJavadocModel()
Gets the JavadocModel, which provides all methods relating to Javadoc. |
JUnitModel |
getJUnitModel()
Gets the JUnitModel, which provides all methods relating to JUnit testing. |
int |
getNumCompErrors()
throws UnsupportedOperationException |
InteractionsDJDocument |
getSwingInteractionsDocument()
throws UnsupportedOperationException |
void |
interpretCurrentInteraction()
Interprets the current given text at the prompt in the interactions pane. |
void |
loadHistory(FileOpenSelector selector)
Interprets file selected in the FileOpenSelector. |
InteractionsScriptModel |
loadHistoryAsScript(FileOpenSelector selector)
Loads the history/histories from the given selector. |
void |
printDebugMessage(String s)
Called when the debugger wants to print a message. |
void |
resetInteractions(File wd)
A degenerate operation since this has no slave JVM and no interactions model. |
void |
resetInteractions(File wd,
boolean forceReset)
Clears and resets the slave JVM with working directory wd. |
void |
resetInteractionsClassPath()
Adds the project root (if a project is open), the source roots for other open documents, the paths in the "extra classpath" config option, as well as any project-specific classpaths to the interpreter's classpath. |
void |
saveHistory(FileSaveSelector selector)
Saves the unedited version of the current history to a file |
void |
saveHistory(FileSaveSelector selector,
String editedVersion)
Saves the edited version of the current history to a file |
void |
setBuildDirectory(File f)
Sets the build directory for a project. |
void |
setNumCompErrors(int num)
throws UnsupportedOperationException |
void |
waitForInterpreter()
Blocks until the interpreter has registered. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final InteractionsDJDocument _interactionsDocument
protected final DefaultInteractionsModel _interactionsModel
protected InteractionsListener _interactionsListener
protected volatile JavadocModel _javadocModel
| Constructor Detail |
|---|
public DefaultGlobalModel()
| Method Detail |
|---|
public void setBuildDirectory(File f)
setBuildDirectory in interface GlobalModelsetBuildDirectory in class AbstractGlobalModelpublic DefaultInteractionsModel getInteractionsModel()
AbstractGlobalModel
getInteractionsModel in interface GlobalModelgetInteractionsModel in class AbstractGlobalModelpublic InteractionsDJDocument getSwingInteractionsDocument()
AbstractGlobalModel
getSwingInteractionsDocument in interface GlobalModelgetSwingInteractionsDocument in class AbstractGlobalModelpublic InteractionsDocument getInteractionsDocument()
AbstractGlobalModel
getInteractionsDocument in interface GlobalModelgetInteractionsDocument in class AbstractGlobalModelpublic CompilerModel getCompilerModel()
getCompilerModel in interface GlobalModelgetCompilerModel in class AbstractGlobalModelpublic JUnitModel getJUnitModel()
getJUnitModel in interface GlobalModelgetJUnitModel in class AbstractGlobalModelpublic JavadocModel getJavadocModel()
getJavadocModel in interface GlobalModelgetJavadocModel in class AbstractGlobalModelpublic int getNumCompErrors()
AbstractGlobalModel
getNumCompErrors in interface GlobalModelgetNumCompErrors in class AbstractGlobalModelpublic void setNumCompErrors(int num)
AbstractGlobalModel
setNumCompErrors in interface GlobalModelsetNumCompErrors in class AbstractGlobalModelpublic void dispose()
dispose in interface SingleDisplayModeldispose in class AbstractGlobalModelpublic void disposeExternalResources()
disposeExternalResources in interface SingleDisplayModeldisposeExternalResources in class AbstractGlobalModelpublic void resetInteractions(File wd)
AbstractGlobalModel
resetInteractions in interface GlobalModelresetInteractions in class AbstractGlobalModel
public void resetInteractions(File wd,
boolean forceReset)
wd matches its working directory, and forceReset is false. wd may be null
if a valid directory cannot be determined. In that case, the former working directory is used. This
method may run outside the event thread.
resetInteractions in interface GlobalModelresetInteractions in class AbstractGlobalModelpublic void interpretCurrentInteraction()
interpretCurrentInteraction in interface GlobalModelinterpretCurrentInteraction in class AbstractGlobalModelpublic void loadHistory(FileOpenSelector selector)
loadHistory in interface GlobalModelloadHistory in class AbstractGlobalModel
public InteractionsScriptModel loadHistoryAsScript(FileOpenSelector selector)
throws IOException,
OperationCanceledException
loadHistoryAsScript in interface GlobalModelloadHistoryAsScript in class AbstractGlobalModelIOException
OperationCanceledExceptionpublic void clearHistory()
clearHistory in interface GlobalModelclearHistory in class AbstractGlobalModel
public void saveHistory(FileSaveSelector selector)
throws IOException
saveHistory in interface GlobalModelsaveHistory in class AbstractGlobalModelselector - File to save to
IOException
public void saveHistory(FileSaveSelector selector,
String editedVersion)
throws IOException
saveHistory in interface GlobalModelsaveHistory in class AbstractGlobalModelselector - File to save toeditedVersion - Edited verison of the history which will be saved to file instead of the lines saved in
the history. The saved file will still include any tags needed to recognize it as a history file.
IOExceptionpublic String getHistoryAsStringWithSemicolons()
getHistoryAsStringWithSemicolons in interface GlobalModelgetHistoryAsStringWithSemicolons in class AbstractGlobalModelpublic String getHistoryAsString()
getHistoryAsString in interface GlobalModelgetHistoryAsString in class AbstractGlobalModelpublic void printDebugMessage(String s)
printDebugMessage in interface GlobalModelprintDebugMessage in class AbstractGlobalModelpublic void waitForInterpreter()
waitForInterpreter in interface GlobalModelwaitForInterpreter in class AbstractGlobalModelpublic Iterable<File> getInteractionsClassPath()
getInteractionsClassPath in interface GlobalModelgetInteractionsClassPath in class AbstractGlobalModelpublic Debugger getDebugger()
getDebugger in interface GlobalModelgetDebugger in class AbstractGlobalModel
public int getDebugPort()
throws IOException
getDebugPort in interface GlobalModelgetDebugPort in class AbstractGlobalModelIOException - if unable to get a valid port number.protected edu.rice.cs.drjava.model.DefaultGlobalModel.ConcreteOpenDefDoc _createOpenDefinitionsDocument(NullFile f)
_createOpenDefinitionsDocument in class AbstractGlobalModel
protected edu.rice.cs.drjava.model.DefaultGlobalModel.ConcreteOpenDefDoc _createOpenDefinitionsDocument(File f)
throws IOException
_createOpenDefinitionsDocument in class AbstractGlobalModelFileNotFoundException - if file f does not exist
IOExceptionprotected void addDocToClassPath(OpenDefinitionsDocument doc)
addDocToClassPath in class AbstractGlobalModeldoc - the document to add to the classpathpublic Iterable<File> getClassPath()
getClassPath in interface GlobalModelgetClassPath in class AbstractGlobalModelpublic void resetInteractionsClassPath()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||