Package swingtree
Class TextInsertDelegate
java.lang.Object
swingtree.AbstractTextComponentDelegate
swingtree.TextInsertDelegate
A delegate object for the
This delegate provides useful context information to the action listener, such as the text component itself, the
Action
lambda passed
to the UIForAnyTextComponent.onTextInsert(Action)
method,
which is used to register a listener for text insertion events.
This delegate provides useful context information to the action listener, such as the text component itself, the
DocumentFilter.FilterBypass
object that can be used to insert text into the document, the offset at which
the text is to be inserted and the length of the text to be inserted.-
Method Summary
Modifier and TypeMethodDescriptionfinal AttributeSet
Exposes the attribute set of the text to be inserted.Exposes the text that is being inserted.Methods inherited from class swingtree.AbstractTextComponentDelegate
getComponent, getFilterBypass, getLength, getOffset
-
Method Details
-
getTextToBeInserted
Exposes the text that is being inserted. SeeDocumentFilter.insertString(DocumentFilter.FilterBypass, int, String, AttributeSet)
for more information.- Returns:
- The text to be inserted or an empty
String
if no text is to be inserted. Null is never returned.
-
attributeSet
Exposes the attribute set of the text to be inserted. An attribute is a key-value pair that can be used to store arbitrary data about the text to be inserted. SeeDocumentFilter.insertString(DocumentFilter.FilterBypass, int, String, AttributeSet)
for more information about the underlying source of this attribute set.- Returns:
- The attribute set of the text to be inserted.
-