|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.model.AbstractGlobalModel.ConcreteOpenDefDoc
class AbstractGlobalModel.ConcreteOpenDefDoc
A wrapper around a DefinitionsDocument or potential DefinitionsDocument (if it has been kicked out of the cache)
The GlobalModel interacts with DefinitionsDocuments through this wrapper.
This call was formerly called the DefinitionsDocumentHandler but was renamed (2004-Jun-8) to be more
descriptive/intuitive.
Note that this class has a natural ordering that determines a coarser equivalence relation than equals.
| Field Summary | |
|---|---|
private DrJavaBook |
_book
|
protected java.util.Set<BrowserDocumentRegion> |
_browserRegions
This document's browser regions. |
private DCacheAdapter |
_cacheAdapter
|
protected int |
_caretPosition
|
private java.io.File |
_classFile
The cached class file for the document |
private boolean |
_classFileInSync
Specifies if classFile is in sync with current state of the document |
private java.io.File |
_file
|
private java.lang.String |
_image
Cached String image of document as last read from or written to disk; initially null |
private int |
_initHScroll
|
private int |
_initSelEnd
|
private int |
_initSelStart
|
private int |
_initVScroll
|
protected java.lang.String |
_lexiName
The fully qualified name of the class with '.' converted to ' ' so that alphabetic ordering works properly. |
protected java.lang.String |
_packageName
The package name embedded in the document the last time is was loaded, reconstructed, or saved. |
private java.io.File |
_parentDir
The folder containing this document |
private long |
_timestamp
|
| Fields inherited from interface javax.swing.text.Document |
|---|
StreamDescriptionProperty, TitleProperty |
| Constructor Summary | |
|---|---|
(package private) |
AbstractGlobalModel.ConcreteOpenDefDoc(java.io.File f)
Standard constructor for a document read from a file. |
private |
AbstractGlobalModel.ConcreteOpenDefDoc(java.io.File f,
java.io.File dir,
long stamp)
|
(package private) |
AbstractGlobalModel.ConcreteOpenDefDoc(NullFile f)
|
| Method Summary | |
|---|---|
int |
_getIndentOfCurrStmt(int pos)
Assumes read lock is already held. |
int |
_getIndentOfCurrStmt(int pos,
char[] delims)
Assumes read lock is already held. |
int |
_getIndentOfCurrStmt(int pos,
char[] delims,
char[] whitespace)
Assumes read lock is already held. |
int |
_getLineEndPos(int pos)
Gets end of line containing pos (line includes closing '\n'). |
int |
_getLineFirstCharPos(int pos)
Assumes read lock is already held. |
int |
_getLineStartPos(int pos)
Gets start of line containing pos. |
int |
_getOffset(int lineNum)
Gets offset of beginning of given 1-based line. |
private java.io.File |
_locateClassFile()
Returns the class file for this source document by searching the source roots of open documents, the system classpath, and the "extra.classpath ". |
void |
addBrowserRegion(BrowserDocumentRegion r)
Adds region r to the browserRegions collection for this |
void |
addDocumentListener(javax.swing.event.DocumentListener listener)
Implementation of the javax.swing.text.Document interface. |
void |
addFinalizationListener(FinalizationListener<DefinitionsDocument> fl)
This method is put here because the ODD is the only way to get to the defdoc. |
javax.swing.text.Style |
addStyle(java.lang.String nm,
javax.swing.text.Style parent)
|
void |
addUndoableEditListener(javax.swing.event.UndoableEditListener listener)
|
void |
append(java.lang.String str)
|
void |
append(java.lang.String str,
javax.swing.text.AttributeSet set)
Appends given string with specified attributes to end of this document. |
void |
append(java.lang.String str,
javax.swing.text.Style style)
|
int |
balanceBackward()
Finds the match for the closing brace immediately to the left, assuming there is such a brace. |
int |
balanceForward()
Forwarding method to find the match for the open brace immediately to the right, assuming there is such a brace. |
boolean |
canAbandonFile()
Asks the listeners if the GlobalModel can abandon the current document. |
boolean |
checkIfClassFileInSync()
Determines if document has a class file consistent with its current state. |
void |
cleanUpPrintJob()
Clears the pageable object used to hold the print job. |
void |
clear()
Clears the entire text of the document. |
void |
clearBrowserRegions()
Clear the browser history regions for this document. |
void |
close()
Degenerate version of close; does not remove breakpoints in this document |
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 |
int |
compareTo(OpenDefinitionsDocument o)
Orders ODDs by their lexical names. |
boolean |
containsClassOrInterfaceOrEnum()
Returns true if one of the words 'class', 'interface' or 'enum' is found in non-comment text. |
javax.swing.text.Position |
createPosition(int offs)
Creates a "sticky" position within a document |
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. |
int |
findCharOnLine(int pos,
char findChar)
Assumes read lock is already held. |
int |
findNextEnclosingBrace(int pos,
char opening,
char closing)
Finds the next brace of specified form enclosing pos. |
int |
findPrevDelimiter(int pos,
char[] delims)
Searching backwards, finds the position of the first character that is one of the given delimiters. |
int |
findPrevDelimiter(int pos,
char[] delims,
boolean skipParenPhrases)
Searching backwards, finds the position of the first character that is one of the given delimiters. |
int |
findPrevEnclosingBrace(int pos,
char opening,
char closing)
Finds the previous brace of specified form enclosing pos. |
void |
generateJavadoc(FileSaveSelector saver)
throws UnsupportedOperationException |
java.awt.Color |
getBackground(javax.swing.text.AttributeSet attr)
|
RegionManager<MovingDocumentRegion> |
getBookmarkManager()
|
RegionManager<Breakpoint> |
getBreakpointManager()
|
java.io.File |
getCachedClassFile()
|
java.lang.String |
getCanonicalPath()
Returns the canonical path for this document, "(Untitled)" if unsaved), "" if the file path is ill-formed. |
int |
getCaretPosition()
|
javax.swing.text.Element |
getCharacterElement(int pos)
|
boolean |
getClassFileInSync()
|
java.lang.String |
getCompletePath()
Returns the canonical path augmented by " *" if the document has been modified. |
int |
getCurrentCol()
|
int |
getCurrentLine()
|
int |
getCurrentLocation()
Get the location of the cursor in the definitions according to the definitions document. |
javax.swing.text.Element |
getDefaultRootElement()
|
DefinitionsDocument |
getDocument()
Gets the definitions document being handled. |
javax.swing.event.DocumentListener[] |
getDocumentListeners()
|
java.lang.String |
getEnclosingClassName(int pos,
boolean fullyQualified)
Searching backwards finds the name of the enclosing named class or interface. |
javax.swing.text.Position |
getEndPosition()
|
java.io.File |
getFile()
Returns the file for this document, null if the document is untitled. |
java.lang.String |
getFileName()
Returns the name of this file, or "(Untitled)" if no file. |
java.util.List<FinalizationListener<DefinitionsDocument>> |
getFinalizationListeners()
|
int |
getFirstNonWSCharPos(int pos)
Only runs in the event thread. |
int |
getFirstNonWSCharPos(int pos,
boolean acceptComments)
Only runs in the event thread. |
int |
getFirstNonWSCharPos(int pos,
char[] whitespace,
boolean acceptComments)
Assumes read lock is already held. |
java.lang.String |
getFirstTopLevelClassName()
Returns the name of the top level class, if any. |
java.awt.Font |
getFont(javax.swing.text.AttributeSet attr)
|
java.awt.Color |
getForeground(javax.swing.text.AttributeSet attr)
|
java.util.ArrayList<HighlightStatus> |
getHighlightStatus(int start,
int end)
Returns highlight status info for text between start and end, coalescing adjoining blocks with the same status. |
int |
getIndent()
Gets the indent level. |
int |
getInitialHorizontalScroll()
|
int |
getInitialSelectionEnd()
|
int |
getInitialSelectionStart()
|
int |
getInitialVerticalScroll()
|
int |
getIntelligentBeginLinePos(int currPos)
Returns the "intelligent" beginning of line. |
int |
getLength()
|
java.lang.String |
getLexiName()
Getter for lexicographic name; used to sort documents into segemented lexicographic ordder |
int |
getLineOfOffset(int offset)
Translates an offset into the components text to a line 0-based number. |
javax.swing.text.Style |
getLogicalStyle(int p)
|
java.lang.String |
getMainClassName()
Returns the name of the main (public) class, if any. |
java.lang.String |
getName()
Returns the name of the file for this document with an appended asterisk (if modified) or spaces |
int |
getNumberOfLines()
|
int |
getOffsetOfLine(int line)
Translates a 0-based line number into an offset. |
java.lang.String |
getPackageName()
|
java.lang.String |
getPackageNameFromDocument()
|
java.awt.print.Pageable |
getPageable()
Returns the Pageable object for printing. |
javax.swing.text.Element |
getParagraphElement(int pos)
|
java.io.File |
getParentDirectory()
Returns the parent directory of this file, null if it has none. |
java.lang.Object |
getProperty(java.lang.Object key)
|
java.lang.String |
getQualifiedClassName()
|
java.lang.String |
getQualifiedClassName(int pos)
|
java.io.File |
getRawFile()
Returns the file field for this document; does not check whether the file is NullFile or file exists. |
ReducedModelControl |
getReduced()
|
javax.swing.text.Element[] |
getRootElements()
|
java.io.File |
getSourceRoot()
Finds the root directory for the source file for this document; null if document is Untitled. |
javax.swing.text.Position |
getStartPosition()
The following two methods are in javax.swing.Document. |
ReducedModelState |
getStateAtCurrent()
|
javax.swing.text.Style |
getStyle(java.lang.String nm)
|
java.lang.String |
getText()
Gets the text of this. |
java.lang.String |
getText(int offset,
int length)
Gets the specified substring of this. |
void |
getText(int offset,
int length,
javax.swing.text.Segment txt)
|
long |
getTimestamp()
Returns the timestamp. |
javax.swing.event.UndoableEditListener[] |
getUndoableEditListeners()
|
CompoundUndoManager |
getUndoManager()
Decorator pattern for the definitions document. |
int |
gotoLine(int line)
Moves the definitions document to the given line, and returns the resulting character position. |
void |
indentLines(int selStart,
int selEnd)
Default indentation - uses OTHER flag and no progress indicator. |
void |
indentLines(int selStart,
int selEnd,
Indenter.IndentReason reason,
javax.swing.ProgressMonitor pm)
Parameterized indentation for special-case handling. |
boolean |
inNewProjectPath(java.io.File projRoot)
An open file is in the new project if the source root is the same as the new project root. |
boolean |
inProject()
A file is in the project if it is explicitly listed as part of the project. |
boolean |
inProjectPath()
A file is in the project if the source root is the same as the project root. |
void |
insertString(int offset,
java.lang.String str,
javax.swing.text.AttributeSet a)
Inserts a string of text into the document. |
boolean |
isAuxiliaryFile()
|
boolean |
isEmpty()
Determines if the document is empty. |
boolean |
isModifiedSinceSave()
Determines if the document has been modified since the last save. |
boolean |
isReady()
Returns true if 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 |
isUntitledAndEmpty()
|
protected DDReconstructor |
makeReconstructor()
Makes a default DDReconstructor that will make the corresponding DefinitionsDocument. |
boolean |
modifiedOnDisk()
Determines if the file for this document has been modified since it was loaded. |
void |
move(int dist)
Moves the current location the specified number of chars (positive is right; negative is left). |
void |
preparePrintJob()
This method tells the document to prepare all the DrJavaBook and PagePrinter objects. |
void |
print()
Prints the given document by bringing up a "Print" window. |
void |
putProperty(java.lang.Object key,
java.lang.Object value)
|
boolean |
quitFile()
Fires the quit(File) event if isModifiedSinceSave() is true. |
void |
remove(int offs,
int len)
Removes a block of text from the specified location. |
void |
removeBrowserRegion(BrowserDocumentRegion r)
Removes region r from the browserRegions collection |
void |
removeDocumentListener(javax.swing.event.DocumentListener listener)
|
void |
removeFromDebugger()
throws UnsupportedOperationException |
void |
removeStyle(java.lang.String nm)
|
void |
removeUndoableEditListener(javax.swing.event.UndoableEditListener listener)
|
void |
render(java.lang.Runnable r)
|
void |
resetModification()
Whenever this document has been saved, this method should be called to update its "isModified" information. |
void |
resetUndoManager()
|
void |
revertFile()
Reverts current ODD to file content on disk. |
boolean |
revertIfModifiedOnDisk()
Determines if the definitions document has been changed by an outside agent. |
void |
runApplet(java.lang.String className)
throws UnsupportedOperationException |
void |
runMain(java.lang.String className)
throws UnsupportedOperationException |
void |
runSmart(java.lang.String className)
throws UnsupportedOperationException |
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 classFile)
|
void |
setCharacterAttributes(int offset,
int length,
javax.swing.text.AttributeSet s,
boolean replace)
|
void |
setClassFileInSync(boolean inSync)
|
void |
setCurrentLocation(int location)
Forwarding method to sync the definitions with whatever view component is representing them. |
void |
setFile(java.io.File file)
Sets the file for this openDefinitionsDocument. |
void |
setIndent(int indent)
Sets the indent to a particular number of spaces. |
(package private) void |
setInitialHScroll(int i)
|
(package private) void |
setInitialSelEnd(int i)
|
(package private) void |
setInitialSelStart(int i)
|
(package private) void |
setInitialVScroll(int i)
|
void |
setLogicalStyle(int pos,
javax.swing.text.Style s)
|
void |
setPackage(java.lang.String name)
Sets the cached _packageName for the preceding method. |
void |
setParagraphAttributes(int offset,
int length,
javax.swing.text.AttributeSet s,
boolean replace)
|
void |
setParentDirectory(java.io.File pd)
Sets the parent directory of the document only if it is "Untitled" |
void |
startCompile()
throws UnsupportedOperationException |
void |
startJUnit()
throws UnsupportedOperationException |
java.lang.String |
toString()
|
int |
uncommentLines(int selStart,
int selEnd)
|
boolean |
undoManagerCanRedo()
If the undo manager is unavailable, no redos are available |
boolean |
undoManagerCanUndo()
If the undo manager is unavailable, no undos are available |
void |
updateModifiedSinceSave()
Originally designed to allow undoManager to set the current document to be modified whenever an undo or redo is performed. |
void |
updateSyntaxHighlighting()
Update the syntax highlighting for the file type. |
boolean |
verifyExists()
Returns true if the file exists on disk. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private volatile java.lang.String _image
private volatile java.io.File _file
private volatile long _timestamp
private volatile java.io.File _parentDir
private volatile java.io.File _classFile
private volatile boolean _classFileInSync
protected volatile java.lang.String _packageName
protected volatile java.lang.String _lexiName
private volatile DCacheAdapter _cacheAdapter
protected final java.util.Set<BrowserDocumentRegion> _browserRegions
private volatile int _initVScroll
private volatile int _initHScroll
private volatile int _initSelStart
private volatile int _initSelEnd
private volatile DrJavaBook _book
protected int _caretPosition
| Constructor Detail |
|---|
AbstractGlobalModel.ConcreteOpenDefDoc(java.io.File f)
f - file describing DefinitionsDocument to manage; should be in canonical formAbstractGlobalModel.ConcreteOpenDefDoc(NullFile f)
private AbstractGlobalModel.ConcreteOpenDefDoc(java.io.File f,
java.io.File dir,
long stamp)
| Method Detail |
|---|
public void addBrowserRegion(BrowserDocumentRegion r)
OpenDefinitionsDocument
addBrowserRegion in interface OpenDefinitionsDocumentpublic void removeBrowserRegion(BrowserDocumentRegion r)
OpenDefinitionsDocument
removeBrowserRegion in interface OpenDefinitionsDocumentpublic java.io.File getRawFile()
getRawFile in interface OpenDefinitionsDocument
public java.io.File getFile()
throws FileMovedException
getFile in interface OpenDefinitionsDocumentFileMovedException - if the document's file no longer existspublic void setFile(java.io.File file)
setFile in interface OpenDefinitionsDocumentfile - the file that this OpenDefinitionsDocument is associated withpublic void updateSyntaxHighlighting()
updateSyntaxHighlighting in interface OpenDefinitionsDocumentpublic long getTimestamp()
getTimestamp in interface OpenDefinitionsDocumentpublic void setClassFileInSync(boolean inSync)
setClassFileInSync in interface OpenDefinitionsDocumentpublic boolean getClassFileInSync()
getClassFileInSync in interface OpenDefinitionsDocumentpublic void setCachedClassFile(java.io.File classFile)
setCachedClassFile in interface OpenDefinitionsDocumentpublic java.io.File getCachedClassFile()
getCachedClassFile in interface OpenDefinitionsDocumentpublic void resetModification()
resetModification in interface OpenDefinitionsDocumentpublic java.io.File getParentDirectory()
OpenDefinitionsDocument
getParentDirectory in interface OpenDefinitionsDocumentpublic void setParentDirectory(java.io.File pd)
pd - The parent directorypublic int getInitialVerticalScroll()
getInitialVerticalScroll in interface OpenDefinitionsDocumentpublic int getInitialHorizontalScroll()
getInitialHorizontalScroll in interface OpenDefinitionsDocumentpublic int getInitialSelectionStart()
getInitialSelectionStart in interface OpenDefinitionsDocumentpublic int getInitialSelectionEnd()
getInitialSelectionEnd in interface OpenDefinitionsDocumentvoid setInitialVScroll(int i)
void setInitialHScroll(int i)
void setInitialSelStart(int i)
void setInitialSelEnd(int i)
public DefinitionsDocument getDocument()
getDocument in interface OpenDefinitionsDocument
public java.lang.String getFirstTopLevelClassName()
throws ClassNameNotFoundException
getFirstTopLevelClassName in interface OpenDefinitionsDocumentClassNameNotFoundException - if no top level class name found.
public java.lang.String getMainClassName()
throws ClassNameNotFoundException
ClassNameNotFoundException - if no top level class name found.public java.lang.String getFileName()
getFileName in interface OpenDefinitionsDocumentpublic java.lang.String getName()
getName in interface INavigatorItempublic java.lang.String getCanonicalPath()
getCanonicalPath in interface OpenDefinitionsDocumentpublic java.lang.String getCompletePath()
getCompletePath in interface OpenDefinitionsDocument
public java.io.File getSourceRoot()
throws InvalidPackageException
getSourceRoot in interface OpenDefinitionsDocumentInvalidPackageException - if the package statement is invalid,
or if it does not match up with the location of the source file.public java.lang.String getPackageName()
getPackageName in interface OpenDefinitionsDocumentpublic void setPackage(java.lang.String name)
setPackage in interface OpenDefinitionsDocumentpublic java.lang.String getPackageNameFromDocument()
getPackageNameFromDocument in interface OpenDefinitionsDocumentpublic void updateModifiedSinceSave()
updateModifiedSinceSave in interface OpenDefinitionsDocumentpublic java.lang.String getLexiName()
getLexiName in interface OpenDefinitionsDocument
public java.awt.print.Pageable getPageable()
throws java.lang.IllegalStateException
getPageable in interface OpenDefinitionsDocumentjava.lang.IllegalStateExceptionpublic void cleanUpPrintJob()
cleanUpPrintJob in interface OpenDefinitionsDocumentpublic boolean inProjectPath()
inProjectPath in interface OpenDefinitionsDocumentpublic boolean inNewProjectPath(java.io.File projRoot)
inNewProjectPath in interface OpenDefinitionsDocumentpublic boolean inProject()
inProject in interface OpenDefinitionsDocumentinProject in interface INavigatorItempublic boolean isEmpty()
isEmpty in interface OpenDefinitionsDocumentpublic boolean isAuxiliaryFile()
isAuxiliaryFile in interface OpenDefinitionsDocumentisAuxiliaryFile in interface INavigatorItempublic boolean isSourceFile()
isSourceFile in interface OpenDefinitionsDocumentpublic boolean isUntitled()
isUntitled in interface OpenDefinitionsDocumentisUntitled in interface INavigatorItempublic boolean isUntitledAndEmpty()
public boolean fileExists()
fileExists in interface OpenDefinitionsDocumentfileExists in interface INavigatorItempublic boolean verifyExists()
verifyExists in interface OpenDefinitionsDocumentprotected DDReconstructor makeReconstructor()
public boolean saveFile(FileSaveSelector com)
throws java.io.IOException
saveFile in interface OpenDefinitionsDocumentcom - a selector that picks the file name if the doc is untitled
java.io.IOException
public boolean saveFileAs(FileSaveSelector com)
throws java.io.IOException
saveFileAs in interface OpenDefinitionsDocumentcom - a selector that picks the file name.
java.io.IOException - if the save fails due to an IO error
public void preparePrintJob()
throws javax.swing.text.BadLocationException,
FileMovedException
preparePrintJob in interface OpenDefinitionsDocumentjavax.swing.text.BadLocationException
FileMovedException
public void print()
throws java.awt.print.PrinterException,
javax.swing.text.BadLocationException,
FileMovedException
print in interface OpenDefinitionsDocumentjava.awt.print.PrinterException
javax.swing.text.BadLocationException
FileMovedException
public void startCompile()
throws java.io.IOException
startCompile in interface OpenDefinitionsDocumentjava.io.IOException - if a file with errors cannot be opened
public void runMain(java.lang.String className)
throws java.io.IOException,
ClassNameNotFoundException
runMain in interface OpenDefinitionsDocumentclassName - - the fully qualified name of the class contained in this document to run the main(String[]) method of
java.io.IOException - propagated from GlobalModel.compileAll()
ClassNameNotFoundException - propagated from getFirstTopLevelClass()
public void runApplet(java.lang.String className)
throws java.io.IOException,
ClassNameNotFoundException
runApplet in interface OpenDefinitionsDocumentclassName - - the fully qualified name of the class contained in this document that will be run as applet
java.io.IOException - propagated from GlobalModel.compileAll()
ClassNameNotFoundException - propagated from getFirstTopLevelClass()
public void runSmart(java.lang.String className)
throws java.io.IOException,
ClassNameNotFoundException
runSmart in interface OpenDefinitionsDocumentclassName - the qualified name of the class (in this document) to run. If NULL, it is the name
of the top level class.
java.io.IOException - propagated from GlobalModel.compileAll()
ClassNameNotFoundException - propagated from getFirstTopLevelClass()
public void startJUnit()
throws java.io.IOException,
java.lang.ClassNotFoundException
startJUnit in interface OpenDefinitionsDocumentjava.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.
public void generateJavadoc(FileSaveSelector saver)
throws java.io.IOException
generateJavadoc in interface OpenDefinitionsDocumentsaver - FileSaveSelector for saving the file if it needs to be saved
java.io.IOExceptionpublic boolean isReady()
isReady in interface OpenDefinitionsDocumentpublic boolean isModifiedSinceSave()
isModifiedSinceSave in interface OpenDefinitionsDocumentpublic void documentSaved()
OpenDefinitionsDocument
documentSaved in interface OpenDefinitionsDocumentpublic void documentModified()
OpenDefinitionsDocument
documentModified in interface OpenDefinitionsDocumentpublic void documentReset()
OpenDefinitionsDocument
documentReset in interface OpenDefinitionsDocumentpublic boolean modifiedOnDisk()
modifiedOnDisk in interface OpenDefinitionsDocumentpublic boolean checkIfClassFileInSync()
checkIfClassFileInSync in interface OpenDefinitionsDocumentcheckIfClassFileInSync in interface INavigatorItemprivate java.io.File _locateClassFile()
public boolean revertIfModifiedOnDisk()
throws java.io.IOException
revertIfModifiedOnDisk in interface OpenDefinitionsDocumentjava.io.IOExceptionpublic void close()
close in interface OpenDefinitionsDocument
public void revertFile()
throws java.io.IOException
revertFile in interface OpenDefinitionsDocumentjava.io.IOExceptionpublic boolean canAbandonFile()
canAbandonFile in interface OpenDefinitionsDocumentpublic boolean quitFile()
quitFile in interface OpenDefinitionsDocumentpublic int gotoLine(int line)
gotoLine in interface OpenDefinitionsDocumentline - Destination line number. If it exceeds the number of lines in the document, it is
interpreted as the last line.
public void setCurrentLocation(int location)
setCurrentLocation in interface DJDocumentlocation - the new absolute locationpublic int getCurrentLocation()
getCurrentLocation in interface DJDocumentpublic int getCaretPosition()
getCaretPosition in interface OpenDefinitionsDocumentpublic int balanceBackward()
balanceBackward in interface DJDocumentpublic int balanceForward()
balanceForward in interface DJDocumentpublic RegionManager<Breakpoint> getBreakpointManager()
getBreakpointManager in interface OpenDefinitionsDocumentpublic RegionManager<MovingDocumentRegion> getBookmarkManager()
getBookmarkManager in interface OpenDefinitionsDocumentpublic void clearBrowserRegions()
clearBrowserRegions in interface OpenDefinitionsDocumentpublic void removeFromDebugger()
removeFromDebugger in interface OpenDefinitionsDocumentpublic java.lang.String toString()
toString in class java.lang.Objectpublic int compareTo(OpenDefinitionsDocument o)
compareTo in interface java.lang.Comparable<OpenDefinitionsDocument>public void addDocumentListener(javax.swing.event.DocumentListener listener)
addDocumentListener in interface javax.swing.text.Documentpublic void addUndoableEditListener(javax.swing.event.UndoableEditListener listener)
addUndoableEditListener in interface javax.swing.text.Documentpublic void removeUndoableEditListener(javax.swing.event.UndoableEditListener listener)
removeUndoableEditListener in interface javax.swing.text.Documentpublic javax.swing.event.UndoableEditListener[] getUndoableEditListeners()
getUndoableEditListeners in interface OpenDefinitionsDocument
public javax.swing.text.Position createUnwrappedPosition(int offs)
throws javax.swing.text.BadLocationException
OpenDefinitionsDocument
createUnwrappedPosition in interface OpenDefinitionsDocumentjavax.swing.text.BadLocationException
public javax.swing.text.Position createPosition(int offs)
throws javax.swing.text.BadLocationException
AbstractDocumentInterface
createPosition in interface AbstractDocumentInterfacecreatePosition in interface javax.swing.text.Documentjavax.swing.text.BadLocationExceptionpublic javax.swing.text.Element getDefaultRootElement()
getDefaultRootElement in interface javax.swing.text.Documentpublic javax.swing.text.Position getStartPosition()
getStartPosition in interface javax.swing.text.Documentpublic javax.swing.text.Position getEndPosition()
getEndPosition in interface javax.swing.text.Documentpublic int getLength()
getLength in interface AbstractDocumentInterfacegetLength in interface javax.swing.text.Documentpublic java.lang.Object getProperty(java.lang.Object key)
getProperty in interface javax.swing.text.Documentpublic javax.swing.text.Element[] getRootElements()
getRootElements in interface javax.swing.text.Documentpublic java.lang.String getText()
getText in interface DJDocumentgetText in interface AbstractDocumentInterface
public java.lang.String getText(int offset,
int length)
throws javax.swing.text.BadLocationException
getText in interface AbstractDocumentInterfacegetText in interface javax.swing.text.Documentjavax.swing.text.BadLocationException
public void getText(int offset,
int length,
javax.swing.text.Segment txt)
throws javax.swing.text.BadLocationException
getText in interface javax.swing.text.Documentjavax.swing.text.BadLocationException
public void insertString(int offset,
java.lang.String str,
javax.swing.text.AttributeSet a)
throws javax.swing.text.BadLocationException
DJDocumentAbstractDJDocument.insertUpdate(javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AttributeSet).
insertString in interface DJDocumentinsertString in interface AbstractDocumentInterfaceinsertString in interface javax.swing.text.Documentjavax.swing.text.BadLocationException
public void append(java.lang.String str,
javax.swing.text.AttributeSet set)
AbstractDocumentInterface
append in interface AbstractDocumentInterface
public void append(java.lang.String str,
javax.swing.text.Style style)
public void append(java.lang.String str)
public void putProperty(java.lang.Object key,
java.lang.Object value)
putProperty in interface javax.swing.text.Document
public void remove(int offs,
int len)
throws javax.swing.text.BadLocationException
DJDocumentAbstractDJDocument.removeUpdate(javax.swing.text.AbstractDocument.DefaultDocumentEvent).
remove in interface DJDocumentremove in interface AbstractDocumentInterfaceremove in interface javax.swing.text.Documentjavax.swing.text.BadLocationExceptionpublic void removeDocumentListener(javax.swing.event.DocumentListener listener)
removeDocumentListener in interface javax.swing.text.Documentpublic void render(java.lang.Runnable r)
render in interface javax.swing.text.Documentpublic boolean undoManagerCanUndo()
undoManagerCanUndo in interface OpenDefinitionsDocumentpublic boolean undoManagerCanRedo()
undoManagerCanRedo in interface OpenDefinitionsDocumentpublic CompoundUndoManager getUndoManager()
getUndoManager in interface OpenDefinitionsDocumentpublic int _getLineStartPos(int pos)
_getLineStartPos in interface DJDocumentpos - Any position on the current line
public int _getLineEndPos(int pos)
_getLineEndPos in interface DJDocumentpos - Any position on the current line
public int commentLines(int selStart,
int selEnd)
OpenDefinitionsDocument
commentLines in interface OpenDefinitionsDocument
public int uncommentLines(int selStart,
int selEnd)
uncommentLines in interface OpenDefinitionsDocument
public void indentLines(int selStart,
int selEnd)
DJDocument
indentLines in interface DJDocumentselStart - the offset of the initial character of the region to indentselEnd - the offset of the last character of the region to indent
public void indentLines(int selStart,
int selEnd,
Indenter.IndentReason reason,
javax.swing.ProgressMonitor pm)
throws OperationCanceledException
DJDocument
indentLines in interface DJDocumentselStart - the offset of the initial character of the region to indentselEnd - the offset of the last character of the region to indentreason - a flag from Indenter
to indicate the reason for the indent (indent logic may vary slightly based on the trigger action)pm - used to display progress, null if no reporting is desired
OperationCanceledExceptionpublic int getCurrentLine()
getCurrentLine in interface OpenDefinitionsDocumentpublic int getCurrentCol()
getCurrentCol in interface OpenDefinitionsDocument
public int getIntelligentBeginLinePos(int currPos)
throws javax.swing.text.BadLocationException
DJDocument
getIntelligentBeginLinePos in interface DJDocumentcurrPos - A position on the current line
javax.swing.text.BadLocationExceptionpublic int _getOffset(int lineNum)
_getOffset in interface OpenDefinitionsDocument
public java.lang.String getQualifiedClassName()
throws ClassNameNotFoundException
getQualifiedClassName in interface OpenDefinitionsDocumentClassNameNotFoundException
public java.lang.String getQualifiedClassName(int pos)
throws ClassNameNotFoundException
getQualifiedClassName in interface OpenDefinitionsDocumentClassNameNotFoundExceptionpublic ReducedModelState getStateAtCurrent()
getStateAtCurrent in interface DJDocumentpublic void resetUndoManager()
resetUndoManager in interface OpenDefinitionsDocumentpublic javax.swing.event.DocumentListener[] getDocumentListeners()
getDocumentListeners in interface OpenDefinitionsDocument
public java.lang.String getEnclosingClassName(int pos,
boolean fullyQualified)
throws javax.swing.text.BadLocationException,
ClassNameNotFoundException
OpenDefinitionsDocument
getEnclosingClassName in interface OpenDefinitionsDocumentpos - Position to start fromfullyQualified - true to find the fully qualified class name
javax.swing.text.BadLocationException
ClassNameNotFoundException
public int findPrevEnclosingBrace(int pos,
char opening,
char closing)
throws javax.swing.text.BadLocationException
findPrevEnclosingBrace in interface DJDocumentpos - Position to start fromopening - opening brace characterclosing - closing brace character
javax.swing.text.BadLocationException
public int findNextEnclosingBrace(int pos,
char opening,
char closing)
throws javax.swing.text.BadLocationException
findNextEnclosingBrace in interface DJDocumentpos - Position to start fromopening - opening brace characterclosing - closing brace character
javax.swing.text.BadLocationException
public int getFirstNonWSCharPos(int pos)
throws javax.swing.text.BadLocationException
getFirstNonWSCharPos in interface DJDocumentpos - Position to start from
javax.swing.text.BadLocationException
public int getFirstNonWSCharPos(int pos,
boolean acceptComments)
throws javax.swing.text.BadLocationException
getFirstNonWSCharPos in interface DJDocumentpos - Position to start fromacceptComments - if true, find non-whitespace chars in comments
javax.swing.text.BadLocationException
public int getFirstNonWSCharPos(int pos,
char[] whitespace,
boolean acceptComments)
throws javax.swing.text.BadLocationException
getFirstNonWSCharPos in interface DJDocumentpos - Position to start fromwhitespace - array of whitespace chars to ignoreacceptComments - if true, find non-whitespace chars in comments
javax.swing.text.BadLocationException
public int _getLineFirstCharPos(int pos)
throws javax.swing.text.BadLocationException
_getLineFirstCharPos in interface DJDocumentpos - position on the line
javax.swing.text.BadLocationException
public int findCharOnLine(int pos,
char findChar)
findCharOnLine in interface DJDocumentpos - Cursor positionfindChar - Character to search for
public int _getIndentOfCurrStmt(int pos)
throws javax.swing.text.BadLocationException
_getIndentOfCurrStmt in interface DJDocumentpos - Cursor position
javax.swing.text.BadLocationException
public int _getIndentOfCurrStmt(int pos,
char[] delims)
throws javax.swing.text.BadLocationException
_getIndentOfCurrStmt in interface DJDocumentpos - Cursor position
javax.swing.text.BadLocationException
public int _getIndentOfCurrStmt(int pos,
char[] delims,
char[] whitespace)
throws javax.swing.text.BadLocationException
_getIndentOfCurrStmt in interface DJDocumentpos - Cursor positiondelims - Delimiter characters denoting end of statementwhitespace - characters to skip when looking for beginning of next statement
javax.swing.text.BadLocationException
public int findPrevDelimiter(int pos,
char[] delims)
throws javax.swing.text.BadLocationException
DJDocument
findPrevDelimiter in interface DJDocumentpos - Position to start fromdelims - array of characters to search for
javax.swing.text.BadLocationException
public int findPrevDelimiter(int pos,
char[] delims,
boolean skipParenPhrases)
throws javax.swing.text.BadLocationException
DJDocument
findPrevDelimiter in interface DJDocumentpos - Position to start fromdelims - array of characters to search forskipParenPhrases - whether to look for delimiters inside paren phrases
(eg. semicolons in a for statement)
javax.swing.text.BadLocationExceptionpublic void move(int dist)
DJDocument
move in interface DJDocumentdist - the distance from the current location to the new location.
public java.util.ArrayList<HighlightStatus> getHighlightStatus(int start,
int end)
DJDocument
getHighlightStatus in interface DJDocumentpublic void setIndent(int indent)
DJDocument
setIndent in interface DJDocumentindent - the size of indent that you want for the documentpublic int getIndent()
DJDocument
getIndent in interface DJDocumentpublic void addFinalizationListener(FinalizationListener<DefinitionsDocument> fl)
addFinalizationListener in interface Finalizable<DefinitionsDocument>fl - the finalization listener to be notified when this object is garbage collectedpublic java.util.List<FinalizationListener<DefinitionsDocument>> getFinalizationListeners()
getFinalizationListeners in interface Finalizable<DefinitionsDocument>public java.awt.Font getFont(javax.swing.text.AttributeSet attr)
getFont in interface javax.swing.text.StyledDocumentpublic java.awt.Color getBackground(javax.swing.text.AttributeSet attr)
getBackground in interface javax.swing.text.StyledDocumentpublic java.awt.Color getForeground(javax.swing.text.AttributeSet attr)
getForeground in interface javax.swing.text.StyledDocumentpublic javax.swing.text.Element getCharacterElement(int pos)
getCharacterElement in interface javax.swing.text.StyledDocumentpublic javax.swing.text.Element getParagraphElement(int pos)
getParagraphElement in interface javax.swing.text.StyledDocumentpublic javax.swing.text.Style getLogicalStyle(int p)
getLogicalStyle in interface javax.swing.text.StyledDocument
public void setLogicalStyle(int pos,
javax.swing.text.Style s)
setLogicalStyle in interface javax.swing.text.StyledDocument
public void setCharacterAttributes(int offset,
int length,
javax.swing.text.AttributeSet s,
boolean replace)
setCharacterAttributes in interface javax.swing.text.StyledDocument
public void setParagraphAttributes(int offset,
int length,
javax.swing.text.AttributeSet s,
boolean replace)
setParagraphAttributes in interface javax.swing.text.StyledDocumentpublic javax.swing.text.Style getStyle(java.lang.String nm)
getStyle in interface javax.swing.text.StyledDocumentpublic void removeStyle(java.lang.String nm)
removeStyle in interface javax.swing.text.StyledDocument
public javax.swing.text.Style addStyle(java.lang.String nm,
javax.swing.text.Style parent)
addStyle in interface javax.swing.text.StyledDocumentpublic void clear()
DJDocument
clear in interface DJDocumentpublic ReducedModelControl getReduced()
getReduced in interface DJDocumentpublic int getNumberOfLines()
getNumberOfLines in interface OpenDefinitionsDocumentpublic boolean isShadowed(int pos)
isShadowed in interface OpenDefinitionsDocumentpublic int getLineOfOffset(int offset)
getLineOfOffset in interface OpenDefinitionsDocumentoffset - the offset >= 0
public int getOffsetOfLine(int line)
getOffsetOfLine in interface OpenDefinitionsDocumentline - number >= 0
public boolean containsClassOrInterfaceOrEnum()
throws javax.swing.text.BadLocationException
containsClassOrInterfaceOrEnum in interface OpenDefinitionsDocumentjavax.swing.text.BadLocationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||