|
||||||||||
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 |
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()
|
File |
getCachedClassFile()
|
String |
getCanonicalPath()
Returns canonical path for well-formed file, "(Untitled)" if no file exists, and absolute path if ill-formed. |
boolean |
getClassFileInSync()
|
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. |
DocumentListener[] |
getDocumentListeners()
|
String |
getEnclosingClassName(int pos,
boolean qual)
Searching backwards finds the name of the enclosing named class or interface. |
File |
getFile()
Returns the file for this document. |
String |
getFileName()
Returns the name of this file, or "(Untitled)" if no file. |
String |
getFirstTopLevelClassName()
Returns the name of the top level class, if any. |
int |
getInitialHorizontalScroll()
|
int |
getInitialSelectionEnd()
|
int |
getInitialSelectionStart()
|
int |
getInitialVerticalScroll()
|
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. |
String |
getPackageName()
|
String |
getPackageNameFromDocument()
|
Pageable |
getPageable()
|
File |
getParentDirectory()
Returns the parent directory of this file, null if it has none. |
String |
getQualifiedClassName()
|
String |
getQualifiedClassName(int pos)
|
File |
getRawFile()
Returns the file for this document; does not check whether the file exists. |
File |
getSourceRoot()
Finds the root directory of the source files. |
long |
getTimestamp()
Returns the date that this document was last modified. |
UndoableEditListener[] |
getUndoableEditListeners()
|
CompoundUndoManager |
getUndoManager()
|
int |
gotoLine(int line)
Moves the definitions document to the given line, and returns the resulting character position. |
boolean |
inNewProjectPath(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 |
runMain()
Runs the main method in this document in the interactions pane. |
boolean |
saveFile(FileSaveSelector com)
Saves the document with a FileWriter. |
boolean |
saveFileAs(FileSaveSelector com)
Saves the document with a FileWriter. |
void |
setCachedClassFile(File f)
|
void |
setClassFileInSync(boolean val)
|
void |
setFile(File file)
Sets this document's file |
void |
setPackage(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. |
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)
String getQualifiedClassName() throws ClassNameNotFoundException
ClassNameNotFoundException
String getQualifiedClassName(int pos) throws ClassNameNotFoundException
ClassNameNotFoundException
String getLexiName()
CompoundUndoManager getUndoManager()
void resetUndoManager()
File getCachedClassFile()
void setCachedClassFile(File f)
DocumentListener[] getDocumentListeners()
UndoableEditListener[] getUndoableEditListeners()
File getRawFile()
File getFile() throws FileMovedException
FileMovedException
- if the document's file no longer existsvoid setFile(File file)
file
- the file that this OpenDefinitionsDocument is associated withString getFileName()
String getCanonicalPath()
String getCompletePath()
File getParentDirectory()
Pageable getPageable() throws IllegalStateException
IllegalStateException
boolean undoManagerCanUndo()
boolean undoManagerCanRedo()
boolean inProjectPath()
boolean inNewProjectPath(File root)
boolean isEmpty()
boolean isAuxiliaryFile()
isAuxiliaryFile
in interface INavigatorItem
boolean isSourceFile()
boolean inProject()
inProject
in interface INavigatorItem
boolean isReady()
boolean isUntitled()
isUntitled
in interface INavigatorItem
boolean fileExists()
fileExists
in interface INavigatorItem
boolean modifiedOnDisk()
void resetModification()
long getTimestamp()
void addBrowserRegion(BrowserDocumentRegion r)
void removeBrowserRegion(BrowserDocumentRegion r)
String getFirstTopLevelClassName() throws ClassNameNotFoundException
ClassNameNotFoundException
- if no top level class name found.boolean verifyExists()
boolean saveFile(FileSaveSelector com) throws IOException
com
- a selector that picks the file name
IOException
void revertFile() throws IOException
IOException
boolean saveFileAs(FileSaveSelector com) throws IOException
com
- a selector that picks the file name.
IOException
void startCompile() throws IOException
IOException
- if a file with errors cannot be openedvoid runMain() throws ClassNameNotFoundException, IOException
ClassNameNotFoundException
- propagated from getFirstTopLevelClass()
IOException
- propagated from GlobalModel.compileAll()void startJUnit() throws ClassNotFoundException, IOException
IOException
- if a file with errors cannot be opened
ClassNotFoundException
- when the class is compiled to a location not on the classpath.void generateJavadoc(FileSaveSelector saver) throws IOException
saver
- FileSaveSelector for saving the file if it needs to be saved
IOException
boolean isModifiedSinceSave()
boolean revertIfModifiedOnDisk() throws IOException
IOException
boolean 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.
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.String getPackageNameFromDocument()
String getPackageName()
void setPackage(String s)
String getEnclosingClassName(int pos, boolean qual) throws BadLocationException, ClassNameNotFoundException
pos
- Position to start fromqual
- true to find the fully qualified class name
BadLocationException
ClassNameNotFoundException
void preparePrintJob() throws BadLocationException, FileMovedException
BadLocationException
FileMovedException
void print() throws PrinterException, BadLocationException, FileMovedException
PrinterException
BadLocationException
FileMovedException
void cleanUpPrintJob()
boolean checkIfClassFileInSync()
checkIfClassFileInSync
in interface INavigatorItem
void 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
Position createUnwrappedPosition(int offs) throws BadLocationException
BadLocationException
boolean isShadowed(int pos)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |