public final class TokenHierarchyControl<I> extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
isActive()
Check whether the hierarchy is currently active or not.
|
void |
rebuild()
Rebuild token hierarchy completely.
|
void |
setActive(boolean active)
Making the token hierarchy inactive will release all the tokens in the hierarchy
so that there will be no tokens.
|
void |
textModified(int offset,
int removedLength,
CharSequence removedText,
int insertedLength)
Notify that the text of the mutable text input was modified.
|
TokenHierarchy<I> |
tokenHierarchy()
Get token hierarchy managed by this control object.
|
public TokenHierarchy<I> tokenHierarchy()
public void textModified(int offset, int removedLength, CharSequence removedText, int insertedLength)
This method should only be invoked under modification lock (write-lock) over the mutable input source.
offset
- >=0 offset where the modification occurred.removedLength
- >=0 number of characters removed from the input.removedText
- text removed from the input. If it's not available
to determine the removed text then this parameter may be null.
insertedLength
- >=0 number of characters inserted at the offset
after the removal.public void setActive(boolean active)
This method should only be invoked under modification lock (write-lock) over the mutable input source.
active
- whether the hierarchy should become active or inactive.public boolean isActive()
TokenHierarchy.tokenSequence()
returns null.
This method should only be invoked under read/write lock over the mutable input source.
public void rebuild()
ConcurrentModificationException
.