Package jade.tools.gui
Class ACLSLTokenMarker
- java.lang.Object
-
- jade.tools.gui.ACLSLTokenMarker
-
public class ACLSLTokenMarker extends Object
ACL/SL token marker. The original file is written by Slava Pestov (www.gjt.org) and altered to fit ACL/SL.- Author:
- Chris van Aart - Acklin B.V., the Netherlands & Slava Pestov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classACLSLTokenMarker.LineInfoInner class for storing information about tokenized lines.
-
Field Summary
Fields Modifier and Type Field Description protected ACLTokenfirstTokenThe first token in the list.protected intlastLineThe last tokenized line.protected ACLTokenlastTokenThe last token in the list.protected intlengthThe length of thelineInfoarray.protected ACLSLTokenMarker.LineInfo[]lineInfoAn array for storing information about lines.protected booleannextLineRequestedTrue if the next line should be painted.static byteS_ENDstatic byteS_ONEstatic byteS_TWO
-
Constructor Summary
Constructors Constructor Description ACLSLTokenMarker()ACLSLTokenMarker(jade.tools.gui.ACLSLTokenMarker.KeywordMap keywords)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddToken(int length, byte id)Adds a token to the token list.voiddeleteLines(int index, int lines)Informs the token marker that line have been deleted from the document.protected voidensureCapacity(int index)Creates a newTokenMarker.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.ACLTokenmarkTokens(Segment line, int lineIndex)bytemarkTokensImpl(byte _token, Segment line, int lineIndex)booleansupportsMultilineTokens()Returns if the token marker supports tokens that span multiple lines.
-
-
-
Field Detail
-
S_ONE
public static final byte S_ONE
- See Also:
- Constant Field Values
-
S_TWO
public static final byte S_TWO
- See Also:
- Constant Field Values
-
S_END
public static final byte S_END
- See Also:
- Constant Field Values
-
firstToken
protected ACLToken firstToken
The first token in the list. This should be used as the return value frommarkTokens().
-
lastToken
protected ACLToken lastToken
The last token in the list. New tokens are added here. This should be set to null before a new line is to be tokenized.
-
lineInfo
protected ACLSLTokenMarker.LineInfo[] lineInfo
An array for storing information about lines. It is enlarged and shrunk automatically by theinsertLines()anddeleteLines()methods.
-
length
protected int length
The length of thelineInfoarray.
-
lastLine
protected int lastLine
The last tokenized line.
-
nextLineRequested
protected boolean nextLineRequested
True if the next line should be painted.
-
-
Method Detail
-
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.- Returns:
- The NextLineRequested value
-
supportsMultilineTokens
public boolean supportsMultilineTokens()
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 themarkTokens()method (in turn).The default implementation returns true; it should be overridden to return false on simpler token markers for increased speed.
- Returns:
- Description of the Returned Value
-
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
-
markTokensImpl
public byte markTokensImpl(byte _token, Segment line, int lineIndex)
-
ensureCapacity
protected void ensureCapacity(int index)
Creates a newTokenMarker. This DOES NOT create a lineInfo array; an initial call toinsertLines()does that. Creates a newTokenMarker. This DOES NOT create a lineInfo array; an initial call toinsertLines()does that. Creates a newTokenMarker. This DOES NOT create a lineInfo array; an initial call toinsertLines()does that. Creates a newTokenMarker. This DOES NOT create a lineInfo array; an initial call toinsertLines()does that. Creates a newTokenMarker. This DOES NOT create a lineInfo array; an initial call toinsertLines()does that. Creates a newTokenMarker. This DOES NOT create a lineInfo array; an initial call toinsertLines()does that. Creates a newTokenMarker. This DOES NOT create a lineInfo array; an initial call toinsertLines()does that. Creates a newTokenMarker. This DOES NOT create a lineInfo array; an initial call toinsertLines()does that. Creates a newTokenMarker. This DOES NOT create a lineInfo array; an initial call toinsertLines()does that. Creates a newTokenMarker. This DOES NOT create a lineInfo array; an initial call toinsertLines()does that. Creates a newTokenMarker. This DOES NOT create a lineInfo array; an initial call toinsertLines()does that. Ensures that thelineInfoarray can contain the specified index. This enlarges it if necessary. No action is taken if the array is large enough already.It should be unnecessary to call this under normal circumstances;
insertLine()should take care of enlarging the line info array automatically.- Parameters:
index- Description of Parameter
-
addToken
protected void addToken(int length, byte id)Adds a token to the token list.- Parameters:
length- The length of the tokenid- The id of the token
-
-