java.lang.Object
org.gjt.sp.jedit.syntax.DefaultTokenHandler
org.gjt.sp.jedit.syntax.DisplayTokenHandler
- All Implemented Interfaces:
TokenHandler
Creates
Chunk
objects that can be painted on screen.- Version:
- $Id: DisplayTokenHandler.java 25345 2020-05-29 16:42:56Z kpouer $
-
Field Summary
Fields inherited from class org.gjt.sp.jedit.syntax.DefaultTokenHandler
firstToken, lastToken, lineContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the list of chunks.void
handleToken
(Segment seg, byte id, int offset, int length, TokenMarker.LineContext context) Called by the token marker when a syntax token has been parsed.void
init
(SyntaxStyle[] styles, FontRenderContext fontRenderContext, TabExpander expander, List<Chunk> out, float wrapMargin, int physicalLineOffset) Init some variables that will be used when marking tokens.Methods inherited from class org.gjt.sp.jedit.syntax.DefaultTokenHandler
addToken, createToken, getLineContext, getParserRuleSet, getTokens, init, setLineContext
-
Field Details
-
MAX_CHUNK_LEN
public static int MAX_CHUNK_LEN
-
-
Constructor Details
-
DisplayTokenHandler
public DisplayTokenHandler()
-
-
Method Details
-
init
public void init(SyntaxStyle[] styles, FontRenderContext fontRenderContext, TabExpander expander, List<Chunk> out, float wrapMargin, int physicalLineOffset) Init some variables that will be used when marking tokens. This is called beforeJEditBuffer.markTokens(int, TokenHandler)
to store some data that will be required and that we don't want to put in the parameters- Parameters:
styles
-fontRenderContext
-expander
-out
-wrapMargin
-physicalLineOffset
- offset of the physical lines which these chunks belong to required for implementing elastic tabstops
-
getChunkList
Returns the list of chunks. Each element is a head of linked chunks and represents a screen line.- Since:
- jEdit 4.1pre7
-
handleToken
public void handleToken(Segment seg, byte id, int offset, int length, TokenMarker.LineContext context) Called by the token marker when a syntax token has been parsed.- Specified by:
handleToken
in interfaceTokenHandler
- Overrides:
handleToken
in classDefaultTokenHandler
- Parameters:
seg
- The segment containing the textid
- The token type (one of the constants in theToken
class).offset
- The start offset of the tokenlength
- The number of characters in the tokencontext
- The line context- Since:
- jEdit 4.2pre3
-