Interface NodeListener

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  NodeListener.Adapter
      Deprecated.
      Since 2.1 and Java 8 the interface itself has default implementations.
      static class  NodeListener.Listeners
      The node listeners.
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default void nodeInserted​(Node node, int offset)
      Called when a child node has been inserted into a node.
      default void nodesRemoved​(Node node, Sequence<Node> removed, int offset)
      Called when child nodes have been removed from a node.
      default void offsetChanged​(Node node, int previousOffset)
      Called when a node's offset has changed within its parent element.
      default void parentChanged​(Node node, Element previousParent)
      Called when a node's parent has changed, either as a result of being added to or removed from an element.
      default void rangeInserted​(Node node, int offset, int span)
      Called when a text range has been inserted into a node.
      default void rangeRemoved​(Node node, int offset, int characterCount, java.lang.CharSequence removedChars)
      Called when a text range has been removed from a node.
    • Method Detail

      • parentChanged

        default void parentChanged​(Node node,
                                   Element previousParent)
        Called when a node's parent has changed, either as a result of being added to or removed from an element.
        Parameters:
        node - The node that moved.
        previousParent - What the node's parent used to be.
      • offsetChanged

        default void offsetChanged​(Node node,
                                   int previousOffset)
        Called when a node's offset has changed within its parent element.
        Parameters:
        node - The node that has been updated.
        previousOffset - The previous offset of this node.
      • nodeInserted

        default void nodeInserted​(Node node,
                                  int offset)
        Called when a child node has been inserted into a node.
        Parameters:
        node - The parent node that changed.
        offset - The offset where the child node was inserted.
      • nodesRemoved

        default void nodesRemoved​(Node node,
                                  Sequence<Node> removed,
                                  int offset)
        Called when child nodes have been removed from a node.
        Parameters:
        node - The parent node.
        removed - The sequence of child nodes that were removed.
        offset - The starting offset of the removed nodes.
      • rangeInserted

        default void rangeInserted​(Node node,
                                   int offset,
                                   int span)
        Called when a text range has been inserted into a node.
        Parameters:
        node - The node where text was inserted.
        offset - The starting offset of the insertion.
        span - Count of characters inserted.
      • rangeRemoved

        default void rangeRemoved​(Node node,
                                  int offset,
                                  int characterCount,
                                  java.lang.CharSequence removedChars)
        Called when a text range has been removed from a node.
        Parameters:
        node - The node where text was removed.
        offset - Starting offset of the text removal.
        characterCount - Count of characters removed.
        removedChars - (optional) Actual characters that were removed if the removal was directly from a text node, otherwise this will be null.