Package swingtree

Class TextRemoveDelegate


public final class TextRemoveDelegate extends AbstractTextComponentDelegate
A delegate object for the Action lambda passed to the UIForAnyTextComponent.onTextRemove(Action) method, which is used to register a listener for text removal 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 remove text from the document, the offset at which the text is to be removed and the length of the text to be removed.
  • Method Details

    • getTextToBeRemoved

      public String getTextToBeRemoved()
      This method exposes the actual text that is being removed from the document as part of the current text removal event. If nothing is removed from the document, an empty String is returned.
      Returns:
      The text to be removed or an empty String if no text is to be removed. Null is never returned.