| |
|
| java.lang.Object edu.rice.cs.drjava.model.AbstractGlobalModel edu.rice.cs.drjava.model.DefaultGlobalModel
DefaultGlobalModel | public class DefaultGlobalModel extends AbstractGlobalModel (Code) | | 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.
version: $Id: DefaultGlobalModel.java 4268 2007-11-29 00:52:17Z mgricken $ |
_interactionsModel | final protected DefaultInteractionsModel _interactionsModel(Code) | | Interface between the InteractionsDocument and the JavaInterpreter, which runs in a separate JVM.
|
_javadocModel | protected volatile JavadocModel _javadocModel(Code) | | Manages all Javadoc functionality.
|
_jvm | final MainJVM _jvm(Code) | | RMI interface to the Interactions JVM.
|
DefaultGlobalModel | public DefaultGlobalModel()(Code) | | Constructs a new GlobalModel. Creates a new MainJVM and starts its Interpreter JVM.
|
_createOpenDefinitionsDocument | protected ConcreteOpenDefDoc _createOpenDefinitionsDocument(NullFile f)(Code) | | Creates a ConcreteOpenDefDoc for a new DefinitionsDocument.
OpenDefinitionsDocument object for a new document |
_createOpenDefinitionsDocument | protected ConcreteOpenDefDoc _createOpenDefinitionsDocument(File f) throws IOException(Code) | | Creates a ConcreteOpenDefDoc for a given file f
OpenDefinitionsDocument object for f |
addDocToClassPath | protected void addDocToClassPath(OpenDefinitionsDocument doc)(Code) | | Adds the source root for doc to the interactions classpath; this function is a helper to _openFiles.
Parameters: doc - the document to add to the classpath |
clearHistory | public void clearHistory()(Code) | | Clears the interactions history
|
dispose | public void dispose()(Code) | | Prepares this model to be thrown away. Never called in practice outside of quit(), except in tests.
|
disposeExternalResources | public void disposeExternalResources()(Code) | | Disposes of external resources. Kills the slave JVM.
|
getClassPath | public Iterable<File> getClassPath()(Code) | | Get the class path to be used in all class-related operations.
TODO: Insure that this is used wherever appropriate.
|
getCompilerModel | public CompilerModel getCompilerModel()(Code) | | Gets the CompilerModel, which provides all methods relating to compilers.
|
getDebugPort | public int getDebugPort() throws IOException(Code) | | Returns an available port number to use for debugging the interactions JVM.
throws: IOException - if unable to get a valid port number. |
getDebugger | public Debugger getDebugger()(Code) | | Gets the Debugger used by DrJava.
|
getHistoryAsString | public String getHistoryAsString()(Code) | | Returns the entire history as a String.
|
getHistoryAsStringWithSemicolons | public String getHistoryAsStringWithSemicolons()(Code) | | Returns the entire history as a String with semicolons as needed.
|
getInteractionsClassPath | public Iterable<File> getInteractionsClassPath()(Code) | | Returns the current classpath in use by the Interpreter JVM.
|
getJUnitModel | public JUnitModel getJUnitModel()(Code) | | Gets the JUnitModel, which provides all methods relating to JUnit testing.
|
getJavadocModel | public JavadocModel getJavadocModel()(Code) | | Gets the JavadocModel, which provides all methods relating to Javadoc.
|
getNumCompErrors | public int getNumCompErrors()(Code) | | |
getSwingInteractionsDocument | public InteractionsDJDocument getSwingInteractionsDocument()(Code) | | InteractionsDJDocument in use by the InteractionsDocument. |
interpretCurrentInteraction | public void interpretCurrentInteraction()(Code) | | Interprets the current given text at the prompt in the interactions pane.
|
loadHistory | public void loadHistory(FileOpenSelector selector) throws IOException(Code) | | Interprets file selected in the FileOpenSelector. Assumes strings have no trailing whitespace. Interpretation is
aborted after the first error.
|
printDebugMessage | public void printDebugMessage(String s)(Code) | | Called when the debugger wants to print a message. Inserts a newline.
|
resetInteractions | public void resetInteractions(File wd)(Code) | | |
resetInteractions | public void resetInteractions(File wd, boolean forceReset)(Code) | | Clears and resets the slave JVM with working directory wd. Also clears the console if the option is
indicated (on by default). The reset operation is suppressed if the existing slave JVM has not been
used,
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.
|
resetInteractionsClassPath | public void resetInteractionsClassPath()(Code) | | 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.
This method is called in DefaultInteractionsModel when the interpreter becomes ready.
|
saveHistory | public void saveHistory(FileSaveSelector selector) throws IOException(Code) | | Saves the unedited version of the current history to a file
Parameters: selector - File to save to |
saveHistory | public void saveHistory(FileSaveSelector selector, String editedVersion) throws IOException(Code) | | Saves the edited version of the current history to a file
Parameters: selector - File to save to Parameters: editedVersion - 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. |
setBuildDirectory | public void setBuildDirectory(File f)(Code) | | Sets the build directory for a project.
|
setNumCompErrors | public void setNumCompErrors(int num)(Code) | | |
setResetAfterCompile | void setResetAfterCompile(boolean shouldReset)(Code) | | Sets whether or not the Interactions JVM will be reset after a compilation succeeds. This should ONLY be used
in tests! This method is not supported by AbstractGlobalModel.
Parameters: shouldReset - Whether to reset after compiling |
waitForInterpreter | public void waitForInterpreter()(Code) | | Blocks until the interpreter has registered.
|
Methods inherited from edu.rice.cs.drjava.model.AbstractGlobalModel | protected ConcreteOpenDefDoc _createOpenDefinitionsDocument(NullFile f)(Code)(Java Doc) protected ConcreteOpenDefDoc _createOpenDefinitionsDocument(File f) throws IOException(Code)(Java Doc) protected void _docAppend(ConsoleDocument doc, String s, String style)(Code)(Java Doc) protected OpenDefinitionsDocument _getOpenDocument(File file)(Code)(Java Doc) public ProjectProfile _makeProjectProfile(File file, Hashtable<OpenDefinitionsDocument, DocumentInfoGetter> info) throws IOException(Code)(Java Doc) public OpenDefinitionsDocument _openFile(File file) throws IOException, AlreadyOpenException(Code)(Java Doc) public void aboutToSaveFromSaveAll(OpenDefinitionsDocument doc)(Code)(Java Doc) public void addAuxiliaryFile(OpenDefinitionsDocument doc)(Code)(Java Doc) protected void addDocToClassPath(OpenDefinitionsDocument doc)(Code)(Java Doc) protected void addDocToNavigator(OpenDefinitionsDocument doc)(Code)(Java Doc) public void addListener(GlobalModelListener listener)(Code)(Java Doc) public void addToBrowserHistory()(Code)(Java Doc) public void cleanBuildDirectory()(Code)(Java Doc) public void clearHistory()(Code)(Java Doc) public boolean closeAllFiles()(Code)(Java Doc) public boolean closeAllFilesOnQuit()(Code)(Java Doc) public boolean closeFile(OpenDefinitionsDocument doc)(Code)(Java Doc) protected boolean closeFileHelper(OpenDefinitionsDocument doc)(Code)(Java Doc) public boolean closeFileWithoutPrompt(OpenDefinitionsDocument doc)(Code)(Java Doc) public boolean closeFiles(List<OpenDefinitionsDocument> docs)(Code)(Java Doc) public void closeProject(boolean suppressReset)(Code)(Java Doc) public void configNewProject() throws IOException(Code)(Java Doc) public RegionManager<MovingDocumentRegion> createFindResultsManager()(Code)(Java Doc) public void createNewProject(File projFile)(Code)(Java Doc) public void dispose()(Code)(Java Doc) public void disposeExternalResources()(Code)(Java Doc) public void disposeFindResultsManager(RegionManager<MovingDocumentRegion> rm)(Code)(Java Doc) public File findFileInPaths(String fileName, Iterable<File> paths)(Code)(Java Doc) public String fixPathForNavigator(String path) throws IOException(Code)(Java Doc) public void forceQuit()(Code)(Java Doc) public OpenDefinitionsDocument getActiveDocument()(Code)(Java Doc) public String getAuxiliaryBinTitle()(Code)(Java Doc) public List<OpenDefinitionsDocument> getAuxiliaryDocuments()(Code)(Java Doc) public RegionManager<DocumentRegion> getBookmarkManager()(Code)(Java Doc) public RegionManager<Breakpoint> getBreakpointManager()(Code)(Java Doc) public RegionManager<DocumentRegion> getBrowserHistoryManager()(Code)(Java Doc) public File getBuildDirectory()(Code)(Java Doc) public List<File> getClassFiles()(Code)(Java Doc) public Iterable<File> getClassPath()(Code)(Java Doc) public CompilerModel getCompilerModel()(Code)(Java Doc) public ConsoleDocument getConsoleDocument()(Code)(Java Doc) public File getCreateJarFile()(Code)(Java Doc) public int getCreateJarFlags()(Code)(Java Doc) public int getDebugPort() throws IOException(Code)(Java Doc) public Debugger getDebugger()(Code)(Java Doc) public Container getDocCollectionWidget()(Code)(Java Doc) public DocumentCache getDocumentCache()(Code)(Java Doc) public int getDocumentCount()(Code)(Java Doc) public OpenDefinitionsDocument getDocumentForFile(File file) throws IOException(Code)(Java Doc) public DocumentIterator getDocumentIterator()(Code)(Java Doc) public IDocumentNavigator<OpenDefinitionsDocument> getDocumentNavigator()(Code)(Java Doc) public DefinitionsEditorKit getEditorKit()(Code)(Java Doc) public String getExternalBinTitle()(Code)(Java Doc) public Iterable<File> getExtraClassPath()(Code)(Java Doc) public List<RegionManager<MovingDocumentRegion>> getFindResultsManagers()(Code)(Java Doc) public String getHistoryAsString()(Code)(Java Doc) public String getHistoryAsStringWithSemicolons()(Code)(Java Doc) public Iterable<File> getInteractionsClassPath()(Code)(Java Doc) public InteractionsDocument getInteractionsDocument()(Code)(Java Doc) public DefaultInteractionsModel getInteractionsModel()(Code)(Java Doc) public JUnitModel getJUnitModel()(Code)(Java Doc) public JavadocModel getJavadocModel()(Code)(Java Doc) public File getMainClass()(Code)(Java Doc) public File getMasterWorkingDirectory()(Code)(Java Doc) public OpenDefinitionsDocument getNextDocument(OpenDefinitionsDocument d)(Code)(Java Doc) public List<OpenDefinitionsDocument> getNonProjectDocuments()(Code)(Java Doc) public int getNumCompErrors()(Code)(Java Doc) public OpenDefinitionsDocument getODDForDocument(AbstractDocumentInterface doc)(Code)(Java Doc) public List<OpenDefinitionsDocument> getOpenDefinitionsDocuments()(Code)(Java Doc) public int getOpenDefinitionsDocumentsSize()(Code)(Java Doc) protected static String getPackageName(String classname)(Code)(Java Doc) public PageFormat getPageFormat()(Code)(Java Doc) public OpenDefinitionsDocument getPrevDocument(OpenDefinitionsDocument d)(Code)(Java Doc) public List<OpenDefinitionsDocument> getProjectDocuments()(Code)(Java Doc) public File getProjectFile()(Code)(Java Doc) public File[] getProjectFiles()(Code)(Java Doc) public File getProjectRoot()(Code)(Java Doc) public List<OpenDefinitionsDocument> getSortedOpenDefinitionsDocuments()(Code)(Java Doc) public String getSourceBinTitle()(Code)(Java Doc) public File getSourceFile(String fileName)(Code)(Java Doc) public Iterable<File> getSourceRootSet()(Code)(Java Doc) public InteractionsDJDocument getSwingConsoleDocument()(Code)(Java Doc) public InteractionsDJDocument getSwingInteractionsDocument()(Code)(Java Doc) public File getWorkingDirectory()(Code)(Java Doc) public boolean hasModifiedDocuments()(Code)(Java Doc) public boolean hasModifiedDocuments(List<OpenDefinitionsDocument> lod)(Code)(Java Doc) public boolean hasOutOfSyncDocuments()(Code)(Java Doc) public boolean hasOutOfSyncDocuments(List<OpenDefinitionsDocument> lod)(Code)(Java Doc) public boolean hasUntitledDocuments()(Code)(Java Doc) public boolean inProject(File f)(Code)(Java Doc) public boolean inProjectPath(OpenDefinitionsDocument doc)(Code)(Java Doc) public void installActiveDocument()(Code)(Java Doc) public void interpretCurrentInteraction()(Code)(Java Doc) public boolean isAlreadyOpen(File file)(Code)(Java Doc) public boolean isClassPathChanged()(Code)(Java Doc) public boolean isProjectActive()(Code)(Java Doc) public boolean isProjectChanged()(Code)(Java Doc) public static boolean isUntitled(File f)(Code)(Java Doc) public void loadHistory(FileOpenSelector selector) throws IOException(Code)(Java Doc) public InteractionsScriptModel loadHistoryAsScript(FileOpenSelector selector) throws IOException, OperationCanceledException(Code)(Java Doc) protected FileGroupingState makeFlatFileGroupingState()(Code)(Java Doc) protected FileGroupingState makeProjectFileGroupingState(File pr, File main, File bd, File wd, File project, File[] srcFiles, File[] auxFiles, Iterable<File> cp, File cjf, int cjflags)(Code)(Java Doc) public OpenDefinitionsDocument newFile(File parentDir)(Code)(Java Doc) public OpenDefinitionsDocument newFile()(Code)(Java Doc) public OpenDefinitionsDocument newTestCase(String name, boolean makeSetUp, boolean makeTearDown)(Code)(Java Doc) public OpenDefinitionsDocument openFile(FileOpenSelector com) throws IOException, OperationCanceledException, AlreadyOpenException(Code)(Java Doc) protected OpenDefinitionsDocument openFileHelper(FileOpenSelector com) throws IOException, OperationCanceledException, AlreadyOpenException(Code)(Java Doc) public OpenDefinitionsDocument[] openFiles(FileOpenSelector com) throws IOException, OperationCanceledException, AlreadyOpenException(Code)(Java Doc) protected OpenDefinitionsDocument[] openFilesHelper(FileOpenSelector com) throws IOException, OperationCanceledException, AlreadyOpenException(Code)(Java Doc) public void openFolder(File dir, boolean rec) throws IOException, OperationCanceledException, AlreadyOpenException(Code)(Java Doc) public void openProject(File projectFile) throws IOException, MalformedProjectFileException(Code)(Java Doc) protected static T pop(ArrayList<T> stack)(Code)(Java Doc) public void printDebugMessage(String s)(Code)(Java Doc) public void quit()(Code)(Java Doc) public void refreshActiveDocument()(Code)(Java Doc) public void reloadProject(File file, Hashtable<OpenDefinitionsDocument, DocumentInfoGetter> info) throws IOException(Code)(Java Doc) public void removeAuxiliaryFile(OpenDefinitionsDocument doc)(Code)(Java Doc) public void removeListener(GlobalModelListener listener)(Code)(Java Doc) public void resetConsole()(Code)(Java Doc) public void resetInteractions(File wd)(Code)(Java Doc) public void resetInteractions(File wd, boolean forceReset)(Code)(Java Doc) public void saveAllFiles(FileSaveSelector com) throws IOException(Code)(Java Doc) protected void saveAllFilesHelper(FileSaveSelector com) throws IOException(Code)(Java Doc) public void saveHistory(FileSaveSelector selector) throws IOException(Code)(Java Doc) public void saveHistory(FileSaveSelector selector, String editedVersion) throws IOException(Code)(Java Doc) public void saveProject(File file, Hashtable<OpenDefinitionsDocument, DocumentInfoGetter> info) throws IOException(Code)(Java Doc) public void setActiveDocument(OpenDefinitionsDocument doc)(Code)(Java Doc) public void setActiveFirstDocument()(Code)(Java Doc) public void setActiveNextDocument()(Code)(Java Doc) public void setActivePreviousDocument()(Code)(Java Doc) public void setBuildDirectory(File f)(Code)(Java Doc) public void setClassPathChanged(boolean changed)(Code)(Java Doc) public void setCreateJarFile(File f)(Code)(Java Doc) public void setCreateJarFlags(int f)(Code)(Java Doc) void setDefinitionsIndent(int indent)(Code)(Java Doc) public void setDocumentNavigator(IDocumentNavigator<OpenDefinitionsDocument> newnav)(Code)(Java Doc) public void setExtraClassPath(Iterable<File> cp)(Code)(Java Doc) public void setFileGroupingState(FileGroupingState state)(Code)(Java Doc) public void setMainClass(File f)(Code)(Java Doc) public void setNumCompErrors(int num)(Code)(Java Doc) public void setPageFormat(PageFormat format)(Code)(Java Doc) public void setProjectChanged(boolean changed)(Code)(Java Doc) public void setProjectFile(File f)(Code)(Java Doc) public void setProjectRoot(File f)(Code)(Java Doc) public void setWorkingDirectory(File f)(Code)(Java Doc) public void systemErrPrint(String s)(Code)(Java Doc) public void systemInEcho(String s)(Code)(Java Doc) public void systemOutPrint(String s)(Code)(Java Doc) public void waitForInterpreter()(Code)(Java Doc)
|
|
|
|