Class AbstractTokenHighlighting
- java.lang.Object
-
- com._1c.g5.v8.dt.ql.bsl.ui.token.highlighting.AbstractTokenHighlighting
-
- Direct Known Subclasses:
QlInBslTokenHighlighting
public abstract class AbstractTokenHighlighting extends Object
Abstract class for highlighting one xtext language in string literals of other xtext language
-
-
Constructor Summary
Constructors Constructor Description AbstractTokenHighlighting()
Empty constructorAbstractTokenHighlighting(String text, int startPos)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract org.eclipse.xtext.parser.antlr.XtextTokenStream
getActualTokenStream(String text)
Initialize token stream - createsTokenStream
for highlighting languageprotected abstract String
getColorIdByTokenType(int type, String defaultColorId)
Get color id for highlighting token by its typeprotected abstract int[]
getDiscardTokenTypes()
Gets discard token typesString
getSourceText()
Gets source textint
startHighlighting(org.eclipse.xtext.ide.editor.syntaxcoloring.IHighlightedPositionAcceptor highlightingAcceptor, String defaultColorId)
Starts highlighting calculationvoid
updateSourceData(String text, int startPos)
Updates highlighting text
-
-
-
Field Detail
-
text
protected String text
-
startPos
protected int startPos
-
tokens
protected org.antlr.runtime.TokenStream tokens
-
-
Constructor Detail
-
AbstractTokenHighlighting
public AbstractTokenHighlighting()
Empty constructor
-
AbstractTokenHighlighting
public AbstractTokenHighlighting(String text, int startPos)
Constructor- Parameters:
text
- highlighting text. Can't benull
startPos
- the beginning position of highlighting text
-
-
Method Detail
-
getSourceText
public String getSourceText()
Gets source text- Returns:
- source text, can't be
null
-
updateSourceData
public void updateSourceData(String text, int startPos)
Updates highlighting text- Parameters:
text
- highlighting text. Can't benull
startPos
- the beginning position of highlighting text
-
startHighlighting
public int startHighlighting(org.eclipse.xtext.ide.editor.syntaxcoloring.IHighlightedPositionAcceptor highlightingAcceptor, String defaultColorId)
Starts highlighting calculation- Parameters:
highlightingAcceptor
-IHighlightedPositionAcceptor
from any xtext languagedefaultColorId
- default color id for highlighting common tokens, can't benull
- Returns:
- number of highlighting tokens
-
getActualTokenStream
protected abstract org.eclipse.xtext.parser.antlr.XtextTokenStream getActualTokenStream(String text)
Initialize token stream - createsTokenStream
for highlighting language- Parameters:
text
- initial text for highlighting tokens- Returns:
- created
TokenStream
, can't benull
-
getDiscardTokenTypes
protected abstract int[] getDiscardTokenTypes()
Gets discard token types- Returns:
- array of discard token types or empty array
-
-