| java.lang.Object org.netbeans.editor.DocOp
DocOp | class DocOp implements AbstractDocument.Content(Code) | | Document operations. This class enhances basic marks operations by
interaction with the data of the document. All mark operations should go
through this class. This class implements AbstractDocument.Content
interface. BOL means Begin of Line position. EOL means End of Line position.
author: Miloslav Metelka version: 1.00 |
Constructor Summary | |
| DocOp() Construct new document marks operations. |
Method Summary | |
public String | cacheToString() | void | checkEOLMark(int pos) Check if the EOL syntax mark is at the right place. | public synchronized Position | createPosition(int offset) | public synchronized Position | createPosition(int offset, Position.Bias bias) | void | directCacheWrite(int pos, char cache, int offset, int len) Write directly to the cache-support. | synchronized int | find(Finder finder, int startPos, int limitPos) | synchronized int | getBOL(int pos) | synchronized int | getBOLFromLine(int line) | synchronized int | getBOLRelLine(int pos, int relLine) Advance given position n-lines forward/backward and return BOL. | public void | getChars(int where, int len, Segment txt) | synchronized char[] | getChars(int pos, int len) Retrieve the characters from the document cache. | synchronized void | getChars(int pos, char ret, int offset, int len) Get the characters into the given buffer. | synchronized int | getEOL(int pos) Get end of line position from position on that line. | synchronized int | getEOLFromLine(int line) | synchronized int | getEOLNL(int pos) Get end of line after the new-line position from position on that line. | synchronized int | getEOLRelLine(int pos, int relLine) Advance given position n-lines forward/backward and return BOL. | MarkFactory.SyntaxMark | getLeftSyntaxMark(int pos) Get the first syntax mark that is in the left direction from the desired
position. | synchronized int | getLine(int pos) Get line from position. | synchronized int | getLineCount() | synchronized int | getOffsetFromVisCol(int visCol, int startLinePos) Get position on line from visual column. | synchronized Mark | getOffsetMark(int offset, Class markClass) Get the first mark of the specified class that lies on the given
position.
Parameters: offset - position at which the mark is searched Parameters: markClass - the class that the mark must be of. | public String | getString(int where, int len) | synchronized int | getVisColFromPos(int pos) Get visual column from position. | public String | infoToString() | void | initCacheContent(char initCache, int offset, int cacheLen) Initialize the default fragment of the cache by the given data. | void | initialReadUpdate() | public UndoableEdit | insert(int offset, char[] chars) | synchronized void | insertEdit(ModifyUndoEdit undoEdit) | synchronized void | insertMark(Mark mark, int offset) Insert new mark at specified position. | void | insertMark(Mark mark, int offset, int line) Insert mark when knowing even the line offset. | Mark | insertMark(int pos, boolean insertAfter) Insert new mark at specified position. | public UndoableEdit | insertString(int offset, String text) | synchronized void | insertUpdate(ModifyUndoEdit undoEdit) This function is called after document insertion to update marks. | synchronized void | invalidateSyntaxMarks() Invalidate the state-infos in all the syntax-marks in the whole document. | synchronized boolean | isBOL(int pos) | synchronized boolean | isEOL(int pos) | public synchronized int | length() | public String | markPlanesToString(Class markClasses, char markChars) | synchronized void | moveMark(Mark mark, int newPos) | void | prepareSyntax(SyntaxSeg.Slot slot, Syntax syntax, MarkFactory.SyntaxMark leftSyntaxMark, int reqPos, int reqLen, boolean forceLastBuffer, boolean forceNotLastBuffer) Prepare syntax scanner so that it's ready to scan from requested
position.
Parameters: slot - syntax segment slot to be used Parameters: syntax - syntax scanner to be used Parameters: leftSyntaxMark - first syntax mark in the left direction from the reqPos, canbe obtained by getLeftSyntaxMark() Parameters: reqPos - position to which the syntax should be prepared Parameters: reqLen - length that will be scanned by the caller after the syntax isprepared. | void | prepareSyntax(SyntaxSeg.Slot slot, Syntax syntax, MarkFactory.SyntaxMark leftSyntaxMark, int reqPos, int reqLen, boolean forceLastBuffer) | public UndoableEdit | remove(int offset, int len) | synchronized void | removeEdit(ModifyUndoEdit undoEdit) | synchronized void | removeUpdate(ModifyUndoEdit undoEdit) This function is called after document removal to update marks. | synchronized void | renderMarks(DocMarks.Renderer r) | void | setDocument(BaseDocument doc) | public String | toString() |
eolMark | MarkFactory.SyntaxMark eolMark(Code) | | Mark that is inserted at the end of line (better said after the end of
line) where the insertion currently occurs. The mark is possibly moved
and/or updated before the insertion/removal occurs. Then after the
insertion/removal is done mark syntax state is checked again. If it's the
same as before it's not necessary to paint the next line after insertion.
If it's not the same the painting must continue till the syntax mark with
matching state.
|
statCacheHit | int statCacheHit(Code) | | Statistics
|
statCacheMiss | int statCacheMiss(Code) | | |
DocOp | DocOp()(Code) | | Construct new document marks operations. Since this class uses both cache
and marks both these classes must be already created in document.
|
cacheToString | public String cacheToString()(Code) | | Dump the line cache
|
checkEOLMark | void checkEOLMark(int pos)(Code) | | Check if the EOL syntax mark is at the right place. If not, move it to
the end of current line and update it with the right syntax information.
It uses instance of syntax used in document.
|
directCacheWrite | void directCacheWrite(int pos, char cache, int offset, int len) throws BadLocationException(Code) | | Write directly to the cache-support. This method is used solely by
Analyzer when document is read.
|
getBOL | synchronized int getBOL(int pos) throws BadLocationException(Code) | | Get begin of line from position on that line
Parameters: position - where the search begins position of begin of the same line |
getBOLFromLine | synchronized int getBOLFromLine(int line)(Code) | | Get the begining position of specified line
Parameters: line - line offset for which the BOL should be determined position of the begining of line or -1 if line is invalid |
getBOLRelLine | synchronized int getBOLRelLine(int pos, int relLine) throws BadLocationException(Code) | | Advance given position n-lines forward/backward and return BOL.
|
getChars | synchronized char[] getChars(int pos, int len) throws BadLocationException(Code) | | Retrieve the characters from the document cache.
|
getChars | synchronized void getChars(int pos, char ret, int offset, int len) throws BadLocationException(Code) | | Get the characters into the given buffer. The buffer must contain enough
space for the requested data.
|
getEOLFromLine | synchronized int getEOLFromLine(int line)(Code) | | Get end of line position from specified line
|
getEOLNL | synchronized int getEOLNL(int pos) throws BadLocationException(Code) | | Get end of line after the new-line position from position on that line.
This is in fact the begining of the next line except the last line.
|
getEOLRelLine | synchronized int getEOLRelLine(int pos, int relLine) throws BadLocationException(Code) | | Advance given position n-lines forward/backward and return BOL.
|
getLeftSyntaxMark | MarkFactory.SyntaxMark getLeftSyntaxMark(int pos)(Code) | | Get the first syntax mark that is in the left direction from the desired
position.
|
getLine | synchronized int getLine(int pos) throws BadLocationException(Code) | | Get line from position. This is used for example when removal from
document is made to find right line number for marks update.
|
getLineCount | synchronized int getLineCount()(Code) | | |
getOffsetFromVisCol | synchronized int getOffsetFromVisCol(int visCol, int startLinePos) throws BadLocationException(Code) | | Get position on line from visual column. This method can be used only for
superfixed font i.e. all characters of all font styles have the same
width.
Parameters: visCol - visual column Parameters: startLinePos - position of line start position on line for particular x-coord |
getOffsetMark | synchronized Mark getOffsetMark(int offset, Class markClass)(Code) | | Get the first mark of the specified class that lies on the given
position.
Parameters: offset - position at which the mark is searched Parameters: markClass - the class that the mark must be of. It can be also an instanceof a descendant of this class (Class.isInstance isused). mark that matches the condition or null. |
getVisColFromPos | synchronized int getVisColFromPos(int pos) throws BadLocationException(Code) | | Get visual column from position. This method can be used only for
superfixed font i.e. all characters of all font styles have the same
width.
Parameters: pos - position for which the visual column should be returned thefunction itself computes the begining of the line first |
initCacheContent | void initCacheContent(char initCache, int offset, int cacheLen)(Code) | | Initialize the default fragment of the cache by the given data. This
method is used solely by Analyzer when document is read.
|
initialReadUpdate | void initialReadUpdate()(Code) | | |
insertMark | Mark insertMark(int pos, boolean insertAfter) throws BadLocationException(Code) | | Insert new mark at specified position. The function finds appropriate
line number.
|
insertUpdate | synchronized void insertUpdate(ModifyUndoEdit undoEdit)(Code) | | This function is called after document insertion to update marks. Event
parameter contains inserted chars and also how many lines was inserted.
|
invalidateSyntaxMarks | synchronized void invalidateSyntaxMarks()(Code) | | Invalidate the state-infos in all the syntax-marks in the whole document.
|
length | public synchronized int length()(Code) | | |
markPlanesToString | public String markPlanesToString(Class markClasses, char markChars)(Code) | | |
prepareSyntax | void prepareSyntax(SyntaxSeg.Slot slot, Syntax syntax, MarkFactory.SyntaxMark leftSyntaxMark, int reqPos, int reqLen, boolean forceLastBuffer, boolean forceNotLastBuffer) throws BadLocationException(Code) | | Prepare syntax scanner so that it's ready to scan from requested
position.
Parameters: slot - syntax segment slot to be used Parameters: syntax - syntax scanner to be used Parameters: leftSyntaxMark - first syntax mark in the left direction from the reqPos, canbe obtained by getLeftSyntaxMark() Parameters: reqPos - position to which the syntax should be prepared Parameters: reqLen - length that will be scanned by the caller after the syntax isprepared. The prepareSyntax() automatically preloads this areainto the syntax segment slot. Parameters: forceLastBuffer - force the syntax to think that the scanned area is the last inthe document. This is useful for forcing the syntax to processall the characters in the given area. Parameters: forceNotLastBuffer - force the syntax to think that the scanned area is NOT thelast buffer in the document. This is useful when the syntaxwill continue scanning on another buffer. |
removeUpdate | synchronized void removeUpdate(ModifyUndoEdit undoEdit)(Code) | | This function is called after document removal to update marks. Event
parameter contains removed chars and also how many lines was removed.
|
|
|