public abstract class TokenMarker
A token marker that splits lines of text into tokens. Each token carries a length field and an indentification tag that can be mapped to a color for painting that token.
For performance reasons, the linked list of tokens is reused after each line is tokenized. Therefore, the return value ofmarkTokens
should
only be used for immediate painting. Notably, it cannot be cached.
Modifiers | Name | Description |
---|---|---|
class |
TokenMarker.LineInfo |
Inner class for storing information about tokenized lines. |
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
deleteLines(int index, int lines) Informs the token marker that line have been deleted from the document. |
|
public int |
getLineCount() Returns the number of lines in this token marker. |
|
public void |
insertLines(int index, int lines) Informs the token marker that lines have been inserted into the document. |
|
public boolean |
isNextLineRequested() Returns true if the next line should be repainted. |
|
public Token |
markTokens(javax.swing.text.Segment line, int lineIndex) A wrapper for the lower-level markTokensImpl method that is
called to split a line up into tokens. |
|
public boolean |
supportsMultilineTokens() Returns if the token marker supports tokens that span multiple lines. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Informs the token marker that line have been deleted from the document.
This removes the lines in question from the lineInfo
array.
index
- The first line numberlines
- The number of linesReturns the number of lines in this token marker.
Informs the token marker that lines have been inserted into the document.
This inserts a gap in the lineInfo
array.
index
- The first line numberlines
- The number of linesReturns true if the next line should be repainted. This will return true after a line has been tokenized that starts a multiline token that continues onto the next line.
A wrapper for the lower-level markTokensImpl
method that is
called to split a line up into tokens.
line
- The linelineIndex
- The line number Returns if the token marker supports tokens that span multiple lines. If
this is true, the object using this token marker is required to pass all
lines in the document to the markTokens()
method (in turn).