|
||||||||||
| 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 | |
|---|---|
(package private) class |
AbstractGlobalModel.ConcreteOpenDefDoc
A wrapper around a DefinitionsDocument or potential DefinitionsDocument (if it has been kicked out of the cache) The GlobalModel interacts with DefinitionsDocuments through this wrapper. This call was formerly called the DefinitionsDocumentHandler but was renamed (2004-Jun-8) to be more
descriptive/intuitive. |
(package private) class |
AbstractGlobalModel.FlatFileGroupingState
|
(package private) class |
AbstractGlobalModel.ProjectFileGroupingState
|
private static class |
AbstractGlobalModel.TrivialFSS
|
| Field Summary | |
|---|---|
private File |
_activeDirectory
A pointer to the active directory, which is not necessarily the parent of the active document The user may click on a folder component in the navigation pane and that will set this field without setting the active document. |
private OpenDefinitionsDocument |
_activeDocument
The active document pointer, which will never be null once the constructor is done. |
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 |
private AbstractMap<File,OpenDefinitionsDocument> |
_documentsRepos
Collection for storing all OpenDefinitionsDocuments. |
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. |
(package private) static String |
CLASSPATH_OUT_OF_SYNC_MSG
|
private boolean |
classPathChanged
A state varible indicating whether the class path has changed. |
(package private) static String |
DOCUMENT_OUT_OF_SYNC_MSG
|
protected static HashMap<OptionParser<?>,OptionListener<? extends Object>> |
LISTENERS_TO_REMOVE
|
OptionListener<? extends Object> |
STORED_PREFERENCES_LISTENER
|
| Constructor Summary | |
|---|---|
AbstractGlobalModel()
Constructs a new GlobalModel. |
|
| Method Summary | ||
|---|---|---|
private void |
_completeOpenFile(OpenDefinitionsDocument d)
|
|
protected AbstractGlobalModel.ConcreteOpenDefDoc |
_createOpenDefinitionsDocument(File f)
Creates a ConcreteOpenDefDoc for an existing file f. |
|
protected 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. |
|
private void |
_ensureNotActive(List<OpenDefinitionsDocument> docs)
Makes sure that none of the documents in the list are active. |
|
private void |
_ensureNotEmpty()
Creates a new document if there are currently no documents open. |
|
protected OpenDefinitionsDocument |
_getOpenDocument(File file)
Returns the OpenDefinitionsDocument corresponding to the given File, or null if that file is not open. |
|
private File |
_getSourceFileFromPath(String fileName,
File path)
Gets the file named filename from the given path, if it exists. |
|
private boolean |
_hasOneEmptyDocument()
Returns whether there is currently only one open document which is untitled and unchanged. |
|
private void |
_init()
|
|
private void |
_loadProject(ProjectFileIR ir)
Loads the specified project into the document navigator and opens all of the files (if not already 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. |
|
private OpenDefinitionsDocument[] |
_openFiles(File[] files)
Opens all the files in the list, and notifies about the last file opened. |
|
private OpenDefinitionsDocument |
_rawOpenFile(File file)
Creates an OpenDefinitionsDocument for a file. |
|
private void |
_registerOptionListeners()
Registers OptionListeners. |
|
private void |
_setActiveDoc(INavigatorItem idoc)
|
|
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 within _state. |
|
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. |
|
protected void |
addNewListeners(Map<OptionParser<?>,String> newValues)
|
|
void |
addToBrowserHistory()
Add the current location to the browser history. |
|
void |
addToBrowserHistory(boolean before)
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 |
ensureJVMStarterFinished()
Ensures that the _jvmStarter thread has executed. |
|
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. |
|
String |
getCustomManifest()
|
|
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<AbsRelFile> |
getExtraClassPath()
Returns a project's extra classpaths; empty for FlatFileGroupingState |
|
File[] |
getFilesInFolder(File dir,
boolean rec,
String ext)
|
|
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 |
|
List<OpenDefinitionsDocument> |
getLLOpenDefinitionsDocuments()
Returns a new collection of all language level documents currently open for editing. |
|
String |
getMainClass()
Return the main file for the project If not in project mode, returns null. |
|
File |
getMainClassContainingFile()
Return the File that contains the Main-Class. |
|
File |
getMasterWorkingDirectory()
|
|
File[] |
getNewFilesInProject()
gets files in the project source directory that are not accounted for in the project file. |
|
private OpenDefinitionsDocument |
getNextDocHelper(OpenDefinitionsDocument nextdoc,
Component frame)
Checks that the document exists, and if it doesn't, asks if the user wants to continue. |
|
OpenDefinitionsDocument |
getNextDocument(OpenDefinitionsDocument d)
Returns the ODD preceding the given document in the document list. |
|
OpenDefinitionsDocument |
getNextDocument(OpenDefinitionsDocument d,
Component frame)
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 |
getNumCompilerErrors()
throws UnsupportedOperationException |
|
OpenDefinitionsDocument |
getODDForDocument(AbstractDocumentInterface doc)
Returns the OpenDefinitionsDocument corresponding to the INavigatorItem/DefinitionsDocument passed in. |
|
String |
getOpenAllFilesInFolderExtension()
|
|
List<OpenDefinitionsDocument> |
getOpenDefinitionsDocuments()
Returns a new collection of all documents currently open for editing. |
|
List<OpenDefinitionsDocument> |
getOutOfSyncDocuments()
|
|
List<OpenDefinitionsDocument> |
getOutOfSyncDocuments(List<OpenDefinitionsDocument> lod)
|
|
protected static String |
getPackageName(String classname)
Helper method used in subsequent anonymous inner class |
|
PageFormat |
getPageFormat()
|
|
Map<OptionParser<?>,String> |
getPreferencesStoredInProject()
|
|
private OpenDefinitionsDocument |
getPrevDocHelper(OpenDefinitionsDocument prevdoc)
|
|
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,
String main,
File bd,
File wd,
File project,
File[] srcFiles,
File[] auxFiles,
File[] excludedFiles,
Iterable<AbsRelFile> cp,
File cjf,
int cjflags,
boolean refresh,
String manifest,
Map<OptionParser<?>,String> storedPreferences)
|
|
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 |
newFile(File parentDir,
String text)
Creates a new open definitions document and adds it to the list. |
|
OpenDefinitionsDocument |
newFile(String text)
Creates a new document, adds it to the list of open documents, and sets it to be active. |
|
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,
String ext)
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. |
|
private void |
quit(boolean force)
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 within _state. |
|
void |
removeFindResultsManager(RegionManager<MovingDocumentRegion> rm)
Remove a manager from the model. |
|
void |
removeListener(GlobalModelListener listener)
Remove a listener from this global model. |
|
protected void |
removePreviousListeners()
|
|
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 |
saveConsoleCopy(ConsoleDocument doc,
FileSaveSelector selector)
throws UnsupportedOperationException |
|
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 |
setCustomManifest(String manifest)
|
|
(package private) void |
setDefinitionsIndent(int indent)
Set the indent tab size for all definitions documents. |
|
void |
setDocumentNavigator(IDocumentNavigator<OpenDefinitionsDocument> newnav)
|
|
void |
setExcludedFiles(File[] fs)
Sets the array of files excluded from the current project |
|
void |
setExtraClassPath(Iterable<AbsRelFile> cp)
Sets the set of classpath entries to use as the projects set of classpath entries. |
|
void |
setFileGroupingState(FileGroupingState state)
|
|
void |
setMainClass(String f)
Sets the class with the project's main method. |
|
void |
setNumCompilerErrors(int num)
throws UnsupportedOperationException |
|
void |
setPageFormat(PageFormat format)
|
|
void |
setPreferencesStoredInProject(Map<OptionParser<?>,String> sp)
Set the preferences stored in the project. |
|
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. |
|
private void |
shutdown(boolean force)
|
|
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 |
updateSyntaxHighlighting()
Update the syntax highlighting for all open documents. |
|
| 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
protected final DocumentCache _cache
static final String DOCUMENT_OUT_OF_SYNC_MSG
static final String CLASSPATH_OUT_OF_SYNC_MSG
public final GlobalEventNotifier _notifier
protected final DefinitionsEditorKit _editorKit
private final AbstractMap<File,OpenDefinitionsDocument> _documentsRepos
protected final ConsoleDocument _consoleDoc
protected final InteractionsDJDocument _consoleDocAdapter
protected volatile PageFormat _pageFormat
private volatile OpenDefinitionsDocument _activeDocument
private volatile File _activeDirectory
private volatile boolean classPathChanged
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
protected static final HashMap<OptionParser<?>,OptionListener<? extends Object>> LISTENERS_TO_REMOVE
public final OptionListener<? extends Object> STORED_PREFERENCES_LISTENER
| Constructor Detail |
|---|
public AbstractGlobalModel()
| Method Detail |
|---|
public 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 GlobalModelprivate void _init()
public void setFileGroupingState(FileGroupingState state)
state - the new file grouping state.public void addAuxiliaryFile(OpenDefinitionsDocument doc)
addAuxiliaryFile in interface GlobalModelpublic void removeAuxiliaryFile(OpenDefinitionsDocument doc)
removeAuxiliaryFile in interface GlobalModel
protected FileGroupingState makeProjectFileGroupingState(File pr,
String main,
File bd,
File wd,
File project,
File[] srcFiles,
File[] auxFiles,
File[] excludedFiles,
Iterable<AbsRelFile> cp,
File cjf,
int cjflags,
boolean refresh,
String manifest,
Map<OptionParser<?>,String> storedPreferences)
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(String f)
setMainClass in interface GlobalModelpublic String getMainClass()
GlobalModel
getMainClass in interface GlobalModelpublic File getMainClassContainingFile()
GlobalModel
getMainClassContainingFile 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 Map<OptionParser<?>,String> getPreferencesStoredInProject()
getPreferencesStoredInProject in interface GlobalModelpublic void setPreferencesStoredInProject(Map<OptionParser<?>,String> sp)
GlobalModel
setPreferencesStoredInProject 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 void removePreviousListeners()
protected void addNewListeners(Map<OptionParser<?>,String> newValues)
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 getNumCompilerErrors()
getNumCompilerErrors in interface GlobalModelpublic void setNumCompilerErrors(int num)
setNumCompilerErrors 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)
parentDir - directory in which the document should be located
public OpenDefinitionsDocument newFile(File parentDir,
String text)
parentDir - directory in which the document should be locatedtext - text for the new document
public OpenDefinitionsDocument newFile(String text)
newFile in interface GlobalModeltext - for the new document
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
private OpenDefinitionsDocument[] _openFiles(File[] files)
throws IOException,
OperationCanceledException,
AlreadyOpenException
IOException
OperationCanceledException
AlreadyOpenException
public void openFolder(File dir,
boolean rec,
String ext)
throws IOException,
OperationCanceledException,
AlreadyOpenException
openFolder in interface GlobalModelIOException
OperationCanceledException
AlreadyOpenExceptionpublic String getOpenAllFilesInFolderExtension()
public File[] getFilesInFolder(File dir,
boolean rec,
String ext)
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
MalformedProjectFileException
private void _loadProject(ProjectFileIR ir)
throws IOException
ir - The project file to load
IOExceptionpublic 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 GlobalModelcloseFiles 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 GlobalModelprivate void quit(boolean force)
private void shutdown(boolean force)
public 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 getNextDocument(OpenDefinitionsDocument d,
Component frame)
getNextDocument in interface DocumentIteratord - the current Documentframe - the frame that should serve as parent for a potential dialog window
private OpenDefinitionsDocument getNextDocHelper(OpenDefinitionsDocument nextdoc,
Component frame)
d - the next Documentframe - the frame that should serve as parent for a potential dialog window
public OpenDefinitionsDocument getPrevDocument(OpenDefinitionsDocument d)
getPrevDocument in interface DocumentIteratord - the current Document
private OpenDefinitionsDocument getPrevDocHelper(OpenDefinitionsDocument prevdoc)
public int getDocumentCount()
GlobalModel
getDocumentCount in interface GlobalModelgetDocumentCount in interface DocumentIteratorpublic List<OpenDefinitionsDocument> getOpenDefinitionsDocuments()
getOpenDefinitionsDocuments in interface GlobalModelpublic List<OpenDefinitionsDocument> getLLOpenDefinitionsDocuments()
getLLOpenDefinitionsDocuments in interface GlobalModelpublic List<OpenDefinitionsDocument> getSortedOpenDefinitionsDocuments()
public boolean hasOutOfSyncDocuments()
hasOutOfSyncDocuments in interface GlobalModelpublic boolean hasOutOfSyncDocuments(List<OpenDefinitionsDocument> lod)
hasOutOfSyncDocuments in interface GlobalModelpublic List<OpenDefinitionsDocument> getOutOfSyncDocuments()
getOutOfSyncDocuments in interface GlobalModelpublic List<OpenDefinitionsDocument> getOutOfSyncDocuments(List<OpenDefinitionsDocument> lod)
getOutOfSyncDocuments in interface GlobalModelvoid setDefinitionsIndent(int indent)
indent - the number of spaces to make per level of indentpublic 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 saveConsoleCopy(ConsoleDocument doc,
FileSaveSelector selector)
throws IOException
saveConsoleCopy in interface GlobalModelIOException
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 GlobalModelprivate void _registerOptionListeners()
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 Iterable<File> getInteractionsClassPath()
getInteractionsClassPath in interface GlobalModelpublic Iterable<AbsRelFile> getExtraClassPath()
getExtraClassPath in interface GlobalModelpublic void setExtraClassPath(Iterable<AbsRelFile> 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
private File _getSourceFileFromPath(String fileName,
File path)
fileName - the file to look forpath - the path to look for it in
public void addToBrowserHistory()
addToBrowserHistory in interface GlobalModelpublic void addToBrowserHistory(boolean before)
before - true if the location should be inserted before the current regionpublic Iterable<File> getClassPath()
getClassPath in interface GlobalModelpublic static boolean isUntitled(File f)
public void updateSyntaxHighlighting()
protected AbstractGlobalModel.ConcreteOpenDefDoc _createOpenDefinitionsDocument(NullFile f)
protected 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 GlobalModelIOException
private OpenDefinitionsDocument _rawOpenFile(File file)
throws IOException,
AlreadyOpenException
file - the file to open
IOException
AlreadyOpenExceptionprotected 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
AlreadyOpenExceptionprivate void _completeOpenFile(OpenDefinitionsDocument d)
public 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 SingleDisplayModelprivate boolean _hasOneEmptyDocument()
private void _ensureNotEmpty()
private void _ensureNotActive(List<OpenDefinitionsDocument> docs)
public void setActiveFirstDocument()
setActiveFirstDocument in interface SingleDisplayModelprivate void _setActiveDoc(INavigatorItem idoc)
public void installActiveDocument()
public void refreshActiveDocument()
refreshActiveDocument in interface GlobalModelrefreshActiveDocument in interface SingleDisplayModelpublic void ensureJVMStarterFinished()
ensureJVMStarterFinished in interface SingleDisplayModelpublic void setCustomManifest(String manifest)
setCustomManifest in interface GlobalModelpublic String getCustomManifest()
getCustomManifest in interface GlobalModel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||