|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.model.AbstractGlobalModel
public class AbstractGlobalModel
In simple terms, a DefaultGlobalModel without an interpreter, compiler, junit testing, debugger or javadoc. Hence, it only has only document handling functionality
| 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 ConcreteRegionManager<MovingDocumentRegion> |
_bookmarkManager
Manager for bookmark regions. |
protected ConcreteRegionManager<Breakpoint> |
_breakpointManager
Manager for breakpoint regions. |
protected BrowserHistoryManager |
_browserHistoryManager
Manager for browser history regions. |
protected DocumentCache |
_cache
A document cache that manages how many unmodified documents are open at once. |
protected ConsoleDocument |
_consoleDoc
The document used to display System.out and System.err, and to read from System.in. |
protected InteractionsDJDocument |
_consoleDocAdapter
The document adapter used in the console document. |
protected IDocumentNavigator<OpenDefinitionsDocument> |
_documentNavigator
The abstract container which contains views of open documents and allows user to navigate document focus among this collection of open documents |
protected DefinitionsEditorKit |
_editorKit
Factory for new definitions documents and views. |
protected LinkedList<RegionManager<MovingDocumentRegion>> |
_findResultsManagers
Managers for find result regions. |
static Log |
_log
|
GlobalEventNotifier |
_notifier
Keeps track of all listeners to the model, and has the ability to notify them of some event. |
protected PageFormat |
_pageFormat
A PageFormat object for printing to paper. |
protected FileGroupingState |
_state
Specifies the state of the navigator pane. |
static int |
DIFF_THRESHOLD
|
static int |
WRITE_DELAY
Number of milliseconds to wait after each println, to prevent the JVM from being flooded with print calls. |
| Fields inherited from interface edu.rice.cs.drjava.model.GlobalModel |
|---|
RUNTIME_CLASS_PATH |
| Constructor Summary | |
|---|---|
AbstractGlobalModel()
Constructs a new GlobalModel. |
|
| Method Summary | ||
|---|---|---|
protected edu.rice.cs.drjava.model.AbstractGlobalModel.ConcreteOpenDefDoc |
_createOpenDefinitionsDocument(File f)
Creates a ConcreteOpenDefDoc for an existing file f. |
|
protected edu.rice.cs.drjava.model.AbstractGlobalModel.ConcreteOpenDefDoc |
_createOpenDefinitionsDocument(NullFile f)
Creates a ConcreteOpenDefDoc for a NullFile object f (corresponding to a new empty document) |
|
protected void |
_docAppend(ConsoleDocument doc,
String s,
String style)
Appends a string to the given document using a particular attribute set. |
|
protected OpenDefinitionsDocument |
_getOpenDocument(File file)
Returns the OpenDefinitionsDocument corresponding to the given File, or null if that file is not open. |
|
ProjectProfile |
_makeProjectProfile(File file,
HashMap<OpenDefinitionsDocument,DocumentInfoGetter> info)
Writes the project profile augmented by usage info to specified file. |
|
OpenDefinitionsDocument |
_openFile(File file)
Creates a document from a file. |
|
void |
_toggleBookmark(int pos1,
int pos2)
Raw version of toggleBookmark. |
|
void |
aboutToSaveFromSaveAll(OpenDefinitionsDocument doc)
If the document is untitled, brings it to the top so that the user will know which is being saved. |
|
void |
addAuxiliaryFile(OpenDefinitionsDocument doc)
Adds a document to the list of auxiliary files. |
|
protected void |
addDocToClassPath(OpenDefinitionsDocument doc)
Add a document to the classpath for the slave JVM. |
|
protected void |
addDocToNavigator(OpenDefinitionsDocument doc)
Creates an iNavigatorItem for a document, and adds it to the navigator. |
|
void |
addListener(GlobalModelListener listener)
Add a listener to this global model. |
|
void |
addToBrowserHistory()
Add the current location to the browser history. |
|
void |
autoRefreshProject()
Perform an auto-refresh of the project, adding new source files to the project. |
|
void |
cleanBuildDirectory()
Cleans the build directory. |
|
void |
clearHistory()
throws UnsupportedOperationException |
|
boolean |
closeAllFiles()
Attempts to close all open documents. |
|
boolean |
closeAllFilesOnQuit()
Closes all open documents. |
|
boolean |
closeFile(OpenDefinitionsDocument doc)
Closes an open definitions document, prompting to save if the document has been changed. |
|
protected boolean |
closeFileHelper(OpenDefinitionsDocument doc)
Helper for closeFile. |
|
boolean |
closeFiles(List<OpenDefinitionsDocument> docs)
This function closes a group of files assuming that the files are contiguous in the enumeration provided by the document navigator. |
|
boolean |
closeFileWithoutPrompt(OpenDefinitionsDocument doc)
Closes an open definitions document, without prompting to save if the document has been changed. |
|
void |
closeProject(boolean suppressReset)
Performs any needed operations on the model after project files have been closed. |
|
void |
configNewProject()
Configures a new project (created by createNewProject) and writes it to disk; only runs in event thread. |
|
RegionManager<MovingDocumentRegion> |
createFindResultsManager()
|
|
void |
createNewProject(File projFile)
Creates a new FileGroupingState for specificed project file and default values for other properties. |
|
void |
dispose()
Prepares this model to be thrown away. |
|
void |
disposeExternalResources()
Disposes of external resources. |
|
void |
exportOldProject(File file,
HashMap<OpenDefinitionsDocument,DocumentInfoGetter> info)
Writes the project profile in the old project format. |
|
File |
findFileInPaths(String fileName,
Iterable<File> paths)
Searches for a file with the given name on the provided paths. |
|
String |
fixPathForNavigator(String path)
Formats a string pathname for use in the document navigator. |
|
void |
forceQuit()
Halts the program immediately. |
|
OpenDefinitionsDocument |
getActiveDocument()
Returns the currently active document. |
|
boolean |
getAutoRefreshStatus()
Gets autorfresh status of the project |
|
String |
getAuxiliaryBinTitle()
Gives the title of the aux files bin for the navigator. |
|
List<OpenDefinitionsDocument> |
getAuxiliaryDocuments()
Returns the OpenDefinitionsDocuments that are identified as auxiliary project source files. |
|
RegionManager<MovingDocumentRegion> |
getBookmarkManager()
|
|
RegionManager<Breakpoint> |
getBreakpointManager()
|
|
BrowserHistoryManager |
getBrowserHistoryManager()
|
|
File |
getBuildDirectory()
|
|
List<File> |
getClassFiles()
|
|
Iterable<File> |
getClassPath()
throws an UnsupportedOperationException |
|
CompilerModel |
getCompilerModel()
Gets the CompilerModel, which provides all methods relating to compilers. |
|
ConsoleDocument |
getConsoleDocument()
Gets the console document. |
|
File |
getCreateJarFile()
Return the create jar file for the project. |
|
int |
getCreateJarFlags()
Return the create jar flags for the project. |
|
Debugger |
getDebugger()
throws UnsupportedOperationException |
|
int |
getDebugPort()
throws UnsupportedOperationException |
|
Container |
getDocCollectionWidget()
|
|
DocumentCache |
getDocumentCache()
This method is for use only by test cases. |
|
int |
getDocumentCount()
Returns the document count |
|
OpenDefinitionsDocument |
getDocumentForFile(File file)
Gets the document for the specified file; may involve opening the file. |
|
DocumentIterator |
getDocumentIterator()
Gets a DocumentIterator to allow navigating through open Swing Documents. |
|
IDocumentNavigator<OpenDefinitionsDocument> |
getDocumentNavigator()
Gets the DocumentNavigator, which controls the document view. |
|
DefinitionsEditorKit |
getEditorKit()
Fetches the EditorKit implementation for use in the definitions pane. |
|
File[] |
getExclFiles()
Return an array of the files excluded from the current project |
|
String |
getExternalBinTitle()
Gives the title of the external files bin for the navigator |
|
Iterable<File> |
getExtraClassPath()
Returns a project's extra classpaths; empty for FlatFileGroupingState |
|
File[] |
getFilesInFolder(File dir,
boolean rec)
|
|
List<RegionManager<MovingDocumentRegion>> |
getFindResultsManagers()
|
|
String |
getHistoryAsString()
Throws UnsupportedOperationException |
|
String |
getHistoryAsStringWithSemicolons()
Returns the entire history as a String with semicolons as needed. |
|
Iterable<File> |
getInteractionsClassPath()
throws new UnsupportedOperationException |
|
InteractionsDocument |
getInteractionsDocument()
throws UnsupportedOperationException |
|
DefaultInteractionsModel |
getInteractionsModel()
throws UnsupportedOperationException |
|
JavadocModel |
getJavadocModel()
throws UnsupportedOperationException |
|
JUnitModel |
getJUnitModel()
throws UnsupportedOperationException |
|
File |
getMainClass()
Return the main file for the project If not in project mode, returns null. |
|
File |
getMasterWorkingDirectory()
|
|
File[] |
getNewFilesInProject()
gets files in the project source directory that are not accounted for in the project file. |
|
OpenDefinitionsDocument |
getNextDocument(OpenDefinitionsDocument d)
Returns the ODD preceding the given document in the document list. |
|
List<OpenDefinitionsDocument> |
getNonProjectDocuments()
Returns the OpenDefinitionsDocuments that are NOT identified as project source files. |
|
GlobalEventNotifier |
getNotifier()
Notifier list for the global model. |
|
int |
getNumCompErrors()
throws UnsupportedOperationException |
|
OpenDefinitionsDocument |
getODDForDocument(AbstractDocumentInterface doc)
Returns the OpenDefinitionsDocument corresponding to the INavigatorItem/DefinitionsDocument passed in. |
|
List<OpenDefinitionsDocument> |
getOpenDefinitionsDocuments()
Returns a new collection of all documents currently open for editing. |
|
protected static String |
getPackageName(String classname)
Helper method used in subsequent anonymous inner class |
|
PageFormat |
getPageFormat()
|
|
OpenDefinitionsDocument |
getPrevDocument(OpenDefinitionsDocument d)
Returns the ODD preceding the given document in the document list. |
|
List<OpenDefinitionsDocument> |
getProjectDocuments()
Returns the OpenDefinitionsDocuments that are identified as project source files. |
|
File |
getProjectFile()
|
|
File[] |
getProjectFiles()
|
|
File |
getProjectRoot()
|
|
List<OpenDefinitionsDocument> |
getSortedOpenDefinitionsDocuments()
|
|
String |
getSourceBinTitle()
Gives the title of the source bin for the navigator. |
|
File |
getSourceFile(String fileName)
Searches for a file with the given name on the current source roots and the augmented classpath. |
|
Iterable<File> |
getSourceRootSet()
Gets an array of all sourceRoots for the open definitions documents, without duplicates. |
|
InteractionsDJDocument |
getSwingConsoleDocument()
TODO: remove this swing dependency. |
|
InteractionsDJDocument |
getSwingInteractionsDocument()
throws UnsupportedOperationException |
|
File |
getWorkingDirectory()
|
|
boolean |
hasModifiedDocuments()
Checks if any open definitions documents have been modified since last being saved. |
|
boolean |
hasModifiedDocuments(List<OpenDefinitionsDocument> lod)
Checks if any given documents have been modified since last being saved. |
|
boolean |
hasOutOfSyncDocuments()
|
|
boolean |
hasOutOfSyncDocuments(List<OpenDefinitionsDocument> lod)
|
|
boolean |
hasUntitledDocuments()
Checks if any open definitions documents are untitled. |
|
boolean |
inProject(File f)
Returns true the given file is in the current project file. |
|
boolean |
inProjectPath(OpenDefinitionsDocument doc)
A file is in the project if the source root is the same as the project root. |
|
void |
installActiveDocument()
Invokes the activeDocumentChanged method in the global listener on the argument _activeDocument. |
|
void |
interpretCurrentInteraction()
throw new UnsupportedOperationException |
|
boolean |
isAlreadyOpen(File file)
Iterates over OpenDefinitionsDocuments, looking for this file. |
|
boolean |
isClassPathChanged()
|
|
boolean |
isProjectActive()
|
|
boolean |
isProjectChanged()
Returns true if the project state has been changed |
|
static boolean |
isUntitled(File f)
|
|
void |
loadHistory(FileOpenSelector selector)
throws UnsupportedOperationException |
|
InteractionsScriptModel |
loadHistoryAsScript(FileOpenSelector selector)
throws UnsupportedOperationException |
|
protected FileGroupingState |
makeFlatFileGroupingState()
|
|
protected FileGroupingState |
makeProjectFileGroupingState(File pr,
File main,
File bd,
File wd,
File project,
File[] srcFiles,
File[] auxFiles,
File[] excludedFiles,
Iterable<File> cp,
File cjf,
int cjflags,
boolean refresh)
|
|
OpenDefinitionsDocument |
newFile()
Creates a new document, adds it to the list of open documents, and sets it to be active. |
|
OpenDefinitionsDocument |
newFile(File parentDir)
Creates a new open definitions document and adds it to the list. |
|
OpenDefinitionsDocument |
newTestCase(String name,
boolean makeSetUp,
boolean makeTearDown)
Creates a new junit test case. |
|
OpenDefinitionsDocument |
openFile(FileOpenSelector com)
Open a file and add it to the pool of definitions documents. |
|
protected OpenDefinitionsDocument |
openFileHelper(FileOpenSelector com)
|
|
OpenDefinitionsDocument[] |
openFiles(FileOpenSelector com)
Open multiple files and add them to the pool of definitions documents. |
|
protected OpenDefinitionsDocument[] |
openFilesHelper(FileOpenSelector com)
|
|
void |
openFolder(File dir,
boolean rec)
Opens all files in the specified folder dir and places them in the appropriate places in the document navigator. |
|
void |
openNewFilesInProject()
Searches the source folder (recursively) for new files and opens them. |
|
void |
openProject(File projectFile)
Parses the given project file and loads it into the document navigator and resets interactions pane. |
|
protected static
|
pop(ArrayList<T> stack)
This pop method enables an ArrayList to serve as stack. |
|
void |
printDebugMessage(String s)
throws UnsupportedOperationException |
|
void |
quit()
Exits the program. |
|
void |
refreshActiveDocument()
Makes the active document (in this model) the selection in the documentNavigator and invokes the activedocumentRefreshed method in the global listener on this document. |
|
void |
reloadProject(File file,
HashMap<OpenDefinitionsDocument,DocumentInfoGetter> info)
Reloads a project without writing to disk. |
|
void |
removeAuxiliaryFile(OpenDefinitionsDocument doc)
Removes a document from the list of auxiliary files. |
|
void |
removeFindResultsManager(RegionManager<MovingDocumentRegion> rm)
Remove a manager from the model. |
|
void |
removeListener(GlobalModelListener listener)
Remove a listener from this global model. |
|
void |
resetConsole()
Resets the console. |
|
void |
resetInteractions(File wd)
A degenerate operation since this has no slave JVM and no interactions model. |
|
void |
resetInteractions(File wd,
boolean forceReset)
A degenerate operation since this has no slave JVM and no interactions model. |
|
void |
saveAllFiles(FileSaveSelector com)
Saves all open files, prompting for names if necessary. |
|
protected void |
saveAllFilesHelper(FileSaveSelector com)
Called by saveAllFiles in DefaultGlobalModel |
|
void |
saveHistory(FileSaveSelector selector)
throws UnsupportedOperationException |
|
void |
saveHistory(FileSaveSelector selector,
String editedVersion)
throws UnsupportedOperationException |
|
void |
saveProject(File file,
HashMap<OpenDefinitionsDocument,DocumentInfoGetter> info)
Writes the project profile augmented by usage info to specified file. |
|
void |
setActiveDocument(OpenDefinitionsDocument doc)
Sets the currently active document by updating the selection model. |
|
void |
setActiveFirstDocument()
Selects the first document as the active document. |
|
void |
setActiveNextDocument()
Sets the active document to be the next one in the collection. |
|
void |
setActivePreviousDocument()
Sets the active document to be the previous one in the collection. |
|
void |
setAutoRefreshStatus(boolean status)
Sets autofresh status of the project |
|
void |
setBuildDirectory(File f)
Sets the class with the project's main method. |
|
void |
setClassPathChanged(boolean changed)
Updates the classpath state. |
|
void |
setCreateJarFile(File f)
Sets the create jar file of the project. |
|
void |
setCreateJarFlags(int f)
Sets the create jar flags of the project. |
|
void |
setDocumentNavigator(IDocumentNavigator<OpenDefinitionsDocument> newnav)
|
|
void |
setExcludedFiles(File[] fs)
Sets the array of files excluded from the current project |
|
void |
setExtraClassPath(Iterable<File> cp)
Sets the set of classpath entries to use as the projects set of classpath entries. |
|
void |
setFileGroupingState(FileGroupingState state)
|
|
void |
setMainClass(File f)
Sets the class with the project's main method. |
|
void |
setNumCompErrors(int num)
throws UnsupportedOperationException |
|
void |
setPageFormat(PageFormat format)
|
|
void |
setProjectChanged(boolean changed)
Notifies the project state that the project has been changed. |
|
void |
setProjectFile(File f)
Sets project file to specifed value; used in "Save Project As ..." command in MainFrame. |
|
void |
setProjectRoot(File f)
Sets the class with the project's main method. |
|
void |
setWorkingDirectory(File f)
Sets the working directory for the project; ignored in flat file model. |
|
void |
systemErrPrint(String s)
Prints System.err to the DrJava console. |
|
void |
systemInEcho(String s)
Prints to the DrJava console as an echo of System.in. |
|
void |
systemOutPrint(String s)
Prints System.out to the DrJava console. |
|
void |
toggleBookmark(int pos1,
int pos2)
Toogle the specified bookmark in the active document. |
|
void |
waitForInterpreter()
throw new UnsupportedOperationException |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Log _log
public static final int DIFF_THRESHOLD
protected DocumentCache _cache
public final GlobalEventNotifier _notifier
protected final DefinitionsEditorKit _editorKit
protected final ConsoleDocument _consoleDoc
protected final InteractionsDJDocument _consoleDocAdapter
public static final int WRITE_DELAY
protected volatile PageFormat _pageFormat
protected volatile IDocumentNavigator<OpenDefinitionsDocument> _documentNavigator
protected final ConcreteRegionManager<Breakpoint> _breakpointManager
protected final ConcreteRegionManager<MovingDocumentRegion> _bookmarkManager
protected final LinkedList<RegionManager<MovingDocumentRegion>> _findResultsManagers
protected final BrowserHistoryManager _browserHistoryManager
protected volatile FileGroupingState _state
| Constructor Detail |
|---|
public AbstractGlobalModel()
| Method Detail |
|---|
public void addAuxiliaryFile(OpenDefinitionsDocument doc)
addAuxiliaryFile in interface GlobalModelpublic void removeAuxiliaryFile(OpenDefinitionsDocument doc)
removeAuxiliaryFile in interface GlobalModelpublic GlobalEventNotifier getNotifier()
getNotifier in interface GlobalModelpublic RegionManager<Breakpoint> getBreakpointManager()
getBreakpointManager in interface GlobalModelpublic RegionManager<MovingDocumentRegion> getBookmarkManager()
getBookmarkManager in interface GlobalModelpublic List<RegionManager<MovingDocumentRegion>> getFindResultsManagers()
public RegionManager<MovingDocumentRegion> createFindResultsManager()
createFindResultsManager in interface GlobalModelpublic void removeFindResultsManager(RegionManager<MovingDocumentRegion> rm)
removeFindResultsManager in interface GlobalModelpublic BrowserHistoryManager getBrowserHistoryManager()
getBrowserHistoryManager in interface GlobalModelpublic void setFileGroupingState(FileGroupingState state)
state - the new file grouping state.
protected FileGroupingState makeProjectFileGroupingState(File pr,
File main,
File bd,
File wd,
File project,
File[] srcFiles,
File[] auxFiles,
File[] excludedFiles,
Iterable<File> cp,
File cjf,
int cjflags,
boolean refresh)
public boolean isClassPathChanged()
public void setClassPathChanged(boolean changed)
public void setProjectChanged(boolean changed)
setProjectChanged in interface GlobalModelpublic boolean isProjectChanged()
GlobalModel
isProjectChanged in interface GlobalModelpublic boolean isProjectActive()
isProjectActive in interface GlobalModelpublic File getProjectFile()
getProjectFile in interface GlobalModelpublic File[] getProjectFiles()
getProjectFiles in interface GlobalModelpublic boolean inProject(File f)
GlobalModel
inProject in interface GlobalModelpublic boolean inProjectPath(OpenDefinitionsDocument doc)
inProjectPath in interface GlobalModelpublic void setMainClass(File f)
setMainClass in interface GlobalModelpublic File getMainClass()
GlobalModel
getMainClass in interface GlobalModelpublic void setCreateJarFile(File f)
setCreateJarFile in interface GlobalModelpublic File getCreateJarFile()
getCreateJarFile in interface GlobalModelpublic void setCreateJarFlags(int f)
setCreateJarFlags in interface GlobalModelpublic int getCreateJarFlags()
getCreateJarFlags in interface GlobalModelpublic File getProjectRoot()
getProjectRoot in interface GlobalModelpublic void setProjectRoot(File f)
setProjectRoot in interface GlobalModelpublic void setProjectFile(File f)
setProjectFile in interface GlobalModelpublic File getBuildDirectory()
getBuildDirectory in interface GlobalModelpublic void setBuildDirectory(File f)
setBuildDirectory in interface GlobalModelpublic boolean getAutoRefreshStatus()
getAutoRefreshStatus in interface GlobalModelpublic void setAutoRefreshStatus(boolean status)
setAutoRefreshStatus in interface GlobalModelpublic File getMasterWorkingDirectory()
getMasterWorkingDirectory in interface GlobalModelpublic File getWorkingDirectory()
getWorkingDirectory in interface GlobalModelpublic void setWorkingDirectory(File f)
setWorkingDirectory in interface GlobalModelpublic void cleanBuildDirectory()
GlobalModel
cleanBuildDirectory in interface GlobalModelpublic List<File> getClassFiles()
getClassFiles in interface GlobalModelprotected static String getPackageName(String classname)
protected FileGroupingState makeFlatFileGroupingState()
public String getSourceBinTitle()
getSourceBinTitle in interface GlobalModelpublic String getExternalBinTitle()
getExternalBinTitle in interface GlobalModelpublic String getAuxiliaryBinTitle()
getAuxiliaryBinTitle in interface GlobalModelpublic void addListener(GlobalModelListener listener)
addListener in interface GlobalModellistener - a listener that reacts on events generated by the GlobalModel.public void removeListener(GlobalModelListener listener)
removeListener in interface GlobalModellistener - a listener that reacts on events generated by the GlobalModel
This method is synchronized using the readers/writers event protocol incorporated in EventNotifierpublic DefinitionsEditorKit getEditorKit()
GlobalModelEditorKit implementation for use in the definitions pane.
getEditorKit in interface GlobalModelpublic DefaultInteractionsModel getInteractionsModel()
getInteractionsModel in interface GlobalModelpublic InteractionsDJDocument getSwingInteractionsDocument()
getSwingInteractionsDocument in interface GlobalModelpublic InteractionsDocument getInteractionsDocument()
getInteractionsDocument in interface GlobalModelpublic ConsoleDocument getConsoleDocument()
GlobalModel
getConsoleDocument in interface GlobalModelpublic InteractionsDJDocument getSwingConsoleDocument()
GlobalModel
getSwingConsoleDocument in interface GlobalModelpublic PageFormat getPageFormat()
getPageFormat in interface GlobalModelpublic void setPageFormat(PageFormat format)
setPageFormat in interface GlobalModelpublic CompilerModel getCompilerModel()
GlobalModel
getCompilerModel in interface GlobalModelpublic int getNumCompErrors()
getNumCompErrors in interface GlobalModelpublic void setNumCompErrors(int num)
setNumCompErrors in interface GlobalModelpublic JUnitModel getJUnitModel()
getJUnitModel in interface GlobalModelpublic JavadocModel getJavadocModel()
getJavadocModel in interface GlobalModelpublic IDocumentNavigator<OpenDefinitionsDocument> getDocumentNavigator()
GlobalModel
getDocumentNavigator in interface GlobalModelpublic void setDocumentNavigator(IDocumentNavigator<OpenDefinitionsDocument> newnav)
setDocumentNavigator in interface GlobalModel
public void toggleBookmark(int pos1,
int pos2)
pos1 - first selection positionpos2 - second selection position
public void _toggleBookmark(int pos1,
int pos2)
pos1 - first selection positionpos2 - second selection positionpublic OpenDefinitionsDocument newFile(File parentDir)
public OpenDefinitionsDocument newFile()
newFile in interface GlobalModel
public OpenDefinitionsDocument newTestCase(String name,
boolean makeSetUp,
boolean makeTearDown)
newTestCase in interface GlobalModelname - the name of the new test casemakeSetUp - true iff an empty setUp() method should be includedmakeTearDown - true iff an empty tearDown() method should be included
public DocumentCache getDocumentCache()
public OpenDefinitionsDocument openFile(FileOpenSelector com)
throws IOException,
OperationCanceledException,
AlreadyOpenException
openFile in interface ILoadDocumentscom - a command pattern command that selects what file to open
IOException
OperationCanceledException - if the open was canceled
AlreadyOpenException - if the file is already open
protected OpenDefinitionsDocument openFileHelper(FileOpenSelector com)
throws IOException,
OperationCanceledException,
AlreadyOpenException
IOException
OperationCanceledException
AlreadyOpenException
public OpenDefinitionsDocument[] openFiles(FileOpenSelector com)
throws IOException,
OperationCanceledException,
AlreadyOpenException
openFiles in interface ILoadDocumentscom - a command pattern command that selects what file to open
IOException
OperationCanceledException - if the open was canceled
AlreadyOpenException - if the file is already open
protected OpenDefinitionsDocument[] openFilesHelper(FileOpenSelector com)
throws IOException,
OperationCanceledException,
AlreadyOpenException
IOException
OperationCanceledException
AlreadyOpenException
public void openFolder(File dir,
boolean rec)
throws IOException,
OperationCanceledException,
AlreadyOpenException
openFolder in interface GlobalModelIOException
OperationCanceledException
AlreadyOpenException
public File[] getFilesInFolder(File dir,
boolean rec)
throws IOException,
OperationCanceledException,
AlreadyOpenException
IOException
OperationCanceledException
AlreadyOpenExceptionpublic File[] getNewFilesInProject()
public void openNewFilesInProject()
public void saveAllFiles(FileSaveSelector com)
throws IOException
saveAllFiles in interface GlobalModelcom - a FileSaveSelector
IOException
protected void saveAllFilesHelper(FileSaveSelector com)
throws IOException
IOExceptionpublic void createNewProject(File projFile)
createNewProject in interface GlobalModelprojFile - the new project file (which does not yet exist in the file system)
public void configNewProject()
throws IOException
configNewProject in interface GlobalModelIOException
public ProjectProfile _makeProjectProfile(File file,
HashMap<OpenDefinitionsDocument,DocumentInfoGetter> info)
throws IOException
file - where to save the projectinfo -
IOException
public void saveProject(File file,
HashMap<OpenDefinitionsDocument,DocumentInfoGetter> info)
throws IOException
saveProject in interface GlobalModelfile - where to save the projectinfo - Extra view-related information that should be included in the project file
IOException
public void exportOldProject(File file,
HashMap<OpenDefinitionsDocument,DocumentInfoGetter> info)
throws IOException
file - where to save the project
IOException
public void reloadProject(File file,
HashMap<OpenDefinitionsDocument,DocumentInfoGetter> info)
throws IOException
GlobalModel
reloadProject in interface GlobalModelfile - project file; does not actually get touched
IOException
public void openProject(File projectFile)
throws IOException,
MalformedProjectFileException
openProject in interface GlobalModelprojectFile - The project file to parse
IOException
MalformedProjectFileExceptionpublic void autoRefreshProject()
public void closeProject(boolean suppressReset)
closeProject in interface GlobalModelpublic void aboutToSaveFromSaveAll(OpenDefinitionsDocument doc)
public boolean closeFile(OpenDefinitionsDocument doc)
closeFile in interface GlobalModelpublic boolean closeAllFiles()
closeAllFiles in interface GlobalModelpublic boolean closeFiles(List<OpenDefinitionsDocument> docs)
The corner cases in which the file that is being closed had been externally deleted have been addressed in a few places, namely DefaultGlobalModel.canAbandonFile() and MainFrame.ModelListener.canAbandonFile(). If the DefinitionsDocument for the OpenDefinitionsDocument being closed is not in the cache (see model.cache.DocumentCache) then it is closed without prompting the user to save it. If it is in the cache, then we can successfully notify the user that the file is selected for closing and ask whether to saveAs, close, or cancel.
closeFiles in interface SingleDisplayModeldocs - the list od OpenDefinitionsDocuments to close
protected boolean closeFileHelper(OpenDefinitionsDocument doc)
public boolean closeFileWithoutPrompt(OpenDefinitionsDocument doc)
closeFileWithoutPrompt in interface GlobalModelpublic boolean closeAllFilesOnQuit()
closeAllFilesOnQuit in interface SingleDisplayModelfalse if the user cancelledpublic void quit()
quit in interface GlobalModelpublic void forceQuit()
forceQuit in interface GlobalModelpublic void dispose()
dispose in interface SingleDisplayModelpublic void disposeExternalResources()
disposeExternalResources in interface SingleDisplayModel
public OpenDefinitionsDocument getDocumentForFile(File file)
throws IOException
getDocumentForFile in interface GlobalModelfile - File contained by the document to be returned
IOExceptionpublic boolean isAlreadyOpen(File file)
public OpenDefinitionsDocument getODDForDocument(AbstractDocumentInterface doc)
getODDForDocument in interface GlobalModeldoc - the searched for Document
public DocumentIterator getDocumentIterator()
getDocumentIterator in interface GlobalModelpublic OpenDefinitionsDocument getNextDocument(OpenDefinitionsDocument d)
getNextDocument in interface DocumentIteratord - the current Document
public OpenDefinitionsDocument getPrevDocument(OpenDefinitionsDocument d)
getPrevDocument in interface DocumentIteratord - the current Document
public int getDocumentCount()
GlobalModel
getDocumentCount in interface GlobalModelgetDocumentCount in interface DocumentIteratorpublic List<OpenDefinitionsDocument> getOpenDefinitionsDocuments()
getOpenDefinitionsDocuments in interface GlobalModelpublic List<OpenDefinitionsDocument> getSortedOpenDefinitionsDocuments()
public boolean hasOutOfSyncDocuments()
hasOutOfSyncDocuments in interface GlobalModelpublic boolean hasOutOfSyncDocuments(List<OpenDefinitionsDocument> lod)
hasOutOfSyncDocuments in interface GlobalModelpublic void resetInteractions(File wd)
resetInteractions in interface GlobalModel
public void resetInteractions(File wd,
boolean forceReset)
resetInteractions in interface GlobalModelpublic void resetConsole()
resetConsole in interface GlobalModelpublic void interpretCurrentInteraction()
interpretCurrentInteraction in interface GlobalModel
public void loadHistory(FileOpenSelector selector)
throws IOException
loadHistory in interface GlobalModelIOException
public InteractionsScriptModel loadHistoryAsScript(FileOpenSelector selector)
throws IOException,
OperationCanceledException
loadHistoryAsScript in interface GlobalModelIOException
OperationCanceledExceptionpublic void clearHistory()
clearHistory in interface GlobalModel
public void saveHistory(FileSaveSelector selector)
throws IOException
saveHistory in interface GlobalModelselector - File to save to
IOException
public void saveHistory(FileSaveSelector selector,
String editedVersion)
throws IOException
saveHistory in interface GlobalModelselector - 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 saved interactions file.
IOExceptionpublic String getHistoryAsStringWithSemicolons()
getHistoryAsStringWithSemicolons in interface GlobalModelpublic String getHistoryAsString()
getHistoryAsString in interface GlobalModel
protected void _docAppend(ConsoleDocument doc,
String s,
String style)
doc - Document to append tos - String to append to the end of the documentstyle - the style to print withpublic void systemOutPrint(String s)
systemOutPrint in interface GlobalModelpublic void systemErrPrint(String s)
systemErrPrint in interface GlobalModelpublic void systemInEcho(String s)
systemInEcho in interface GlobalModelpublic void printDebugMessage(String s)
printDebugMessage in interface GlobalModelpublic void waitForInterpreter()
waitForInterpreter in interface GlobalModelpublic Iterable<File> getInteractionsClassPath()
getInteractionsClassPath in interface GlobalModelpublic Iterable<File> getExtraClassPath()
getExtraClassPath in interface GlobalModelpublic void setExtraClassPath(Iterable<File> cp)
setExtraClassPath in interface GlobalModelpublic File[] getExclFiles()
getExclFiles in interface SingleDisplayModelpublic void setExcludedFiles(File[] fs)
setExcludedFiles in interface SingleDisplayModelpublic Iterable<File> getSourceRootSet()
getSourceRootSet in interface GlobalModelpublic Debugger getDebugger()
getDebugger in interface GlobalModel
public int getDebugPort()
throws IOException
getDebugPort in interface GlobalModelIOException - if unable to get a valid port number.public boolean hasModifiedDocuments()
hasModifiedDocuments in interface GlobalModelpublic boolean hasModifiedDocuments(List<OpenDefinitionsDocument> lod)
hasModifiedDocuments in interface GlobalModelpublic boolean hasUntitledDocuments()
hasUntitledDocuments in interface GlobalModelpublic File getSourceFile(String fileName)
getSourceFile in interface GlobalModelfileName - name of the source file to look for
public File findFileInPaths(String fileName,
Iterable<File> paths)
findFileInPaths in interface GlobalModelfileName - Name of the source file to look forpaths - An array of directories to search
public void addToBrowserHistory()
addToBrowserHistory in interface GlobalModelpublic Iterable<File> getClassPath()
getClassPath in interface GlobalModelpublic static boolean isUntitled(File f)
protected edu.rice.cs.drjava.model.AbstractGlobalModel.ConcreteOpenDefDoc _createOpenDefinitionsDocument(NullFile f)
protected edu.rice.cs.drjava.model.AbstractGlobalModel.ConcreteOpenDefDoc _createOpenDefinitionsDocument(File f)
throws IOException
FileNotFoundException - if file f does not exist
IOExceptionprotected OpenDefinitionsDocument _getOpenDocument(File file)
file - File object to search for
public List<OpenDefinitionsDocument> getNonProjectDocuments()
getNonProjectDocuments in interface GlobalModelpublic List<OpenDefinitionsDocument> getAuxiliaryDocuments()
getAuxiliaryDocuments in interface GlobalModelpublic List<OpenDefinitionsDocument> getProjectDocuments()
getProjectDocuments in interface GlobalModel
public String fixPathForNavigator(String path)
throws IOException
GlobalModel
fixPathForNavigator in interface GlobalModelIOExceptionprotected static <T> T pop(ArrayList<T> stack)
protected void addDocToNavigator(OpenDefinitionsDocument doc)
doc - the document to add to the navigatorprotected void addDocToClassPath(OpenDefinitionsDocument doc)
public OpenDefinitionsDocument _openFile(File file)
throws IOException,
AlreadyOpenException
file - File to read document from
IOException
AlreadyOpenExceptionpublic OpenDefinitionsDocument getActiveDocument()
getActiveDocument in interface SingleDisplayModelpublic void setActiveDocument(OpenDefinitionsDocument doc)
setActiveDocument in interface SingleDisplayModeldoc - Document to set as activepublic Container getDocCollectionWidget()
getDocCollectionWidget in interface SingleDisplayModelpublic void setActiveNextDocument()
setActiveNextDocument in interface SingleDisplayModelpublic void setActivePreviousDocument()
setActivePreviousDocument in interface SingleDisplayModelpublic void setActiveFirstDocument()
setActiveFirstDocument in interface SingleDisplayModelpublic void installActiveDocument()
public void refreshActiveDocument()
refreshActiveDocument in interface GlobalModelrefreshActiveDocument in interface SingleDisplayModel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||