|
||||||||||
| 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 Set<BrowserDocumentRegion> |
_browserRegions
This document's browser regions. |
private DCacheAdapter |
_cacheAdapter
|
protected int |
_caretPosition
|
private 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 File |
_file
|
private 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 String |
_lexiName
The fully qualified name of the class with '.' converted to ' ' so that alphabetic ordering works properly. |
protected String |
_packageName
The package name embedded in the document the last time is was loaded, reconstructed, or saved. |
private 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(File f)
Standard constructor for a document read from a file. |
private |
AbstractGlobalModel.ConcreteOpenDefDoc(File f,
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 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(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. |
Style |
addStyle(String nm,
Style parent)
|
void |
addUndoableEditListener(UndoableEditListener listener)
|
void |
append(String str)
|
void |
append(String str,
AttributeSet set)
Appends given string with specified attributes to end of this document. |
void |
append(String str,
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. |
Position |
createPosition(int offs)
Creates a "sticky" position within a document |
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 |
Color |
getBackground(AttributeSet attr)
|
RegionManager<MovingDocumentRegion> |
getBookmarkManager()
|
RegionManager<Breakpoint> |
getBreakpointManager()
|
File |
getCachedClassFile()
|
String |
getCanonicalPath()
Returns the canonical path for this document, "(Untitled)" if unsaved), "" if the file path is ill-formed. |
int |
getCaretPosition()
|
Element |
getCharacterElement(int pos)
|
boolean |
getClassFileInSync()
|
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. |
Element |
getDefaultRootElement()
|
DefinitionsDocument |
getDocument()
Gets the definitions document being handled. |
DocumentListener[] |
getDocumentListeners()
|
String |
getEnclosingClassName(int pos,
boolean fullyQualified)
Searching backwards finds the name of the enclosing named class or interface. |
Position |
getEndPosition()
|
File |
getFile()
Returns the file for this document, null if the document is untitled. |
String |
getFileName()
Returns the name of this file, or "(Untitled)" if no file. |
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. |
String |
getFirstTopLevelClassName()
Returns the name of the top level class, if any. |
Font |
getFont(AttributeSet attr)
|
Color |
getForeground(AttributeSet attr)
|
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()
|
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. |
Style |
getLogicalStyle(int p)
|
String |
getMainClassName()
Returns the name of the main (public) class, if any. |
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. |
String |
getPackageName()
|
String |
getPackageNameFromDocument()
|
Pageable |
getPageable()
Returns the Pageable object for printing. |
Element |
getParagraphElement(int pos)
|
File |
getParentDirectory()
Returns the parent directory of this file, null if it has none. |
Object |
getProperty(Object key)
|
String |
getQualifiedClassName()
|
String |
getQualifiedClassName(int pos)
|
File |
getRawFile()
Returns the file field for this document; does not check whether the file is NullFile or file exists. |
ReducedModelControl |
getReduced()
|
Element[] |
getRootElements()
|
File |
getSourceRoot()
Finds the root directory for the source file for this document; null if document is Untitled. |
Position |
getStartPosition()
The following two methods are in javax.swing.Document. |
ReducedModelState |
getStateAtCurrent()
|
Style |
getStyle(String nm)
|
String |
getText()
Gets the text of this. |
String |
getText(int offset,
int length)
Gets the specified substring of this. |
void |
getText(int offset,
int length,
Segment txt)
|
long |
getTimestamp()
Returns the timestamp. |
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,
ProgressMonitor pm)
Parameterized indentation for special-case handling. |
boolean |
inNewProjectPath(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,
String str,
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(Object key,
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(DocumentListener listener)
|
void |
removeFromDebugger()
throws UnsupportedOperationException |
void |
removeStyle(String nm)
|
void |
removeUndoableEditListener(UndoableEditListener listener)
|
void |
render(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(String className)
throws UnsupportedOperationException |
void |
runMain(String className)
throws UnsupportedOperationException |
void |
runSmart(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(File classFile)
|
void |
setCharacterAttributes(int offset,
int length,
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(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,
Style s)
|
void |
setPackage(String name)
Sets the cached _packageName for the preceding method. |
void |
setParagraphAttributes(int offset,
int length,
AttributeSet s,
boolean replace)
|
void |
setParentDirectory(File pd)
Sets the parent directory of the document only if it is "Untitled" |
void |
startCompile()
throws UnsupportedOperationException |
void |
startJUnit()
throws UnsupportedOperationException |
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 String _image
private volatile File _file
private volatile long _timestamp
private volatile File _parentDir
private volatile File _classFile
private volatile boolean _classFileInSync
protected volatile String _packageName
protected volatile String _lexiName
private volatile DCacheAdapter _cacheAdapter
protected final 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(File f)
f - file describing DefinitionsDocument to manage; should be in canonical formAbstractGlobalModel.ConcreteOpenDefDoc(NullFile f)
private AbstractGlobalModel.ConcreteOpenDefDoc(File f,
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 File getRawFile()
getRawFile in interface OpenDefinitionsDocument
public File getFile()
throws FileMovedException
getFile in interface OpenDefinitionsDocumentFileMovedException - if the document's file no longer existspublic void setFile(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(File classFile)
setCachedClassFile in interface OpenDefinitionsDocumentpublic File getCachedClassFile()
getCachedClassFile in interface OpenDefinitionsDocumentpublic void resetModification()
resetModification in interface OpenDefinitionsDocumentpublic File getParentDirectory()
OpenDefinitionsDocument
getParentDirectory in interface OpenDefinitionsDocumentpublic void setParentDirectory(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 String getFirstTopLevelClassName()
throws ClassNameNotFoundException
getFirstTopLevelClassName in interface OpenDefinitionsDocumentClassNameNotFoundException - if no top level class name found.
public String getMainClassName()
throws ClassNameNotFoundException
ClassNameNotFoundException - if no top level class name found.public String getFileName()
getFileName in interface OpenDefinitionsDocumentpublic String getName()
getName in interface INavigatorItempublic String getCanonicalPath()
getCanonicalPath in interface OpenDefinitionsDocumentpublic String getCompletePath()
getCompletePath in interface OpenDefinitionsDocument
public 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 String getPackageName()
getPackageName in interface OpenDefinitionsDocumentpublic void setPackage(String name)
setPackage in interface OpenDefinitionsDocumentpublic String getPackageNameFromDocument()
getPackageNameFromDocument in interface OpenDefinitionsDocumentpublic void updateModifiedSinceSave()
updateModifiedSinceSave in interface OpenDefinitionsDocumentpublic String getLexiName()
getLexiName in interface OpenDefinitionsDocument
public Pageable getPageable()
throws IllegalStateException
getPageable in interface OpenDefinitionsDocumentIllegalStateExceptionpublic void cleanUpPrintJob()
cleanUpPrintJob in interface OpenDefinitionsDocumentpublic boolean inProjectPath()
inProjectPath in interface OpenDefinitionsDocumentpublic boolean inNewProjectPath(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 IOException
saveFile in interface OpenDefinitionsDocumentcom - a selector that picks the file name if the doc is untitled
IOException
public boolean saveFileAs(FileSaveSelector com)
throws IOException
saveFileAs in interface OpenDefinitionsDocumentcom - a selector that picks the file name.
IOException - if the save fails due to an IO error
public void preparePrintJob()
throws BadLocationException,
FileMovedException
preparePrintJob in interface OpenDefinitionsDocumentBadLocationException
FileMovedException
public void print()
throws PrinterException,
BadLocationException,
FileMovedException
print in interface OpenDefinitionsDocumentPrinterException
BadLocationException
FileMovedException
public void startCompile()
throws IOException
startCompile in interface OpenDefinitionsDocumentIOException - if a file with errors cannot be opened
public void runMain(String className)
throws IOException,
ClassNameNotFoundException
runMain in interface OpenDefinitionsDocumentclassName - - the fully qualified name of the class contained in this document to run the main(String[]) method of
IOException - propagated from GlobalModel.compileAll()
ClassNameNotFoundException - propagated from getFirstTopLevelClass()
public void runApplet(String className)
throws IOException,
ClassNameNotFoundException
runApplet in interface OpenDefinitionsDocumentclassName - - the fully qualified name of the class contained in this document that will be run as applet
IOException - propagated from GlobalModel.compileAll()
ClassNameNotFoundException - propagated from getFirstTopLevelClass()
public void runSmart(String className)
throws 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.
IOException - propagated from GlobalModel.compileAll()
ClassNameNotFoundException - propagated from getFirstTopLevelClass()
public void startJUnit()
throws IOException,
ClassNotFoundException
startJUnit in interface OpenDefinitionsDocumentIOException - if a file with errors cannot be opened
ClassNotFoundException - when the class is compiled to a location not on the classpath.
public void generateJavadoc(FileSaveSelector saver)
throws IOException
generateJavadoc in interface OpenDefinitionsDocumentsaver - FileSaveSelector for saving the file if it needs to be saved
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 File _locateClassFile()
public boolean revertIfModifiedOnDisk()
throws IOException
revertIfModifiedOnDisk in interface OpenDefinitionsDocumentIOExceptionpublic void close()
close in interface OpenDefinitionsDocument
public void revertFile()
throws IOException
revertFile in interface OpenDefinitionsDocumentIOExceptionpublic 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 String toString()
toString in class Objectpublic int compareTo(OpenDefinitionsDocument o)
compareTo in interface Comparable<OpenDefinitionsDocument>public void addDocumentListener(DocumentListener listener)
addDocumentListener in interface Documentpublic void addUndoableEditListener(UndoableEditListener listener)
addUndoableEditListener in interface Documentpublic void removeUndoableEditListener(UndoableEditListener listener)
removeUndoableEditListener in interface Documentpublic UndoableEditListener[] getUndoableEditListeners()
getUndoableEditListeners in interface OpenDefinitionsDocument
public Position createUnwrappedPosition(int offs)
throws BadLocationException
OpenDefinitionsDocument
createUnwrappedPosition in interface OpenDefinitionsDocumentBadLocationException
public Position createPosition(int offs)
throws BadLocationException
AbstractDocumentInterface
createPosition in interface AbstractDocumentInterfacecreatePosition in interface DocumentBadLocationExceptionpublic Element getDefaultRootElement()
getDefaultRootElement in interface Documentpublic Position getStartPosition()
getStartPosition in interface Documentpublic Position getEndPosition()
getEndPosition in interface Documentpublic int getLength()
getLength in interface AbstractDocumentInterfacegetLength in interface Documentpublic Object getProperty(Object key)
getProperty in interface Documentpublic Element[] getRootElements()
getRootElements in interface Documentpublic String getText()
getText in interface DJDocumentgetText in interface AbstractDocumentInterface
public String getText(int offset,
int length)
throws BadLocationException
getText in interface AbstractDocumentInterfacegetText in interface DocumentBadLocationException
public void getText(int offset,
int length,
Segment txt)
throws BadLocationException
getText in interface DocumentBadLocationException
public void insertString(int offset,
String str,
AttributeSet a)
throws BadLocationException
DJDocumentAbstractDJDocument.insertUpdate(javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AttributeSet).
insertString in interface DJDocumentinsertString in interface AbstractDocumentInterfaceinsertString in interface DocumentBadLocationException
public void append(String str,
AttributeSet set)
AbstractDocumentInterface
append in interface AbstractDocumentInterface
public void append(String str,
Style style)
public void append(String str)
public void putProperty(Object key,
Object value)
putProperty in interface Document
public void remove(int offs,
int len)
throws BadLocationException
DJDocumentAbstractDJDocument.removeUpdate(javax.swing.text.AbstractDocument.DefaultDocumentEvent).
remove in interface DJDocumentremove in interface AbstractDocumentInterfaceremove in interface DocumentBadLocationExceptionpublic void removeDocumentListener(DocumentListener listener)
removeDocumentListener in interface Documentpublic void render(Runnable r)
render in interface 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,
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 BadLocationException
DJDocument
getIntelligentBeginLinePos in interface DJDocumentcurrPos - A position on the current line
BadLocationExceptionpublic int _getOffset(int lineNum)
_getOffset in interface OpenDefinitionsDocument
public String getQualifiedClassName()
throws ClassNameNotFoundException
getQualifiedClassName in interface OpenDefinitionsDocumentClassNameNotFoundException
public String getQualifiedClassName(int pos)
throws ClassNameNotFoundException
getQualifiedClassName in interface OpenDefinitionsDocumentClassNameNotFoundExceptionpublic ReducedModelState getStateAtCurrent()
getStateAtCurrent in interface DJDocumentpublic void resetUndoManager()
resetUndoManager in interface OpenDefinitionsDocumentpublic DocumentListener[] getDocumentListeners()
getDocumentListeners in interface OpenDefinitionsDocument
public String getEnclosingClassName(int pos,
boolean fullyQualified)
throws BadLocationException,
ClassNameNotFoundException
OpenDefinitionsDocument
getEnclosingClassName in interface OpenDefinitionsDocumentpos - Position to start fromfullyQualified - true to find the fully qualified class name
BadLocationException
ClassNameNotFoundException
public int findPrevEnclosingBrace(int pos,
char opening,
char closing)
throws BadLocationException
findPrevEnclosingBrace in interface DJDocumentpos - Position to start fromopening - opening brace characterclosing - closing brace character
BadLocationException
public int findNextEnclosingBrace(int pos,
char opening,
char closing)
throws BadLocationException
findNextEnclosingBrace in interface DJDocumentpos - Position to start fromopening - opening brace characterclosing - closing brace character
BadLocationException
public int getFirstNonWSCharPos(int pos)
throws BadLocationException
getFirstNonWSCharPos in interface DJDocumentpos - Position to start from
BadLocationException
public int getFirstNonWSCharPos(int pos,
boolean acceptComments)
throws BadLocationException
getFirstNonWSCharPos in interface DJDocumentpos - Position to start fromacceptComments - if true, find non-whitespace chars in comments
BadLocationException
public int getFirstNonWSCharPos(int pos,
char[] whitespace,
boolean acceptComments)
throws BadLocationException
getFirstNonWSCharPos in interface DJDocumentpos - Position to start fromwhitespace - array of whitespace chars to ignoreacceptComments - if true, find non-whitespace chars in comments
BadLocationException
public int _getLineFirstCharPos(int pos)
throws BadLocationException
_getLineFirstCharPos in interface DJDocumentpos - position on the line
BadLocationException
public int findCharOnLine(int pos,
char findChar)
findCharOnLine in interface DJDocumentpos - Cursor positionfindChar - Character to search for
public int _getIndentOfCurrStmt(int pos)
throws BadLocationException
_getIndentOfCurrStmt in interface DJDocumentpos - Cursor position
BadLocationException
public int _getIndentOfCurrStmt(int pos,
char[] delims)
throws BadLocationException
_getIndentOfCurrStmt in interface DJDocumentpos - Cursor position
BadLocationException
public int _getIndentOfCurrStmt(int pos,
char[] delims,
char[] whitespace)
throws BadLocationException
_getIndentOfCurrStmt in interface DJDocumentpos - Cursor positiondelims - Delimiter characters denoting end of statementwhitespace - characters to skip when looking for beginning of next statement
BadLocationException
public int findPrevDelimiter(int pos,
char[] delims)
throws BadLocationException
DJDocument
findPrevDelimiter in interface DJDocumentpos - Position to start fromdelims - array of characters to search for
BadLocationException
public int findPrevDelimiter(int pos,
char[] delims,
boolean skipParenPhrases)
throws 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)
BadLocationExceptionpublic void move(int dist)
DJDocument
move in interface DJDocumentdist - the distance from the current location to the new location.
public 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 List<FinalizationListener<DefinitionsDocument>> getFinalizationListeners()
getFinalizationListeners in interface Finalizable<DefinitionsDocument>public Font getFont(AttributeSet attr)
getFont in interface StyledDocumentpublic Color getBackground(AttributeSet attr)
getBackground in interface StyledDocumentpublic Color getForeground(AttributeSet attr)
getForeground in interface StyledDocumentpublic Element getCharacterElement(int pos)
getCharacterElement in interface StyledDocumentpublic Element getParagraphElement(int pos)
getParagraphElement in interface StyledDocumentpublic Style getLogicalStyle(int p)
getLogicalStyle in interface StyledDocument
public void setLogicalStyle(int pos,
Style s)
setLogicalStyle in interface StyledDocument
public void setCharacterAttributes(int offset,
int length,
AttributeSet s,
boolean replace)
setCharacterAttributes in interface StyledDocument
public void setParagraphAttributes(int offset,
int length,
AttributeSet s,
boolean replace)
setParagraphAttributes in interface StyledDocumentpublic Style getStyle(String nm)
getStyle in interface StyledDocumentpublic void removeStyle(String nm)
removeStyle in interface StyledDocument
public Style addStyle(String nm,
Style parent)
addStyle in interface 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 BadLocationException
containsClassOrInterfaceOrEnum in interface OpenDefinitionsDocumentBadLocationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||