org.gjt.sp.jedit.syntax
Interface SyntaxDocument
-
- All Superinterfaces:
- javax.swing.text.Document
- All Known Implementing Classes:
- DefaultSyntaxDocument
public interface SyntaxDocument extends javax.swing.text.DocumentThe interface a document must implement to be colorizable by theSyntaxEditorKit. It defines two methods, one that returns theTokenMarkerthat 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 intoColorobjects. The possible token identifiers are defined as static fields in theTokenclass.- See Also:
DefaultSyntaxDocument,SyntaxEditorKit,TokenMarker,Token
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description java.awt.Color[]getColors()Returns the color array that maps token identifiers tojava.awt.Colorobjects.TokenMarkergetTokenMarker()Returns the token marker that is to be used to split lines of this document up into tokens.voidsetColors(java.awt.Color[] colors)Sets the dictionary that maps token identifiers tojava.awt.Colorojects.voidsetTokenMarker(TokenMarker tm)Sets the token marker that is to be used to split lines of this document up into tokens.voidtokenizeLines()Reparses the document, by passing all lines to the token marker.voidtokenizeLines(int start, int len)Reparses the document, by passing the specified lines to the token marker.-
Methods inherited from interface javax.swing.text.Document
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render
-
-
-
-
Method Detail
-
getTokenMarker
TokenMarker getTokenMarker()
Returns the token marker that is to be used to split lines of this document up into tokens. May return null if this document is not to be colorized.
-
setTokenMarker
void setTokenMarker(TokenMarker tm)
Sets the token marker that is to be used to split lines of this document up into tokens. May throw an exception if this is not supported for this type of document.- Parameters:
tm- The new token marker
-
getColors
java.awt.Color[] getColors()
Returns the color array that maps token identifiers tojava.awt.Colorobjects. Each index in the array is a token type.
-
setColors
void setColors(java.awt.Color[] colors)
Sets the dictionary that maps token identifiers tojava.awt.Colorojects. May throw an exception if this is not supported for this type of document.- Parameters:
colors- The new color list
-
tokenizeLines
void tokenizeLines()
Reparses the document, by passing all lines to the token marker. This should be called after the document is first loaded.
-
tokenizeLines
void tokenizeLines(int start, int len)Reparses the document, by passing the specified lines to the token marker. This should be called after a large quantity of text is first inserted.- Parameters:
start- The first line to parselen- The number of lines, after the first one to parse
-
-
DataMelt 3.0 © DataMelt by jWork.ORG