public class SmartDocumentFilter
extends DocumentFilter
The document filter based on Parrot's lexer is for highlighting the content of text editor
| Modifiers | Name | Description |
|---|---|---|
static List<Integer> |
HIGHLIGHTED_TOKEN_TYPE_LIST |
Token types rendered with the reserved-word style. |
| Constructor and description |
|---|
SmartDocumentFilter(DefaultStyledDocument styledDocument)Creates a filter that styles the supplied document. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public List<Token> |
getLatestTokenList()Returns the tokens produced by the most recent successful parse. |
|
public Tuple2<Integer, Integer> |
getRenderRange()Returns the character range scheduled for selective re-rendering. |
|
public void |
insertString(DocumentFilter.FilterBypass fb, int offset, String text, AttributeSet attrs){@inheritDoc} |
|
public boolean |
isLatest()Indicates whether the cached token list reflects the current document text. |
|
public void |
remove(DocumentFilter.FilterBypass fb, int offset, int length){@inheritDoc} |
|
public void |
reparseDocument()Forces a full re-parse and re-render of the document with current styles. |
|
public void |
replace(DocumentFilter.FilterBypass fb, int offset, int length, String text, AttributeSet attrs){@inheritDoc} |
|
public void |
setRenderRange(Tuple2<Integer, Integer> renderRange)Limits rendering to the supplied character range for the next parse. |
|
public static void |
updateStyles()Updates all SmartDocumentFilter styles with current theme colors. |
Creates a filter that styles the supplied document.
styledDocument - the document to tokenize and highlightReturns the tokens produced by the most recent successful parse.
Returns the character range scheduled for selective re-rendering.
null if the whole document will be rendered{@inheritDoc}
Indicates whether the cached token list reflects the current document text.
true if the latest parse completed successfully{@inheritDoc}
Forces a full re-parse and re-render of the document with current styles. Clears the incremental-render cache first so every token is restyled, not just the ones that differ from the last parse.
{@inheritDoc}
Limits rendering to the supplied character range for the next parse.
renderRange - the inclusive start and stop offsets to re-render, or null for all textUpdates all SmartDocumentFilter styles with current theme colors. Attribute values are sourced from ThemeManager so custom .theme files feed both this (ANTLR-token-driven) path and the regex-driven GroovyFilter path from one place. Called at init time and on theme switch.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.