|
||||||||||
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 GlobalModel
setBuildDirectory
in class AbstractGlobalModel
public DefaultInteractionsModel getInteractionsModel()
AbstractGlobalModel
getInteractionsModel
in interface GlobalModel
getInteractionsModel
in class AbstractGlobalModel
public InteractionsDJDocument getSwingInteractionsDocument()
AbstractGlobalModel
getSwingInteractionsDocument
in interface GlobalModel
getSwingInteractionsDocument
in class AbstractGlobalModel
public InteractionsDocument getInteractionsDocument()
AbstractGlobalModel
getInteractionsDocument
in interface GlobalModel
getInteractionsDocument
in class AbstractGlobalModel
public CompilerModel getCompilerModel()
getCompilerModel
in interface GlobalModel
getCompilerModel
in class AbstractGlobalModel
public JUnitModel getJUnitModel()
getJUnitModel
in interface GlobalModel
getJUnitModel
in class AbstractGlobalModel
public JavadocModel getJavadocModel()
getJavadocModel
in interface GlobalModel
getJavadocModel
in class AbstractGlobalModel
public int getNumCompErrors()
AbstractGlobalModel
getNumCompErrors
in interface GlobalModel
getNumCompErrors
in class AbstractGlobalModel
public void setNumCompErrors(int num)
AbstractGlobalModel
setNumCompErrors
in interface GlobalModel
setNumCompErrors
in class AbstractGlobalModel
public void dispose()
dispose
in interface SingleDisplayModel
dispose
in class AbstractGlobalModel
public void disposeExternalResources()
disposeExternalResources
in interface SingleDisplayModel
disposeExternalResources
in class AbstractGlobalModel
public void resetInteractions(File wd)
AbstractGlobalModel
resetInteractions
in interface GlobalModel
resetInteractions
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 GlobalModel
resetInteractions
in class AbstractGlobalModel
public void interpretCurrentInteraction()
interpretCurrentInteraction
in interface GlobalModel
interpretCurrentInteraction
in class AbstractGlobalModel
public void loadHistory(FileOpenSelector selector)
loadHistory
in interface GlobalModel
loadHistory
in class AbstractGlobalModel
public InteractionsScriptModel loadHistoryAsScript(FileOpenSelector selector) throws IOException, OperationCanceledException
loadHistoryAsScript
in interface GlobalModel
loadHistoryAsScript
in class AbstractGlobalModel
IOException
OperationCanceledException
public void clearHistory()
clearHistory
in interface GlobalModel
clearHistory
in class AbstractGlobalModel
public void saveHistory(FileSaveSelector selector) throws IOException
saveHistory
in interface GlobalModel
saveHistory
in class AbstractGlobalModel
selector
- File to save to
IOException
public void saveHistory(FileSaveSelector selector, String editedVersion) throws IOException
saveHistory
in interface GlobalModel
saveHistory
in class AbstractGlobalModel
selector
- 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.
IOException
public String getHistoryAsStringWithSemicolons()
getHistoryAsStringWithSemicolons
in interface GlobalModel
getHistoryAsStringWithSemicolons
in class AbstractGlobalModel
public String getHistoryAsString()
getHistoryAsString
in interface GlobalModel
getHistoryAsString
in class AbstractGlobalModel
public void printDebugMessage(String s)
printDebugMessage
in interface GlobalModel
printDebugMessage
in class AbstractGlobalModel
public void waitForInterpreter()
waitForInterpreter
in interface GlobalModel
waitForInterpreter
in class AbstractGlobalModel
public Iterable<File> getInteractionsClassPath()
getInteractionsClassPath
in interface GlobalModel
getInteractionsClassPath
in class AbstractGlobalModel
public Debugger getDebugger()
getDebugger
in interface GlobalModel
getDebugger
in class AbstractGlobalModel
public int getDebugPort() throws IOException
getDebugPort
in interface GlobalModel
getDebugPort
in class AbstractGlobalModel
IOException
- 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 AbstractGlobalModel
FileNotFoundException
- if file f does not exist
IOException
protected void addDocToClassPath(OpenDefinitionsDocument doc)
addDocToClassPath
in class AbstractGlobalModel
doc
- the document to add to the classpathpublic Iterable<File> getClassPath()
getClassPath
in interface GlobalModel
getClassPath
in class AbstractGlobalModel
public void resetInteractionsClassPath()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |