public interface SyntaxDocument
extends javax.swing.text.Document
SyntaxEditorKit
. It defines two methods, one that returns the
TokenMarker
that will split a line into a list of tokens, and a method
that returns a color array that maps identification tags returned by the token marker
into Color
objects. The possible token identifiers are defined as static
fields in the Token
class.
Modifier and Type | Method and Description |
---|---|
java.awt.Color[] |
getColors()
Returns the color array that maps token identifiers to
java.awt.Color
objects. |
TokenMarker |
getTokenMarker()
Returns the token marker that is to be used to split lines of this document up
into tokens.
|
void |
setColors(java.awt.Color[] colors)
Sets the color array that maps token identifiers to
java.awt.Color
ojects. |
void |
setTokenMarker(TokenMarker tm)
Sets the token marker that is to be used to split lines of this document up into
tokens.
|
void |
tokenizeLines()
Reparses the document, by passing all lines to the token marker.
|
void |
tokenizeLines(int start,
int len)
Reparses the document, by passing the specified lines to the token marker.
|
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render
void setColors(java.awt.Color[] colors)
java.awt.Color
ojects. May throw an exception if this is not supported for this type of
document.colors
- The new color listjava.awt.Color[] getColors()
java.awt.Color
objects. Each index in the array is a token type.void setTokenMarker(TokenMarker tm)
tm
- The new token markerTokenMarker getTokenMarker()
void tokenizeLines()
void tokenizeLines(int start, int len)
start
- The first line to parselen
- The number of lines, after the first one to parse