Package swingtree
Class AbstractTextComponentDelegate
java.lang.Object
swingtree.AbstractTextComponentDelegate
- Direct Known Subclasses:
TextInsertDelegate
,TextRemoveDelegate
,TextReplaceDelegate
A delegate object for text event listeners served by the numerous
See
TextComponent
types.
A concrete sub-type of this may be passed to one of the Action
lambdas
registered by UIForAnyTextComponent.onTextInsert(Action)
, UIForAnyTextComponent.onTextRemove(Action)
and UIForAnyTextComponent.onTextReplace(Action)
.
See
TextInsertDelegate
, TextRemoveDelegate
and TextReplaceDelegate
for concrete
implementations of this abstract class.-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractTextComponentDelegate
(JTextComponent textComponent, DocumentFilter.FilterBypass filterBypass, int offset, int length) -
Method Summary
Modifier and TypeMethodDescriptionThe filter bypass type is used as a way to circumvent calling back into the Document to change it.int
The length of the text change.int
The offset at which the text change occurred.
-
Constructor Details
-
AbstractTextComponentDelegate
protected AbstractTextComponentDelegate(JTextComponent textComponent, DocumentFilter.FilterBypass filterBypass, int offset, int length)
-
-
Method Details
-
getComponent
-
getFilterBypass
The filter bypass type is used as a way to circumvent calling back into the Document to change it. Document implementations that wish to support a DocumentFilter must provide an implementation that will not call back into the DocumentFilter when the following methods are invoked from the DocumentFilter.- Returns:
- The
DocumentFilter.FilterBypass
object that can be used to modify the document.
-
getOffset
public int getOffset()The offset at which the text change occurred.- Returns:
- The offset at which the text change occurred.
-
getLength
public int getLength()The length of the text change.- Returns:
- The length of the text change.
-