org.gjt.sp.jedit.syntax
Class TokenMarker
- java.lang.Object
-
- org.gjt.sp.jedit.syntax.TokenMarker
-
- Direct Known Subclasses:
- BatchFileTokenMarker, CTokenMarker, HTMLTokenMarker, MakefileTokenMarker, PatchTokenMarker, PropsTokenMarker, ShellScriptTokenMarker, SQLTokenMarker, TeXTokenMarker
public abstract class TokenMarker extends java.lang.ObjectA token marker that splits lines of text into tokens. Each token carries a length field and an identification 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 of
markTokensshould only be used for immediate painting. Notably, it cannot be cached.- See Also:
Token
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description classTokenMarker.LineInfoInner class for storing information about tokenized lines.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddeleteLines(int index, int lines)Informs the token marker that line have been deleted from the document.voidinsertLines(int index, int lines)Informs the token marker that lines have been inserted into the document.booleanisNextLineRequested()Returns true if the next line should be repainted.TokenmarkTokens(javax.swing.text.Segment line, int lineIndex)A wrapper for the lower-levelmarkTokensImplmethod that is called to split a line up into tokens.
-
-
-
Method Detail
-
markTokens
public Token markTokens(javax.swing.text.Segment line, int lineIndex)
A wrapper for the lower-levelmarkTokensImplmethod that is called to split a line up into tokens.- Parameters:
line- The linelineIndex- The line number
-
insertLines
public void insertLines(int index, int lines)Informs the token marker that lines have been inserted into the document. This inserts a gap in thelineInfoarray.- Parameters:
index- The first line numberlines- The number of lines
-
deleteLines
public void deleteLines(int index, int lines)Informs the token marker that line have been deleted from the document. This removes the lines in question from thelineInfoarray.- Parameters:
index- The first line numberlines- The number of lines
-
isNextLineRequested
public boolean isNextLineRequested()
Returns 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.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG