|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface OpenDefinitionsDocument
Interface for an open document in DrJava. It may not be resident (in DocumentCache).
| Field Summary |
|---|
| Fields inherited from interface javax.swing.text.Document |
|---|
StreamDescriptionProperty, TitleProperty |
| Method Summary | |
|---|---|
int |
_getOffset(int lineNum)
|
void |
addBrowserRegion(BrowserDocumentRegion r)
Adds region r to the browserRegions collection for this |
boolean |
canAbandonFile()
Returns whether the GlobalModel can abandon this document, asking listeners if isModifiedSinceSave() is true. |
boolean |
checkIfClassFileInSync()
Checks if the document is modified. |
void |
cleanUpPrintJob()
|
void |
clearBrowserRegions()
Remove the browser regions for this document from the browser history manager. |
void |
close()
Should be called when closing an ODD to let the ODD clean up after itself. |
int |
commentLines(int selStart,
int selEnd)
The following methods are forwarding methods required by the rest of the program in order for the OpenDefinitionsDocument to handle DefinitionsDocuments |
boolean |
containsClassOrInterfaceOrEnum()
Returns true if one of the words 'class', 'interface' or 'enum' is found in non-comment text. |
javax.swing.text.Position |
createUnwrappedPosition(int offs)
Creates a WrappedPosition in the document. |
void |
documentModified()
Called when this document is modified so it can notify the cache. |
void |
documentReset()
Called when this document is reset so it can notify the cache. |
void |
documentSaved()
Called when this document is saved so it can notify the cache. |
boolean |
fileExists()
Returns true if the file exists on disk, or if the user has located it on disk. |
void |
generateJavadoc(FileSaveSelector saver)
Generates Javadoc for this document, saving the output to a temporary directory. |
RegionManager<MovingDocumentRegion> |
getBookmarkManager()
|
RegionManager<Breakpoint> |
getBreakpointManager()
|
java.io.File |
getCachedClassFile()
|
java.lang.String |
getCanonicalPath()
Returns canonical path for well-formed file, "(Untitled)" if no file exists, and absolute path if ill-formed. |
int |
getCaretPosition()
|
boolean |
getClassFileInSync()
|
java.lang.String |
getCompletePath()
Returns canonical path (as defined above) followed by " *" if modified. |
int |
getCurrentCol()
|
int |
getCurrentLine()
|
DefinitionsDocument |
getDocument()
Gets the associated DefinitionsDocument which may force materializing it. |
javax.swing.event.DocumentListener[] |
getDocumentListeners()
|
java.lang.String |
getEnclosingClassName(int pos,
boolean qual)
Searching backwards finds the name of the enclosing named class or interface. |
java.io.File |
getFile()
Returns the file for this document. |
java.lang.String |
getFileName()
Returns the name of this file, or "(Untitled)" if no file. |
java.lang.String |
getFirstTopLevelClassName()
Returns the name of the top level class, if any. |
int |
getInitialHorizontalScroll()
|
int |
getInitialSelectionEnd()
|
int |
getInitialSelectionStart()
|
int |
getInitialVerticalScroll()
|
java.lang.String |
getLexiName()
|
int |
getLineOfOffset(int offset)
Translates an offset into the components text to a line number. |
int |
getNumberOfLines()
|
int |
getOffsetOfLine(int line)
Translates a line number into an offset. |
java.lang.String |
getPackageName()
|
java.lang.String |
getPackageNameFromDocument()
|
java.awt.print.Pageable |
getPageable()
|
java.io.File |
getParentDirectory()
Returns the parent directory of this file, null if it has none. |
java.lang.String |
getQualifiedClassName()
|
java.lang.String |
getQualifiedClassName(int pos)
|
java.io.File |
getRawFile()
Returns the file for this document; does not check whether the file exists. |
java.io.File |
getSourceRoot()
Finds the root directory of the source files. |
long |
getTimestamp()
Returns the date that this document was last modified. |
javax.swing.event.UndoableEditListener[] |
getUndoableEditListeners()
|
CompoundUndoManager |
getUndoManager()
|
int |
gotoLine(int line)
Moves the definitions document to the given line, and returns the resulting character position. |
boolean |
inNewProjectPath(java.io.File root)
Determines if this document in the file system tree below the specified root. |
boolean |
inProject()
|
boolean |
inProjectPath()
Determines if this document in the file system tree below the active project root. |
boolean |
isAuxiliaryFile()
|
boolean |
isEmpty()
Determines if the document is empty. |
boolean |
isModifiedSinceSave()
Determines if this definitions document has changed since the last save. |
boolean |
isReady()
Returns whether this document is resident in memory. |
boolean |
isShadowed(int pos)
Determines if pos in document is inside a comment or a string. |
boolean |
isSourceFile()
|
boolean |
isUntitled()
Returns whether this document is currently untitled (indicating whether it has a file yet or not). |
boolean |
modifiedOnDisk()
Determines if this definitions document has changed since the last save. |
void |
preparePrintJob()
|
void |
print()
|
boolean |
quitFile()
Saves file at user's discretion before quitting. |
void |
removeBrowserRegion(BrowserDocumentRegion r)
Removes region r from the browserRegions collection |
void |
removeFromDebugger()
Called when this document is being closed, removing related state from the debug manager. |
void |
resetModification()
Resets the document to be unmodified. |
void |
resetUndoManager()
|
void |
revertFile()
Revert the document to the version saved on disk. |
boolean |
revertIfModifiedOnDisk()
Asks the GlobalModel if it can revert current definitions to version on disk. |
void |
runApplet(java.lang.String qualifiedClassName)
Runs this document as applet in the interactions pane. |
void |
runMain(java.lang.String qualifiedClassName)
Runs the main method in this document in the interactions pane. |
void |
runSmart(java.lang.String qualifiedClassName)
Runs this document, and tries to be smart about it. |
boolean |
saveFile(FileSaveSelector com)
Saves the document with a FileWriter. |
boolean |
saveFileAs(FileSaveSelector com)
Saves the document with a FileWriter. |
void |
setCachedClassFile(java.io.File f)
|
void |
setClassFileInSync(boolean val)
|
void |
setFile(java.io.File file)
Sets this document's file |
void |
setPackage(java.lang.String s)
Sets the cached package name returned by getPackageName(); |
void |
startCompile()
Starts compiling the source. |
void |
startJUnit()
Starts testing the source using JUnit. |
int |
uncommentLines(int selStart,
int selEnd)
|
boolean |
undoManagerCanRedo()
|
boolean |
undoManagerCanUndo()
|
void |
updateModifiedSinceSave()
Sets the document as modified. |
void |
updateSyntaxHighlighting()
Update the syntax highlighting for the file type. |
boolean |
verifyExists()
If the file exists, returns true. |
| Methods inherited from interface edu.rice.cs.util.text.AbstractDocumentInterface |
|---|
append, createPosition, getLength, getText |
| Methods inherited from interface javax.swing.text.StyledDocument |
|---|
addStyle, getBackground, getCharacterElement, getFont, getForeground, getLogicalStyle, getParagraphElement, getStyle, removeStyle, setCharacterAttributes, setLogicalStyle, setParagraphAttributes |
| Methods inherited from interface javax.swing.text.Document |
|---|
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, putProperty, removeDocumentListener, removeUndoableEditListener, render |
| Methods inherited from interface edu.rice.cs.drjava.model.Finalizable |
|---|
addFinalizationListener, getFinalizationListeners |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Methods inherited from interface edu.rice.cs.util.docnavigation.INavigatorItem |
|---|
getName |
| Method Detail |
|---|
int commentLines(int selStart,
int selEnd)
int uncommentLines(int selStart,
int selEnd)
DefinitionsDocument getDocument()
boolean getClassFileInSync()
void setClassFileInSync(boolean val)
int getCurrentLine()
int getCurrentCol()
int _getOffset(int lineNum)
java.lang.String getQualifiedClassName()
throws ClassNameNotFoundException
ClassNameNotFoundException
java.lang.String getQualifiedClassName(int pos)
throws ClassNameNotFoundException
ClassNameNotFoundExceptionjava.lang.String getLexiName()
CompoundUndoManager getUndoManager()
void resetUndoManager()
java.io.File getCachedClassFile()
void setCachedClassFile(java.io.File f)
javax.swing.event.DocumentListener[] getDocumentListeners()
javax.swing.event.UndoableEditListener[] getUndoableEditListeners()
java.io.File getRawFile()
java.io.File getFile()
throws FileMovedException
FileMovedException - if the document's file no longer existsvoid setFile(java.io.File file)
file - the file that this OpenDefinitionsDocument is associated withjava.lang.String getFileName()
java.lang.String getCanonicalPath()
java.lang.String getCompletePath()
java.io.File getParentDirectory()
java.awt.print.Pageable getPageable()
throws java.lang.IllegalStateException
java.lang.IllegalStateExceptionboolean undoManagerCanUndo()
boolean undoManagerCanRedo()
boolean inProjectPath()
boolean inNewProjectPath(java.io.File root)
boolean isEmpty()
boolean isAuxiliaryFile()
isAuxiliaryFile in interface INavigatorItemboolean isSourceFile()
boolean inProject()
inProject in interface INavigatorItemboolean isReady()
boolean isUntitled()
isUntitled in interface INavigatorItemboolean fileExists()
fileExists in interface INavigatorItemboolean modifiedOnDisk()
void resetModification()
long getTimestamp()
void addBrowserRegion(BrowserDocumentRegion r)
void removeBrowserRegion(BrowserDocumentRegion r)
java.lang.String getFirstTopLevelClassName()
throws ClassNameNotFoundException
ClassNameNotFoundException - if no top level class name found.boolean verifyExists()
boolean saveFile(FileSaveSelector com)
throws java.io.IOException
com - a selector that picks the file name
java.io.IOException
void revertFile()
throws java.io.IOException
java.io.IOException
boolean saveFileAs(FileSaveSelector com)
throws java.io.IOException
com - a selector that picks the file name.
java.io.IOException
void startCompile()
throws java.io.IOException
java.io.IOException - if a file with errors cannot be opened
void runMain(java.lang.String qualifiedClassName)
throws ClassNameNotFoundException,
java.io.IOException
qualifiedClassName - - the fully qualified name of the class contained in this document to run the main(String[]) method of
ClassNameNotFoundException - propagated from getFirstTopLevelClass()
java.io.IOException - propagated from GlobalModel.compileAll()
void runApplet(java.lang.String qualifiedClassName)
throws ClassNameNotFoundException,
java.io.IOException
qualifiedClassName - - the fully qualified name of the class contained in this document that will be run as applet
ClassNameNotFoundException - propagated from getFirstTopLevelClass()
java.io.IOException - propagated from GlobalModel.compileAll()
void runSmart(java.lang.String qualifiedClassName)
throws ClassNameNotFoundException,
java.io.IOException
qualifiedClassName - the qualified name of the class (in this document) to run. If NULL, it is the name
of the top level class.
ClassNameNotFoundException - propagated from getFirstTopLevelClass()
java.io.IOException - propagated from GlobalModel.compileAll()
void startJUnit()
throws java.lang.ClassNotFoundException,
java.io.IOException
java.io.IOException - if a file with errors cannot be opened
java.lang.ClassNotFoundException - when the class is compiled to a location not on the classpath.
void generateJavadoc(FileSaveSelector saver)
throws java.io.IOException
saver - FileSaveSelector for saving the file if it needs to be saved
java.io.IOExceptionboolean isModifiedSinceSave()
boolean revertIfModifiedOnDisk()
throws java.io.IOException
java.io.IOExceptionboolean canAbandonFile()
boolean quitFile()
int gotoLine(int line)
line - Destination line number. If line exceeds the number of lines in the document, it is interpreted
as the last line.
java.io.File getSourceRoot()
throws InvalidPackageException
InvalidPackageException - If the package statement is invalid, or if it does not match
up with the location of the source file.java.lang.String getPackageNameFromDocument()
java.lang.String getPackageName()
void setPackage(java.lang.String s)
java.lang.String getEnclosingClassName(int pos,
boolean qual)
throws javax.swing.text.BadLocationException,
ClassNameNotFoundException
pos - Position to start fromqual - true to find the fully qualified class name
javax.swing.text.BadLocationException
ClassNameNotFoundException
void preparePrintJob()
throws javax.swing.text.BadLocationException,
FileMovedException
javax.swing.text.BadLocationException
FileMovedException
void print()
throws java.awt.print.PrinterException,
javax.swing.text.BadLocationException,
FileMovedException
java.awt.print.PrinterException
javax.swing.text.BadLocationException
FileMovedExceptionvoid cleanUpPrintJob()
boolean checkIfClassFileInSync()
checkIfClassFileInSync in interface INavigatorItemvoid documentSaved()
void documentModified()
void documentReset()
RegionManager<Breakpoint> getBreakpointManager()
RegionManager<MovingDocumentRegion> getBookmarkManager()
void clearBrowserRegions()
void removeFromDebugger()
void updateModifiedSinceSave()
void close()
int getInitialVerticalScroll()
int getInitialHorizontalScroll()
int getInitialSelectionStart()
int getInitialSelectionEnd()
int getNumberOfLines()
int getLineOfOffset(int offset)
offset - the offset >= 0
int getOffsetOfLine(int line)
line - number >= 0
int getCaretPosition()
javax.swing.text.Position createUnwrappedPosition(int offs)
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationExceptionboolean isShadowed(int pos)
boolean containsClassOrInterfaceOrEnum()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationExceptionvoid updateSyntaxHighlighting()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||