Java Doc for AbstractGlobalModel.java in  » IDE » DrJava » edu » rice » cs » drjava » model » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE » DrJava » edu.rice.cs.drjava.model 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   edu.rice.cs.drjava.model.AbstractGlobalModel

All known Subclasses:   edu.rice.cs.drjava.model.DefaultGlobalModel,
AbstractGlobalModel
public class AbstractGlobalModel implements SingleDisplayModel,OptionConstants,DocumentIterator(Code)
In simple terms, a DefaultGlobalModel without an interpreter, compiler, junit testing, debugger or javadoc. Hence, it only has only document handling functionality
version:
   $Id: AbstractGlobalModel.java 4257 2007-09-12 00:29:25Z mgricken $

Inner Class :class ProjectFileGroupingState implements FileGroupingState
Inner Class :class FlatFileGroupingState implements FileGroupingState
Inner Class :static class ConcreteRegionManager extends EventNotifier> implements RegionManager<R>
Inner Class :class ConcreteOpenDefDoc implements OpenDefinitionsDocument

Field Summary
final static  StringCLASSPATH_OUT_OF_SYNC_MSG
    
final static  StringDOCUMENT_OUT_OF_SYNC_MSG
    
final public static  intWRITE_DELAY
     Number of milliseconds to wait after each println, to prevent the JVM from being flooded with print calls.
final protected  ConcreteRegionManager<DocumentRegion>_bookmarkManager
     Manager for bookmark regions.
final protected  ConcreteRegionManager<Breakpoint>_breakpointManager
     Manager for breakpoint regions.
final protected  ConcreteRegionManager<DocumentRegion>_browserHistoryManager
     Manager for browser history regions.
protected  DocumentCache_cache
     A document cache that manages how many unmodified documents are open at once.
final protected  ConsoleDocument_consoleDoc
     The document used to display System.out and System.err, and to read from System.in.
final protected  InteractionsDJDocument_consoleDocAdapter
     The document adapter used in the console document.
protected volatile  IDocumentNavigator<OpenDefinitionsDocument>_documentNavigator
    
final protected  DefinitionsEditorKit_editorKit
     Factory for new definitions documents and views.
final protected  LinkedList<RegionManager<MovingDocumentRegion>>_findResultsManagers
     Managers for find result regions.
public static  Log_log
    
final public  GlobalEventNotifier_notifier
     Keeps track of all listeners to the model, and has the ability to notify them of some event.
protected volatile  PageFormat_pageFormat
     A PageFormat object for printing to paper.
protected volatile  FileGroupingState_state
     Specifies the state of the navigator pane.

Constructor Summary
public  AbstractGlobalModel()
     Constructs a new GlobalModel.

Method Summary
protected  ConcreteOpenDefDoc_createOpenDefinitionsDocument(NullFile f)
    
protected  ConcreteOpenDefDoc_createOpenDefinitionsDocument(File f)
     Creates a ConcreteOpenDefDoc for an existing file f.
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.
public  ProjectProfile_makeProjectProfile(File file, Hashtable<OpenDefinitionsDocument, DocumentInfoGetter> info)
     Writes the project profile augmented by usage info to specified file.
public  OpenDefinitionsDocument_openFile(File file)
     Creates a document from a file.
public  voidaboutToSaveFromSaveAll(OpenDefinitionsDocument doc)
     If the document is untitled, brings it to the top so that the user will know which is being saved.
public  voidaddAuxiliaryFile(OpenDefinitionsDocument doc)
     Adds a document to the list of auxiliary files.
protected  voidaddDocToClassPath(OpenDefinitionsDocument doc)
     Add a document to the classpath for the slave JVM.
protected  voidaddDocToNavigator(OpenDefinitionsDocument doc)
     Creates an iNavigatorItem for a document, and adds it to the navigator.
public  voidaddListener(GlobalModelListener listener)
     Add a listener to this global model.
public  voidaddToBrowserHistory()
     Add the current location to the browser history.
public  voidcleanBuildDirectory()
    
public  voidclearHistory()
    
public  booleancloseAllFiles()
     Attempts to close all open documents.
public  booleancloseAllFilesOnQuit()
     Closes all open documents.
public  booleancloseFile(OpenDefinitionsDocument doc)
     Closes an open definitions document, prompting to save if the document has been changed.
protected  booleancloseFileHelper(OpenDefinitionsDocument doc)
     Helper for closeFile.
public  booleancloseFileWithoutPrompt(OpenDefinitionsDocument doc)
     Closes an open definitions document, without prompting to save if the document has been changed.
public  booleancloseFiles(List<OpenDefinitionsDocument> docs)
     This function closes a group of files assuming that the files are contiguous in the enumeration provided by the document navigator.
public  voidcloseProject(boolean suppressReset)
     Performs any needed operations on the model after project files have been closed.
public  voidconfigNewProject()
     Configures a new project (created by createNewProject) and writes it to disk; only runs in event thread.
public  RegionManager<MovingDocumentRegion>createFindResultsManager()
     new manager for find result regions.
public  voidcreateNewProject(File projFile)
     Creates a new FileGroupingState for specificed project file and default values for other properties.
public  voiddispose()
     Prepares this model to be thrown away.
public  voiddisposeExternalResources()
     Disposes of external resources.
public  voiddisposeFindResultsManager(RegionManager<MovingDocumentRegion> rm)
     Dispose a manager for find result regions.
public  FilefindFileInPaths(String fileName, Iterable<File> paths)
     Searches for a file with the given name on the provided paths.
public  StringfixPathForNavigator(String path)
    
public  voidforceQuit()
     Halts the program immediately.
public  OpenDefinitionsDocumentgetActiveDocument()
     Returns the currently active document.
public  StringgetAuxiliaryBinTitle()
     Gives the title of the aux files bin for the navigator.
public  List<OpenDefinitionsDocument>getAuxiliaryDocuments()
     Returns the OpenDefinitionsDocuments that are identified as auxiliary project source files.
public  RegionManager<DocumentRegion>getBookmarkManager()
     manager for bookmark regions.
public  RegionManager<Breakpoint>getBreakpointManager()
     manager for breakpoint regions.
public  RegionManager<DocumentRegion>getBrowserHistoryManager()
     manager for browser history regions.
public  FilegetBuildDirectory()
     the build directory for the project (assuming one exists).
public  List<File>getClassFiles()
    
public  Iterable<File>getClassPath()
    
public  CompilerModelgetCompilerModel()
    
public  ConsoleDocumentgetConsoleDocument()
    
public  FilegetCreateJarFile()
     Return the create jar file for the project.
public  intgetCreateJarFlags()
     Return the create jar flags for the project.
public  intgetDebugPort()
    
public  DebuggergetDebugger()
    
public  ContainergetDocCollectionWidget()
    
public  DocumentCachegetDocumentCache()
     This method is for use only by test cases.
public  intgetDocumentCount()
    
public  OpenDefinitionsDocumentgetDocumentForFile(File file)
     Gets the document for the specified file; may involve opening the file.
public  DocumentIteratorgetDocumentIterator()
     Gets a DocumentIterator to allow navigating through open Swing Documents.
public  IDocumentNavigator<OpenDefinitionsDocument>getDocumentNavigator()
    
public  DefinitionsEditorKitgetEditorKit()
    
public  StringgetExternalBinTitle()
    
public  Iterable<File>getExtraClassPath()
    
public  List<RegionManager<MovingDocumentRegion>>getFindResultsManagers()
     manager for find result regions.
public  StringgetHistoryAsString()
    
public  StringgetHistoryAsStringWithSemicolons()
     Returns the entire history as a String with semicolons as needed.
public  Iterable<File>getInteractionsClassPath()
    
public  InteractionsDocumentgetInteractionsDocument()
    
public  DefaultInteractionsModelgetInteractionsModel()
    
public  JUnitModelgetJUnitModel()
    
public  JavadocModelgetJavadocModel()
    
public  FilegetMainClass()
     the class with the project's main method.
public  FilegetMasterWorkingDirectory()
     the working directory for the Master JVM (editor and GUI).
public  OpenDefinitionsDocumentgetNextDocument(OpenDefinitionsDocument d)
     Returns the ODD preceding the given document in the document list.
public  List<OpenDefinitionsDocument>getNonProjectDocuments()
     Returns the OpenDefinitionsDocuments that are NOT identified as project source files.
public  intgetNumCompErrors()
    
public  OpenDefinitionsDocumentgetODDForDocument(AbstractDocumentInterface doc)
     Returns the OpenDefinitionsDocument corresponding to the INavigatorItem/DefinitionsDocument passed in.
public  List<OpenDefinitionsDocument>getOpenDefinitionsDocuments()
     Returns a new collection of all documents currently open for editing.
public  intgetOpenDefinitionsDocumentsSize()
    
protected static  StringgetPackageName(String classname)
    
public  PageFormatgetPageFormat()
    
public  OpenDefinitionsDocumentgetPrevDocument(OpenDefinitionsDocument d)
     Returns the ODD preceding the given document in the document list.
public  List<OpenDefinitionsDocument>getProjectDocuments()
     Returns the OpenDefinitionsDocuments that are identified as project source files.
public  FilegetProjectFile()
     the file that points to the current project file.
public  File[]getProjectFiles()
    
public  FilegetProjectRoot()
     the root of the project sourc tree (assuming one exists).
public  List<OpenDefinitionsDocument>getSortedOpenDefinitionsDocuments()
    
public  StringgetSourceBinTitle()
     Gives the title of the source bin for the navigator.
public  FilegetSourceFile(String fileName)
     Searches for a file with the given name on the current source roots and the augmented classpath.
public  Iterable<File>getSourceRootSet()
     Gets an array of all sourceRoots for the open definitions documents, without duplicates.
public  InteractionsDJDocumentgetSwingConsoleDocument()
    
public  InteractionsDJDocumentgetSwingInteractionsDocument()
    
public  FilegetWorkingDirectory()
    
public  booleanhasModifiedDocuments()
     Checks if any open definitions documents have been modified since last being saved.
public  booleanhasModifiedDocuments(List<OpenDefinitionsDocument> lod)
     Checks if any given documents have been modified since last being saved.
public  booleanhasOutOfSyncDocuments()
     true if all open documents are in sync with their primary class files.
public  booleanhasOutOfSyncDocuments(List<OpenDefinitionsDocument> lod)
    
public  booleanhasUntitledDocuments()
     Checks if any open definitions documents are untitled.
public  booleaninProject(File f)
     true the given file is in the current project file.
public  booleaninProjectPath(OpenDefinitionsDocument doc)
     A file is in the project if the source root is the same as the project root.
public  voidinstallActiveDocument()
     Invokes the activeDocumentChanged method in the global listener on the argument _activeDocument.
public  voidinterpretCurrentInteraction()
    
public  booleanisAlreadyOpen(File file)
     Iterates over OpenDefinitionsDocuments, looking for this file.
public  booleanisClassPathChanged()
     true if the class path state has been changed.
public  booleanisProjectActive()
     true if the model has a project open, false otherwise.
public  booleanisProjectChanged()
     true if the project state has been changed.
public static  booleanisUntitled(File f)
    
public  voidloadHistory(FileOpenSelector selector)
    
public  InteractionsScriptModelloadHistoryAsScript(FileOpenSelector selector)
    
protected  FileGroupingStatemakeFlatFileGroupingState()
    
protected  FileGroupingStatemakeProjectFileGroupingState(File pr, File main, File bd, File wd, File project, File[] srcFiles, File[] auxFiles, Iterable<File> cp, File cjf, int cjflags)
    
public  OpenDefinitionsDocumentnewFile(File parentDir)
     Creates a new open definitions document and adds it to the list.
public  OpenDefinitionsDocumentnewFile()
     Creates a new document, adds it to the list of open documents, and sets it to be active.
public  OpenDefinitionsDocumentnewTestCase(String name, boolean makeSetUp, boolean makeTearDown)
     Creates a new junit test case.
public  OpenDefinitionsDocumentopenFile(FileOpenSelector com)
     Open a file and add it to the pool of definitions documents.
protected  OpenDefinitionsDocumentopenFileHelper(FileOpenSelector com)
    
public  OpenDefinitionsDocument[]openFiles(FileOpenSelector com)
     Open multiple files and add them to the pool of definitions documents.
protected  OpenDefinitionsDocument[]openFilesHelper(FileOpenSelector com)
    
public  voidopenFolder(File dir, boolean rec)
     Opens all files in the specified folder dir and places them in the appropriate places in the document navigator.
public  voidopenProject(File projectFile)
     Parses the given project file and loads it int the document navigator and resets interactions pane.
protected static  Tpop(ArrayList<T> stack)
     This pop method enables an ArrayList to serve as stack.
public  voidprintDebugMessage(String s)
    
public  voidquit()
     Exits the program.
public  voidrefreshActiveDocument()
     Invokes the activedocumentRefreshed method in the global listener on the argument _activeDocument.
public  voidreloadProject(File file, Hashtable<OpenDefinitionsDocument, DocumentInfoGetter> info)
    
public  voidremoveAuxiliaryFile(OpenDefinitionsDocument doc)
     Removes a document from the list of auxiliary files.
public  voidremoveListener(GlobalModelListener listener)
     Remove a listener from this global model.
public  voidresetConsole()
     Resets the console.
public  voidresetInteractions(File wd)
     A degenerate operation since this has no slave JVM and no interactions model.
public  voidresetInteractions(File wd, boolean forceReset)
     A degenerate operation since this has no slave JVM and no interactions model.
public  voidsaveAllFiles(FileSaveSelector com)
     Saves all open files, prompting for names if necessary.
protected  voidsaveAllFilesHelper(FileSaveSelector com)
    
public  voidsaveHistory(FileSaveSelector selector)
    
public  voidsaveHistory(FileSaveSelector selector, String editedVersion)
    
public  voidsaveProject(File file, Hashtable<OpenDefinitionsDocument, DocumentInfoGetter> info)
     Writes the project profile augmented by usage info to specified file.
public  voidsetActiveDocument(OpenDefinitionsDocument doc)
     Sets the currently active document by updating the selection model.
public  voidsetActiveFirstDocument()
     Sets the first document in the navigator as active.
public  voidsetActiveNextDocument()
     Sets the active document to be the next one in the collection.
public  voidsetActivePreviousDocument()
     Sets the active document to be the previous one in the collection.
public  voidsetBuildDirectory(File f)
     Sets the class with the project's main method.
public  voidsetClassPathChanged(boolean changed)
     Updates the classpath state.
public  voidsetCreateJarFile(File f)
     Sets the create jar file of the project.
public  voidsetCreateJarFlags(int f)
     Sets the create jar flags of the project.
 voidsetDefinitionsIndent(int indent)
     Set the indent tab size for all definitions documents.
public  voidsetDocumentNavigator(IDocumentNavigator<OpenDefinitionsDocument> newnav)
    
public  voidsetExtraClassPath(Iterable<File> cp)
     Sets the set of classpath entries to use as the projects set of classpath entries.
public  voidsetFileGroupingState(FileGroupingState state)
    
Parameters:
  state - the new file grouping state.
public  voidsetMainClass(File f)
     Sets the class with the project's main method.
public  voidsetNumCompErrors(int num)
    
public  voidsetPageFormat(PageFormat format)
    
public  voidsetProjectChanged(boolean changed)
     Notifies the project state that the project has been changed.
public  voidsetProjectFile(File f)
     Sets project file to specifed value; used in "Save Project As ..." command in MainFrame.
public  voidsetProjectRoot(File f)
     Sets the class with the project's main method.
public  voidsetWorkingDirectory(File f)
     Sets the working directory for the project; ignored in flat file model.
public  voidsystemErrPrint(String s)
     Prints System.err to the DrJava console.
public  voidsystemInEcho(String s)
    
public  voidsystemOutPrint(String s)
     Prints System.out to the DrJava console.
public  voidwaitForInterpreter()
    

Field Detail
CLASSPATH_OUT_OF_SYNC_MSG
final static String CLASSPATH_OUT_OF_SYNC_MSG(Code)



DOCUMENT_OUT_OF_SYNC_MSG
final static String DOCUMENT_OUT_OF_SYNC_MSG(Code)



WRITE_DELAY
final public static int WRITE_DELAY(Code)
Number of milliseconds to wait after each println, to prevent the JVM from being flooded with print calls. TODO: why is this here, and why is it public?



_bookmarkManager
final protected ConcreteRegionManager<DocumentRegion> _bookmarkManager(Code)
Manager for bookmark regions.



_breakpointManager
final protected ConcreteRegionManager<Breakpoint> _breakpointManager(Code)
Manager for breakpoint regions.



_browserHistoryManager
final protected ConcreteRegionManager<DocumentRegion> _browserHistoryManager(Code)
Manager for browser history regions.



_cache
protected DocumentCache _cache(Code)
A document cache that manages how many unmodified documents are open at once.



_consoleDoc
final protected ConsoleDocument _consoleDoc(Code)
The document used to display System.out and System.err, and to read from System.in.



_consoleDocAdapter
final protected InteractionsDJDocument _consoleDocAdapter(Code)
The document adapter used in the console document.



_documentNavigator
protected volatile IDocumentNavigator<OpenDefinitionsDocument> _documentNavigator(Code)
The abstract container which contains views of open documents and allows user to navigate document focus among this collection of open documents



_editorKit
final protected DefinitionsEditorKit _editorKit(Code)
Factory for new definitions documents and views.



_findResultsManagers
final protected LinkedList<RegionManager<MovingDocumentRegion>> _findResultsManagers(Code)
Managers for find result regions.



_log
public static Log _log(Code)



_notifier
final public GlobalEventNotifier _notifier(Code)
Keeps track of all listeners to the model, and has the ability to notify them of some event. Originally used a Command Pattern style, but this has been replaced by having EventNotifier directly implement all listener interfaces it supports. Set in constructor so that subclasses can install their own notifier with additional methods.



_pageFormat
protected volatile PageFormat _pageFormat(Code)
A PageFormat object for printing to paper.



_state
protected volatile FileGroupingState _state(Code)
Specifies the state of the navigator pane. The global model delegates the compileAll command to the _state, a FileGroupingState.nSynchronization is handled by the compilerModel.




Constructor Detail
AbstractGlobalModel
public AbstractGlobalModel()(Code)
Constructs a new GlobalModel. Creates a new MainJVM and starts its Interpreter JVM.




Method Detail
_createOpenDefinitionsDocument
protected ConcreteOpenDefDoc _createOpenDefinitionsDocument(NullFile f)(Code)
Creates a ConcreteOpenDefDoc for a NullFile object f (corresponding to a new empty document) OpenDefinitionsDocument object for a new document



_createOpenDefinitionsDocument
protected ConcreteOpenDefDoc _createOpenDefinitionsDocument(File f) throws IOException(Code)
Creates a ConcreteOpenDefDoc for an existing file f. OpenDefinitionsDocument object for f
throws:
  FileNotFoundException - if file f does not exist



_docAppend
protected void _docAppend(ConsoleDocument doc, String s, String style)(Code)
Appends a string to the given document using a particular attribute set. Also waits for a small amount of time (WRITE_DELAY) to prevent any one writer from flooding the model with print calls to the point that the user interface could become unresponsive.
Parameters:
  doc - Document to append to
Parameters:
  s - String to append to the end of the document
Parameters:
  style - the style to print with



_getOpenDocument
protected OpenDefinitionsDocument _getOpenDocument(File file)(Code)
Returns the OpenDefinitionsDocument corresponding to the given File, or null if that file is not open.
Parameters:
  file - File object to search for Corresponding OpenDefinitionsDocument, or null



_makeProjectProfile
public ProjectProfile _makeProjectProfile(File file, Hashtable<OpenDefinitionsDocument, DocumentInfoGetter> info) throws IOException(Code)
Writes the project profile augmented by usage info to specified file. Assumes DrJava is in project mode.
Parameters:
  file - where to save the project
Parameters:
  info -



_openFile
public OpenDefinitionsDocument _openFile(File file) throws IOException, AlreadyOpenException(Code)
Creates a document from a file.
Parameters:
  file - File to read document from openened document



aboutToSaveFromSaveAll
public void aboutToSaveFromSaveAll(OpenDefinitionsDocument doc)(Code)
If the document is untitled, brings it to the top so that the user will know which is being saved.



addAuxiliaryFile
public void addAuxiliaryFile(OpenDefinitionsDocument doc)(Code)
Adds a document to the list of auxiliary files. The LinkedList class is not thread safe, so the add operation is synchronized.



addDocToClassPath
protected void addDocToClassPath(OpenDefinitionsDocument doc)(Code)
Add a document to the classpath for the slave JVM. Does nothing here because there is no slave JVM. Overridden in DefaultGlobalModel.



addDocToNavigator
protected void addDocToNavigator(OpenDefinitionsDocument doc)(Code)
Creates an iNavigatorItem for a document, and adds it to the navigator. A helper for opening a file or creating a new file.
Parameters:
  doc - the document to add to the navigator



addListener
public void addListener(GlobalModelListener listener)(Code)
Add a listener to this global model.
Parameters:
  listener - a listener that reacts on events generated by the GlobalModel.



addToBrowserHistory
public void addToBrowserHistory()(Code)
Add the current location to the browser history. Aborts if not run in event thread.



cleanBuildDirectory
public void cleanBuildDirectory()(Code)



clearHistory
public void clearHistory()(Code)
throws UnsupportedOperationException



closeAllFiles
public boolean closeAllFiles()(Code)
Attempts to close all open documents. Also ensures the invariant that there is always at least one open document holds by creating a new file if necessary. Resets interactions iff operation succeeds. true if all documents were closed



closeAllFilesOnQuit
public boolean closeAllFilesOnQuit()(Code)
Closes all open documents. This operation can be cancelled by the user since it checks if all files can be abandoned BEFORE it actually modifies the project state. false if the user cancelled



closeFile
public boolean closeFile(OpenDefinitionsDocument doc)(Code)
Closes an open definitions document, prompting to save if the document has been changed. Returns whether the file was successfully closed. Also ensures the invariant that there is always at least one open document holds by creating a new file if necessary. true if the document was closed



closeFileHelper
protected boolean closeFileHelper(OpenDefinitionsDocument doc)(Code)
Helper for closeFile. This method was the closeFile(...) method before projects were added to DrJava.



closeFileWithoutPrompt
public boolean closeFileWithoutPrompt(OpenDefinitionsDocument doc)(Code)
Closes an open definitions document, without prompting to save if the document has been changed. Returns whether the file was successfully closed. NOTE: This method should not be called unless it can be absolutely known that the document being closed is not the active document. The closeFile() method in SingleDisplayModel ensures that a new active document is set, but closeFileWithoutPrompt is not. true if the document was closed.



closeFiles
public boolean closeFiles(List<OpenDefinitionsDocument> docs)(Code)
This function closes a group of files assuming that the files are contiguous in the enumeration provided by the document navigator. This assumption is used in selecting which remaining document (if any) to activate.

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.
Parameters:
  docs - the list od OpenDefinitionsDocuments to close whether all files were closed




closeProject
public void closeProject(boolean suppressReset)(Code)
Performs any needed operations on the model after project files have been closed. This method is not responsible for closing any filesl both the files in the project and the project file have already been closed (by MainFrame._closeProject()). Resets interations unless suppressReset is true.



configNewProject
public void configNewProject() throws IOException(Code)
Configures a new project (created by createNewProject) and writes it to disk; only runs in event thread.



createFindResultsManager
public RegionManager<MovingDocumentRegion> createFindResultsManager()(Code)
new manager for find result regions.



createNewProject
public void createNewProject(File projFile)(Code)
Creates a new FileGroupingState for specificed project file and default values for other properties.
Parameters:
  projFile - the new project file (which does not yet exist in the file system)



dispose
public void dispose()(Code)
Prepares this model to be thrown away. Never called outside of tests. This version ignores the slave JVM.



disposeExternalResources
public void disposeExternalResources()(Code)
Disposes of external resources. This is a no op in AbstractGlobalModel.



disposeFindResultsManager
public void disposeFindResultsManager(RegionManager<MovingDocumentRegion> rm)(Code)
Dispose a manager for find result regions.



findFileInPaths
public File findFileInPaths(String fileName, Iterable<File> paths)(Code)
Searches for a file with the given name on the provided paths. Returns null if the file is not found.
Parameters:
  fileName - Name of the source file to look for
Parameters:
  paths - An array of directories to search the file if it is found, or null otherwise



fixPathForNavigator
public String fixPathForNavigator(String path) throws IOException(Code)



forceQuit
public void forceQuit()(Code)
Halts the program immediately.



getActiveDocument
public OpenDefinitionsDocument getActiveDocument()(Code)
Returns the currently active document.



getAuxiliaryBinTitle
public String getAuxiliaryBinTitle()(Code)
Gives the title of the aux files bin for the navigator. The text used for the aux files bin in the tree navigator.



getAuxiliaryDocuments
public List<OpenDefinitionsDocument> getAuxiliaryDocuments()(Code)
Returns the OpenDefinitionsDocuments that are identified as auxiliary project source files.



getBookmarkManager
public RegionManager<DocumentRegion> getBookmarkManager()(Code)
manager for bookmark regions.



getBreakpointManager
public RegionManager<Breakpoint> getBreakpointManager()(Code)
manager for breakpoint regions.



getBrowserHistoryManager
public RegionManager<DocumentRegion> getBrowserHistoryManager()(Code)
manager for browser history regions.



getBuildDirectory
public File getBuildDirectory()(Code)
the build directory for the project (assuming one exists).



getClassFiles
public List<File> getClassFiles()(Code)



getClassPath
public Iterable<File> getClassPath()(Code)
throws an UnsupportedOperationException



getCompilerModel
public CompilerModel getCompilerModel()(Code)



getConsoleDocument
public ConsoleDocument getConsoleDocument()(Code)



getCreateJarFile
public File getCreateJarFile()(Code)
Return the create jar file for the project. If not in project mode, returns null.



getCreateJarFlags
public int getCreateJarFlags()(Code)
Return the create jar flags for the project. If not in project mode, returns 0.



getDebugPort
public int getDebugPort() throws IOException(Code)
throws UnsupportedOperationException



getDebugger
public Debugger getDebugger()(Code)
throws UnsupportedOperationException



getDocCollectionWidget
public Container getDocCollectionWidget()(Code)



getDocumentCache
public DocumentCache getDocumentCache()(Code)
This method is for use only by test cases.



getDocumentCount
public int getDocumentCount()(Code)



getDocumentForFile
public OpenDefinitionsDocument getDocumentForFile(File file) throws IOException(Code)
Gets the document for the specified file; may involve opening the file.



getDocumentIterator
public DocumentIterator getDocumentIterator()(Code)
Gets a DocumentIterator to allow navigating through open Swing Documents.



getDocumentNavigator
public IDocumentNavigator<OpenDefinitionsDocument> getDocumentNavigator()(Code)



getEditorKit
public DefinitionsEditorKit getEditorKit()(Code)



getExternalBinTitle
public String getExternalBinTitle()(Code)
Gives the title of the external files bin for the navigator The text used for the external files bin in the tree navigator.



getExtraClassPath
public Iterable<File> getExtraClassPath()(Code)
Returns a project's extra classpaths; empty for FlatFileGroupingState The classpath entries loaded along with the project



getFindResultsManagers
public List<RegionManager<MovingDocumentRegion>> getFindResultsManagers()(Code)
manager for find result regions.



getHistoryAsString
public String getHistoryAsString()(Code)
Throws UnsupportedOperationException



getHistoryAsStringWithSemicolons
public String getHistoryAsStringWithSemicolons()(Code)
Returns the entire history as a String with semicolons as needed.



getInteractionsClassPath
public Iterable<File> getInteractionsClassPath()(Code)
throws new UnsupportedOperationException



getInteractionsDocument
public InteractionsDocument getInteractionsDocument()(Code)
throws UnsupportedOperationException



getInteractionsModel
public DefaultInteractionsModel getInteractionsModel()(Code)
throws UnsupportedOperationException



getJUnitModel
public JUnitModel getJUnitModel()(Code)
throws UnsupportedOperationException



getJavadocModel
public JavadocModel getJavadocModel()(Code)
throws UnsupportedOperationException



getMainClass
public File getMainClass()(Code)
the class with the project's main method.



getMasterWorkingDirectory
public File getMasterWorkingDirectory()(Code)
the working directory for the Master JVM (editor and GUI).



getNextDocument
public OpenDefinitionsDocument getNextDocument(OpenDefinitionsDocument d)(Code)
Returns the ODD preceding the given document in the document list.
Parameters:
  d - the current Document the next Document



getNonProjectDocuments
public List<OpenDefinitionsDocument> getNonProjectDocuments()(Code)
Returns the OpenDefinitionsDocuments that are NOT identified as project source files.



getNumCompErrors
public int getNumCompErrors()(Code)
throws UnsupportedOperationException



getODDForDocument
public OpenDefinitionsDocument getODDForDocument(AbstractDocumentInterface doc)(Code)
Returns the OpenDefinitionsDocument corresponding to the INavigatorItem/DefinitionsDocument passed in.
Parameters:
  doc - the searched for Document its corresponding OpenDefinitionsDocument



getOpenDefinitionsDocuments
public List<OpenDefinitionsDocument> getOpenDefinitionsDocuments()(Code)
Returns a new collection of all documents currently open for editing. This is equivalent to the results of getDocumentForFile for the set of all files for which isAlreadyOpen returns true. a random-access List of the open definitions documents..



getOpenDefinitionsDocumentsSize
public int getOpenDefinitionsDocumentsSize()(Code)
the size of the collection of OpenDefinitionsDocuments



getPackageName
protected static String getPackageName(String classname)(Code)
Helper method used in subsequent anonymous inner class



getPageFormat
public PageFormat getPageFormat()(Code)



getPrevDocument
public OpenDefinitionsDocument getPrevDocument(OpenDefinitionsDocument d)(Code)
Returns the ODD preceding the given document in the document list.
Parameters:
  d - the current Document the previous Document



getProjectDocuments
public List<OpenDefinitionsDocument> getProjectDocuments()(Code)
Returns the OpenDefinitionsDocuments that are identified as project source files.



getProjectFile
public File getProjectFile()(Code)
the file that points to the current project file. Null if not currently in project view



getProjectFiles
public File[] getProjectFiles()(Code)
all files currently saved as source files in the project file.If _state not in project mode, returns null



getProjectRoot
public File getProjectRoot()(Code)
the root of the project sourc tree (assuming one exists).



getSortedOpenDefinitionsDocuments
public List<OpenDefinitionsDocument> getSortedOpenDefinitionsDocuments()(Code)



getSourceBinTitle
public String getSourceBinTitle()(Code)
Gives the title of the source bin for the navigator. The text used for the source bin in the tree navigator



getSourceFile
public File getSourceFile(String fileName)(Code)
Searches for a file with the given name on the current source roots and the augmented classpath.
Parameters:
  fileName - name of the source file to look for the file corresponding to the given name, or null if it cannot be found



getSourceRootSet
public Iterable<File> getSourceRootSet()(Code)
Gets an array of all sourceRoots for the open definitions documents, without duplicates.



getSwingConsoleDocument
public InteractionsDJDocument getSwingConsoleDocument()(Code)



getSwingInteractionsDocument
public InteractionsDJDocument getSwingInteractionsDocument()(Code)
throws UnsupportedOperationException



getWorkingDirectory
public File getWorkingDirectory()(Code)
the working directory for the Slave (Interactions) JVM



hasModifiedDocuments
public boolean hasModifiedDocuments()(Code)
Checks if any open definitions documents have been modified since last being saved. whether any documents have been modified



hasModifiedDocuments
public boolean hasModifiedDocuments(List<OpenDefinitionsDocument> lod)(Code)
Checks if any given documents have been modified since last being saved. whether any documents have been modified



hasOutOfSyncDocuments
public boolean hasOutOfSyncDocuments()(Code)
true if all open documents are in sync with their primary class files.



hasOutOfSyncDocuments
public boolean hasOutOfSyncDocuments(List<OpenDefinitionsDocument> lod)(Code)



hasUntitledDocuments
public boolean hasUntitledDocuments()(Code)
Checks if any open definitions documents are untitled. whether any documents are untitled



inProject
public boolean inProject(File f)(Code)
true the given file is in the current project file.



inProjectPath
public boolean inProjectPath(OpenDefinitionsDocument doc)(Code)
A file is in the project if the source root is the same as the project root. this means that project files must be saved at the source root. (we query the model through the model's state)



installActiveDocument
public void installActiveDocument()(Code)
Invokes the activeDocumentChanged method in the global listener on the argument _activeDocument. This process sets up _activeDocument as the document in the definitions pane.



interpretCurrentInteraction
public void interpretCurrentInteraction()(Code)
throw new UnsupportedOperationException



isAlreadyOpen
public boolean isAlreadyOpen(File file)(Code)
Iterates over OpenDefinitionsDocuments, looking for this file. TODO: This is not very efficient!



isClassPathChanged
public boolean isClassPathChanged()(Code)
true if the class path state has been changed.



isProjectActive
public boolean isProjectActive()(Code)
true if the model has a project open, false otherwise.



isProjectChanged
public boolean isProjectChanged()(Code)
true if the project state has been changed.



isUntitled
public static boolean isUntitled(File f)(Code)



loadHistory
public void loadHistory(FileOpenSelector selector) throws IOException(Code)
throws UnsupportedOperationException



loadHistoryAsScript
public InteractionsScriptModel loadHistoryAsScript(FileOpenSelector selector) throws IOException, OperationCanceledException(Code)
throws UnsupportedOperationException



makeFlatFileGroupingState
protected FileGroupingState makeFlatFileGroupingState()(Code)



makeProjectFileGroupingState
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)



newFile
public OpenDefinitionsDocument newFile(File parentDir)(Code)
Creates a new open definitions document and adds it to the list. Public for testing purposes. The new open document



newFile
public OpenDefinitionsDocument newFile()(Code)
Creates a new document, adds it to the list of open documents, and sets it to be active. The new open document



newTestCase
public OpenDefinitionsDocument newTestCase(String name, boolean makeSetUp, boolean makeTearDown)(Code)
Creates a new junit test case.
Parameters:
  name - the name of the new test case
Parameters:
  makeSetUp - true iff an empty setUp() method should be included
Parameters:
  makeTearDown - true iff an empty tearDown() method should be included the new open test case



openFile
public OpenDefinitionsDocument openFile(FileOpenSelector com) throws IOException, OperationCanceledException, AlreadyOpenException(Code)
Open a file and add it to the pool of definitions documents. The provided file selector chooses a file, and on a successful open, the fileOpened() event is fired. This method also checks if there was previously a single unchanged, untitled document open, and if so, closes it after a successful opening.
Parameters:
  com - a command pattern command that selects what file to open The open document, or null if unsuccessful
exception:
  IOException -
exception:
  OperationCanceledException - if the open was canceled
exception:
  AlreadyOpenException - if the file is already open



openFileHelper
protected OpenDefinitionsDocument openFileHelper(FileOpenSelector com) throws IOException, OperationCanceledException, AlreadyOpenException(Code)



openFiles
public OpenDefinitionsDocument[] openFiles(FileOpenSelector com) throws IOException, OperationCanceledException, AlreadyOpenException(Code)
Open multiple files and add them to the pool of definitions documents. The provided file selector chooses a collection of files, and on successfully opening each file, the fileOpened() event is fired. This method also checks if there was previously a single unchanged, untitled document open, and if so, closes it after a successful opening.
Parameters:
  com - a command pattern command that selects what file to open The open document, or null if unsuccessful
exception:
  IOException -
exception:
  OperationCanceledException - if the open was canceled
exception:
  AlreadyOpenException - if the file is already open



openFilesHelper
protected OpenDefinitionsDocument[] openFilesHelper(FileOpenSelector com) throws IOException, OperationCanceledException, AlreadyOpenException(Code)



openFolder
public void openFolder(File dir, boolean rec) throws IOException, OperationCanceledException, AlreadyOpenException(Code)
Opens all files in the specified folder dir and places them in the appropriate places in the document navigator. If "open folders recursively" is checked, this operation opens all files in the subtree rooted at dir.



openProject
public void openProject(File projectFile) throws IOException, MalformedProjectFileException(Code)
Parses the given project file and loads it int the document navigator and resets interactions pane. Assumes preceding project if any has already been closed.
Parameters:
  projectFile - The project file to parse



pop
protected static T pop(ArrayList<T> stack)(Code)
This pop method enables an ArrayList to serve as stack.



printDebugMessage
public void printDebugMessage(String s)(Code)
throws UnsupportedOperationException



quit
public void quit()(Code)
Exits the program. Only quits if all documents are successfully closed.



refreshActiveDocument
public void refreshActiveDocument()(Code)
Invokes the activedocumentRefreshed method in the global listener on the argument _activeDocument. This process refreshes the state of the _activeDocument as the document in the definitions pane.



reloadProject
public void reloadProject(File file, Hashtable<OpenDefinitionsDocument, DocumentInfoGetter> info) throws IOException(Code)



removeAuxiliaryFile
public void removeAuxiliaryFile(OpenDefinitionsDocument doc)(Code)
Removes a document from the list of auxiliary files. The LinkedList class is not thread safe, so operations on _auxiliaryFiles are synchronized.



removeListener
public void removeListener(GlobalModelListener listener)(Code)
Remove a listener from this global model.
Parameters:
  listener - a listener that reacts on events generated by the GlobalModelThis method is synchronized using the readers/writers event protocol incorporated in EventNotifier.



resetConsole
public void resetConsole()(Code)
Resets the console. Fires consoleReset() event.



resetInteractions
public void resetInteractions(File wd)(Code)
A degenerate operation since this has no slave JVM and no interactions model.



resetInteractions
public void resetInteractions(File wd, boolean forceReset)(Code)
A degenerate operation since this has no slave JVM and no interactions model.



saveAllFiles
public void saveAllFiles(FileSaveSelector com) throws IOException(Code)
Saves all open files, prompting for names if necessary. When prompting (i.e., untitled document), set that document as active.
Parameters:
  com - a FileSaveSelector
exception:
  IOException -



saveAllFilesHelper
protected void saveAllFilesHelper(FileSaveSelector com) throws IOException(Code)
Called by saveAllFiles in DefaultGlobalModel



saveHistory
public void saveHistory(FileSaveSelector selector) throws IOException(Code)
throws UnsupportedOperationException



saveHistory
public void saveHistory(FileSaveSelector selector, String editedVersion) throws IOException(Code)
throws UnsupportedOperationException



saveProject
public void saveProject(File file, Hashtable<OpenDefinitionsDocument, DocumentInfoGetter> info) throws IOException(Code)
Writes the project profile augmented by usage info to specified file. Assumes DrJava is in project mode.
Parameters:
  file - where to save the project



setActiveDocument
public void setActiveDocument(OpenDefinitionsDocument doc)(Code)
Sets the currently active document by updating the selection model.
Parameters:
  doc - Document to set as active



setActiveFirstDocument
public void setActiveFirstDocument()(Code)
Sets the first document in the navigator as active.



setActiveNextDocument
public void setActiveNextDocument()(Code)
Sets the active document to be the next one in the collection.



setActivePreviousDocument
public void setActivePreviousDocument()(Code)
Sets the active document to be the previous one in the collection.



setBuildDirectory
public void setBuildDirectory(File f)(Code)
Sets the class with the project's main method. Degenerate version overridden in DefaultGlobalModel.



setClassPathChanged
public void setClassPathChanged(boolean changed)(Code)
Updates the classpath state.



setCreateJarFile
public void setCreateJarFile(File f)(Code)
Sets the create jar file of the project.



setCreateJarFlags
public void setCreateJarFlags(int f)(Code)
Sets the create jar flags of the project.



setDefinitionsIndent
void setDefinitionsIndent(int indent)(Code)
Set the indent tab size for all definitions documents.
Parameters:
  indent - the number of spaces to make per level of indent



setDocumentNavigator
public void setDocumentNavigator(IDocumentNavigator<OpenDefinitionsDocument> newnav)(Code)



setExtraClassPath
public void setExtraClassPath(Iterable<File> cp)(Code)
Sets the set of classpath entries to use as the projects set of classpath entries. This is normally used by the project preferences..



setFileGroupingState
public void setFileGroupingState(FileGroupingState state)(Code)

Parameters:
  state - the new file grouping state.



setMainClass
public void setMainClass(File f)(Code)
Sets the class with the project's main method.



setNumCompErrors
public void setNumCompErrors(int num)(Code)
throws UnsupportedOperationException



setPageFormat
public void setPageFormat(PageFormat format)(Code)



setProjectChanged
public void setProjectChanged(boolean changed)(Code)
Notifies the project state that the project has been changed.



setProjectFile
public void setProjectFile(File f)(Code)
Sets project file to specifed value; used in "Save Project As ..." command in MainFrame.



setProjectRoot
public void setProjectRoot(File f)(Code)
Sets the class with the project's main method. Degenerate version overridden in DefaultGlobalModel.



setWorkingDirectory
public void setWorkingDirectory(File f)(Code)
Sets the working directory for the project; ignored in flat file model.



systemErrPrint
public void systemErrPrint(String s)(Code)
Prints System.err to the DrJava console.



systemInEcho
public void systemInEcho(String s)(Code)
Prints the given string to the DrJava console as an echo of System.in



systemOutPrint
public void systemOutPrint(String s)(Code)
Prints System.out to the DrJava console.



waitForInterpreter
public void waitForInterpreter()(Code)
throw new UnsupportedOperationException



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.