Java Doc for OpenDefinitionsDocument.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) 


edu.rice.cs.drjava.model.OpenDefinitionsDocument

All known Subclasses:   edu.rice.cs.drjava.model.DummyOpenDefDoc,
OpenDefinitionsDocument
public interface OpenDefinitionsDocument extends DJDocument,Finalizable<DefinitionsDocument>,Comparable<OpenDefinitionsDocument>,INavigatorItem(Code)
Interface for the GlobalModel's handler of an open DefinitionsDocument. Provides a means to interact with the document.
version:
   $Id: OpenDefinitionsDocument.java 4255 2007-08-28 19:17:37Z mgricken $




Method Summary
public  voidaddFindResultsManager(RegionManager<MovingDocumentRegion> rm)
     Add a region manager for find results to this document.
public  booleancanAbandonFile()
     Returns whether the GlobalModel can abandon this document, asking listeners if isModifiedSinceSave() is true.
public  booleancheckIfClassFileInSync()
     Checks if the document is modified.
public  voidcleanUpPrintJob()
    
public  voidclose()
     Should be called when closing an ODD to let the ODD clean up after itself.
public  intcommentLines(int selStart, int selEnd)
    
public  PositioncreateUnwrappedPosition(int offs)
     Creates a WrappedPosition in the document.
public  voiddocumentModified()
     Called when this document is modified so it can notify the cache.
public  voiddocumentReset()
     Called when this document is reset so it can notify the cache.
public  voiddocumentSaved()
     Called when this document is saved so it can notify the cache.
public  booleanfileExists()
     Returns true if the file exists on disk, or if the user has located it on disk.
public  voidgenerateJavadoc(FileSaveSelector saver)
     Generates Javadoc for this document, saving the output to a temporary directory.
public  RegionManager<DocumentRegion>getBookmarkManager()
     the bookmark region manager.
public  RegionManager<Breakpoint>getBreakpointManager()
     the breakpoint region manager.
public  RegionManager<DocumentRegion>getBrowserHistoryManager()
     manager for browser history regions.
public  FilegetCachedClassFile()
    
public  StringgetCanonicalPath()
     Returns canonical path for well-formed file, "(Untitled)" if no file exists, and absolute path if ill-formed.
public  intgetCaretPosition()
     the caret position as set by the view.
public  booleangetClassFileInSync()
    
public  StringgetCompletePath()
     Returns canonical path (as defined above) followed by " *" if modified.
public  intgetCurrentCol()
    
public  intgetCurrentLine()
    
public  DocumentListener[]getDocumentListeners()
    
public  StringgetEnclosingClassName(int pos, boolean qual)
     Searching backwards finds the name of the enclosing named class or interface.
public  FilegetFile()
     Returns the file for this document.
public  StringgetFileName()
     Returns the name of this file, or "(Untitled)" if no file.
public  List<RegionManager<MovingDocumentRegion>>getFindResultsManagers()
     managers for find result regions.
public  StringgetFirstTopLevelClassName()
     Returns the name of the top level class, if any.
public  intgetInitialHorizontalScroll()
     the initial vertical scroll the pane should use when initialized.
public  intgetInitialSelectionEnd()
     the final location of the cursor selection that should be set in the pane when it is initialized.
public  intgetInitialSelectionStart()
     the starting location of the cursor selection that should be set in the pane when initialized.
public  intgetInitialVerticalScroll()
     the initial vertical scroll the pane should use when initialized.
public  intgetLineOfOffset(int offset)
     Translates an offset into the components text to a line number.
public  intgetNumberOfLines()
     the number of lines in this document.
public  intgetOffset(int lineNum)
    
public  intgetOffsetOfLine(int line)
     Translates a line number into an offset.
public  StringgetPackageName()
     the name of the package at the time of the most recent save or load operation.
public  StringgetPackageNameFromDocument()
     the name of the package currently embedded in document.
public  PageablegetPageable()
    
public  FilegetParentDirectory()
     Returns the parent directory of this file, null if it has none.
public  StringgetQualifiedClassName()
    
public  StringgetQualifiedClassName(int pos)
    
public  FilegetRawFile()
     Returns the file for this document; does not check whether the file exists.
public  FilegetSourceRoot()
     Finds the root directory of the source files.
public  longgetTimestamp()
     Returns the date that this document was last modified.
public  CompoundUndoManagergetUndoManager()
    
public  UndoableEditListener[]getUndoableEditListeners()
    
public  intgotoLine(int line)
     Moves the definitions document to the given line, and returns the resulting character position.
Parameters:
  line - Destination line number.
public  intid()
    
public  booleaninNewProjectPath(File root)
     Determines if this document in the file system tree below the specified root.
public  booleaninProject()
     true if the documents file is saved in the current project file.
public  booleaninProjectPath()
     Determines if this document in the file system tree below the active project root.
public  booleanisAuxiliaryFile()
     true if the document's file is a project auxiliary file.
public  booleanisEmpty()
     Determines if the document is empty.
public  booleanisModifiedSinceSave()
     Determines if this definitions document has changed since the last save.
public  booleanisReady()
     Returns whether this document is resident in memory.
public  booleanisSourceFile()
     true if the document's filename ends with the extension ".java", ".dj0", "dj1", or "dj2".
public  booleanisUntitled()
     Returns whether this document is currently untitled (indicating whether it has a file yet or not).
public  booleanmodifiedOnDisk()
     Determines if this definitions document has changed since the last save.
public  voidpreparePrintJob()
    
public  voidprint()
    
public  booleanquitFile()
     Saves file at user's discretion before quitting.
public  voidremoveFindResultsManager(RegionManager<MovingDocumentRegion> rm)
     Remove a manager for find results from this document.
Parameters:
  rm - the global model's region manager.
public  voidremoveFromDebugger()
     Called when this document is being closed, removing related state from the debug manager.
public  voidresetModification()
     Resets the document to be unmodified.
public  voidresetUndoManager()
    
public  voidrevertFile()
     Revert the document to the version saved on disk.
public  booleanrevertIfModifiedOnDisk()
     Asks the GlobalModel if it can revert current definitions to version on disk.
public  voidrunMain()
     Runs the main method in this document in the interactions pane.
public  booleansaveFile(FileSaveSelector com)
     Saves the document with a FileWriter.
public  booleansaveFileAs(FileSaveSelector com)
     Saves the document with a FileWriter.
public  voidsetCachedClassFile(File f)
    
public  voidsetClassFileInSync(boolean val)
    
public  voidsetFile(File file)
    
public  voidsetPackage(String s)
    
public  voidstartCompile()
     Starts compiling the source.
public  voidstartJUnit()
     Starts testing the source using JUnit.
public  intuncommentLines(int selStart, int selEnd)
    
public  booleanundoManagerCanRedo()
     whether the undo manager can perform any redos.
public  booleanundoManagerCanUndo()
     whether the undo manager can perform any undos.
public  voidupdateModifiedSinceSave()
     Sets the document as modified.
public  booleanverifyExists()
     If the file exists, returns true.



Method Detail
addFindResultsManager
public void addFindResultsManager(RegionManager<MovingDocumentRegion> rm)(Code)
Add a region manager for find results to this document.
Parameters:
  rm - the global model's region manager



canAbandonFile
public boolean canAbandonFile()(Code)
Returns whether the GlobalModel can abandon this document, asking listeners if isModifiedSinceSave() is true. true if this document can be abandoned



checkIfClassFileInSync
public boolean checkIfClassFileInSync()(Code)
Checks if the document is modified. If not, searches for the class file corresponding to this document and compares the timestamps of the class file to that of the source file. is the class file and this OpenDefinitionsDocument are in sync



cleanUpPrintJob
public void cleanUpPrintJob()(Code)



close
public void close()(Code)
Should be called when closing an ODD to let the ODD clean up after itself.



commentLines
public int commentLines(int selStart, int selEnd)(Code)



createUnwrappedPosition
public Position createUnwrappedPosition(int offs) throws BadLocationException(Code)
Creates a WrappedPosition in the document.



documentModified
public void documentModified()(Code)
Called when this document is modified so it can notify the cache.



documentReset
public void documentReset()(Code)
Called when this document is reset so it can notify the cache.



documentSaved
public void documentSaved()(Code)
Called when this document is saved so it can notify the cache.



fileExists
public boolean fileExists()(Code)
Returns true if the file exists on disk, or if the user has located it on disk. Returns false if the file has been moved or deleted



generateJavadoc
public void generateJavadoc(FileSaveSelector saver) throws IOException(Code)
Generates Javadoc for this document, saving the output to a temporary directory. The location is provided to the javadocEnded event on the given listener.
Parameters:
  saver - FileSaveSelector for saving the file if it needs to be saved



getBookmarkManager
public RegionManager<DocumentRegion> getBookmarkManager()(Code)
the bookmark region manager.



getBreakpointManager
public RegionManager<Breakpoint> getBreakpointManager()(Code)
the breakpoint region manager.



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



getCachedClassFile
public File getCachedClassFile()(Code)



getCanonicalPath
public String getCanonicalPath()(Code)
Returns canonical path for well-formed file, "(Untitled)" if no file exists, and absolute path if ill-formed.



getCaretPosition
public int getCaretPosition()(Code)
the caret position as set by the view.



getClassFileInSync
public boolean getClassFileInSync()(Code)



getCompletePath
public String getCompletePath()(Code)
Returns canonical path (as defined above) followed by " *" if modified.



getCurrentCol
public int getCurrentCol()(Code)



getCurrentLine
public int getCurrentLine()(Code)



getDocumentListeners
public DocumentListener[] getDocumentListeners()(Code)



getEnclosingClassName
public String getEnclosingClassName(int pos, boolean qual) throws BadLocationException, ClassNameNotFoundException(Code)
Searching backwards finds the name of the enclosing named class or interface. NB: ignores comments. WARNING: In long source files and when contained in anonymous inner classes, this function might take a LONG time.
Parameters:
  pos - Position to start from
Parameters:
  qual - true to find the fully qualified class name name of the enclosing named class or interface



getFile
public File getFile() throws FileMovedException(Code)
Returns the file for this document. the file for this document
throws:
  FileMovedException - if the document's file no longer exists



getFileName
public String getFileName()(Code)
Returns the name of this file, or "(Untitled)" if no file.



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



getFirstTopLevelClassName
public String getFirstTopLevelClassName() throws ClassNameNotFoundException(Code)
Returns the name of the top level class, if any.
throws:
  ClassNameNotFoundException - if no top level class name found.



getInitialHorizontalScroll
public int getInitialHorizontalScroll()(Code)
the initial vertical scroll the pane should use when initialized.



getInitialSelectionEnd
public int getInitialSelectionEnd()(Code)
the final location of the cursor selection that should be set in the pane when it is initialized.



getInitialSelectionStart
public int getInitialSelectionStart()(Code)
the starting location of the cursor selection that should be set in the pane when initialized.



getInitialVerticalScroll
public int getInitialVerticalScroll()(Code)
the initial vertical scroll the pane should use when initialized.



getLineOfOffset
public int getLineOfOffset(int offset)(Code)
Translates an offset into the components text to a line number.
Parameters:
  offset - the offset >= 0 the line number >= 0



getNumberOfLines
public int getNumberOfLines()(Code)
the number of lines in this document.



getOffset
public int getOffset(int lineNum)(Code)



getOffsetOfLine
public int getOffsetOfLine(int line)(Code)
Translates a line number into an offset.
Parameters:
  line - number >= 0 offset >= 0



getPackageName
public String getPackageName()(Code)
the name of the package at the time of the most recent save or load operation.



getPackageNameFromDocument
public String getPackageNameFromDocument()(Code)
the name of the package currently embedded in document. Forwards to wrapped DefinitionsDocument.



getPageable
public Pageable getPageable() throws IllegalStateException(Code)



getParentDirectory
public File getParentDirectory()(Code)
Returns the parent directory of this file, null if it has none.



getQualifiedClassName
public String getQualifiedClassName() throws ClassNameNotFoundException(Code)



getQualifiedClassName
public String getQualifiedClassName(int pos) throws ClassNameNotFoundException(Code)



getRawFile
public File getRawFile()(Code)
Returns the file for this document; does not check whether the file exists.



getSourceRoot
public File getSourceRoot() throws InvalidPackageException(Code)
Finds the root directory of the source files. The root directory of the source files, based on the package statement.
throws:
  InvalidPackageException - If the package statement is invalid, or if it does not matchup with the location of the source file.



getTimestamp
public long getTimestamp()(Code)
Returns the date that this document was last modified.



getUndoManager
public CompoundUndoManager getUndoManager()(Code)



getUndoableEditListeners
public UndoableEditListener[] getUndoableEditListeners()(Code)



gotoLine
public int gotoLine(int line)(Code)
Moves the definitions document to the given line, and returns the resulting character position.
Parameters:
  line - Destination line number. If line exceeds the number of lines in the document, it is interpreted as the last line. Index into document of where it moved



id
public int id()(Code)
The following methods are forwarding methods required by the rest of the program in order for the OpenDefinitionsDocument to handle DefinitionsDocuments



inNewProjectPath
public boolean inNewProjectPath(File root)(Code)
Determines if this document in the file system tree below the specified root.



inProject
public boolean inProject()(Code)
true if the documents file is saved in the current project file.



inProjectPath
public boolean inProjectPath()(Code)
Determines if this document in the file system tree below the active project root.



isAuxiliaryFile
public boolean isAuxiliaryFile()(Code)
true if the document's file is a project auxiliary file.



isEmpty
public boolean isEmpty()(Code)
Determines if the document is empty.



isModifiedSinceSave
public boolean isModifiedSinceSave()(Code)
Determines if this definitions document has changed since the last save. true if the document has been modified



isReady
public boolean isReady()(Code)
Returns whether this document is resident in memory.



isSourceFile
public boolean isSourceFile()(Code)
true if the document's filename ends with the extension ".java", ".dj0", "dj1", or "dj2".



isUntitled
public boolean isUntitled()(Code)
Returns whether this document is currently untitled (indicating whether it has a file yet or not). true if the document is untitled and has no file



modifiedOnDisk
public boolean modifiedOnDisk()(Code)
Determines if this definitions document has changed since the last save. true if the document has been modified



preparePrintJob
public void preparePrintJob() throws BadLocationException, FileMovedException(Code)



print
public void print() throws PrinterException, BadLocationException, FileMovedException(Code)



quitFile
public boolean quitFile()(Code)
Saves file at user's discretion before quitting. true if quitting should continue, false if the user cancelled



removeFindResultsManager
public void removeFindResultsManager(RegionManager<MovingDocumentRegion> rm)(Code)
Remove a manager for find results from this document.
Parameters:
  rm - the global model's region manager.



removeFromDebugger
public void removeFromDebugger()(Code)
Called when this document is being closed, removing related state from the debug manager.



resetModification
public void resetModification()(Code)
Resets the document to be unmodified.



resetUndoManager
public void resetUndoManager()(Code)



revertFile
public void revertFile() throws IOException(Code)
Revert the document to the version saved on disk.



revertIfModifiedOnDisk
public boolean revertIfModifiedOnDisk() throws IOException(Code)
Asks the GlobalModel if it can revert current definitions to version on disk. If ok, it reverts the file to the version on disk. true if the document has been reverted



runMain
public void runMain() throws ClassNameNotFoundException, IOException(Code)
Runs the main method in this document in the interactions pane. Demands that the definitions be saved and compiled before proceeding. Fires an event to signal when execution is about to begin.
exception:
  ClassNameNotFoundException - propagated from getFirstTopLevelClass()
exception:
  IOException - propagated from GlobalModel.compileAll()



saveFile
public boolean saveFile(FileSaveSelector com) throws IOException(Code)
Saves the document with a FileWriter. If the file name is already set, the method will use that name instead of whatever selector is passed in.
Parameters:
  com - a selector that picks the file name
exception:
  IOException - true if the file was saved, false if the operation was canceled



saveFileAs
public boolean saveFileAs(FileSaveSelector com) throws IOException(Code)
Saves the document with a FileWriter. The FileSaveSelector will either provide a file name or prompt the user for one. It is up to the caller to decide what needs to be done to choose a file to save to. Once the file has been saved succssfully, this method fires fileSave(File). If the save fails for any reason, the event is not fired.
Parameters:
  com - a selector that picks the file name.
exception:
  IOException - true if the file was saved, false if the operation was canceled



setCachedClassFile
public void setCachedClassFile(File f)(Code)



setClassFileInSync
public void setClassFileInSync(boolean val)(Code)



setFile
public void setFile(File file)(Code)
Sets this document's file
Parameters:
  file - the file that this OpenDefinitionsDocument is associated with



setPackage
public void setPackage(String s)(Code)
Sets the cached package name returned by getPackageName();



startCompile
public void startCompile() throws IOException(Code)
Starts compiling the source. Demands that the definitions be saved before proceeding with the compile. Fires the appropriate events as the compiliation proceeds and finishes.
exception:
  IOException - if a file with errors cannot be opened



startJUnit
public void startJUnit() throws ClassNotFoundException, IOException(Code)
Starts testing the source using JUnit. Demands that the definitions be saved and compiled before proceeding with testing. Fires the appropriate events as the testing proceeds and finishes. TODO: this method is redundant and should be deprecated
exception:
  IOException - if a file with errors cannot be opened
exception:
  ClassNotFoundException - when the class is compiled to a location not on the classpath.



uncommentLines
public int uncommentLines(int selStart, int selEnd)(Code)



undoManagerCanRedo
public boolean undoManagerCanRedo()(Code)
whether the undo manager can perform any redos.



undoManagerCanUndo
public boolean undoManagerCanUndo()(Code)
whether the undo manager can perform any undos.



updateModifiedSinceSave
public void updateModifiedSinceSave()(Code)
Sets the document as modified.



verifyExists
public boolean verifyExists()(Code)
If the file exists, returns true. If it does not exist, prompts the user to look it up. If the user chooses a file, returns true, false otherwise.



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