|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.javatools.editor.language.AbstractDocumentRenderer oracle.javatools.editor.language.LexerDocumentRenderer
An LexerDocumentRenderer
is the abstact starting point for
DocumentRenderers
implementations based on languages that
have Lexer
implementations available for tokenizing the
language. This takes care of common functionality with the usage of
the Lexer
.
AbstractDocumentRenderer
,
BlockRenderer
,
DocumentRenderer
,
Lexer
Nested Class Summary | |
static class |
LexerDocumentRenderer.LexerOffsetsCache
The LexerOffsetsCache provides rapid access for
offsets that correspond to the start of a language token. |
Field Summary | |
protected BlockRenderer |
blockRenderer
The block renderer used for rendering. |
protected Lexer |
lexer
The Lexer that is used for tokenizing. |
protected LexerToken |
lexerToken
The LexerToken structure for interfacing with the Lexer. |
protected LexerDocumentRenderer.LexerOffsetsCache |
offsetsCache
The offsets cache to quickly locate token start offsets. |
Constructor Summary | |
LexerDocumentRenderer(LanguageSupport support)
Constructs a new style provider for the specified document. |
Method Summary | |
void |
calculateDamage(javax.swing.event.DocumentEvent changes,
NumberRange damageRange)
Calculates what range of the document is "damaged" or needs to be repainted based on a given insert or removal of text. |
protected abstract BlockRenderer |
createBlockRenderer()
Creates a BlockRenderer used for rendering the tokens in the primary language of this specific DocumentRenderer implementation. |
protected abstract Lexer |
createLexer()
Creates a Lexer used for breaking apart tokens in the primary language of the specific DocumentRenderer implementation |
protected BlockRenderer |
getBlockRenderer()
Get a cached block renderer (so that we don't have to keep recreating it.) |
protected Lexer |
getLexer()
Get a cached language-specific Lexer (so that we don't have to constantly recreate it every time.) |
protected LexerToken |
getLexerToken()
Get a cached lexer-specific LexerToken (that we don't have to recreate every time) from the Lexer. |
LexerDocumentRenderer.LexerOffsetsCache |
getOffsetsCache()
Fetches a LexerOffsetsCache that we can use to speed up the location of token starts for the purposes of rendering. |
abstract boolean |
isMultiLineToken(int token)
Determines whether the given token can potentially extend across line boundaries in the primary language of the style provider. |
void |
notifyUpdate(javax.swing.event.DocumentEvent changes)
Notifies the DocumentRenderer that the given document has been updated - this allows DocumentRenderers which cache offset information to update or invalidate their cache. |
void |
renderRegion(StyledFragmentsList fragmentsList,
int startOffset,
int endOffset)
Renders the region of text bounded by the given offsets. |
Methods inherited from class oracle.javatools.editor.language.AbstractDocumentRenderer |
allocateFragmentsList, getDocument, getLineMap, getTextBuffer, recycleFragmentsList, renderLines |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected LexerDocumentRenderer.LexerOffsetsCache offsetsCache
protected BlockRenderer blockRenderer
protected Lexer lexer
protected LexerToken lexerToken
Constructor Detail |
public LexerDocumentRenderer(LanguageSupport support)
support
- the language supportMethod Detail |
protected abstract BlockRenderer createBlockRenderer()
protected final BlockRenderer getBlockRenderer()
protected abstract Lexer createLexer()
protected final Lexer getLexer()
protected final LexerToken getLexerToken()
public LexerDocumentRenderer.LexerOffsetsCache getOffsetsCache()
public abstract boolean isMultiLineToken(int token)
token
- the token to check
public void renderRegion(StyledFragmentsList fragmentsList, int startOffset, int endOffset)
renderRegion
in class AbstractDocumentRenderer
fragmentsList
- the styled fragments list to added our styles tostartOffset
- the starting offset to render from (inclusive)endOffset
- the ending offset to render to (exclusive)public void calculateDamage(javax.swing.event.DocumentEvent changes, NumberRange damageRange)
calculateDamage
in interface DocumentRenderer
calculateDamage
in class AbstractDocumentRenderer
changes
- the document event indicating what changeddamageRange
- the number range to return the damage range inpublic void notifyUpdate(javax.swing.event.DocumentEvent changes)
notifyUpdate
in interface DocumentRenderer
notifyUpdate
in class AbstractDocumentRenderer
changes
- the document event indicating what changed
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.