Class ComponentNode


  • public class ComponentNode
    extends Node
    Node representing a live Pivot component to be inserted into a TextPane.
    • Constructor Detail

      • ComponentNode

        public ComponentNode()
      • ComponentNode

        public ComponentNode​(ComponentNode componentNode)
      • ComponentNode

        public ComponentNode​(Component component)
    • Method Detail

      • getComponent

        public Component getComponent()
      • setComponent

        public void setComponent​(Component component)
      • getText

        public java.lang.String getText()
      • getSubstring

        public java.lang.String getSubstring​(Span range)
      • getSubstring

        public java.lang.String getSubstring​(int start,
                                             int end)
      • getSubstring

        public java.lang.String getSubstring​(CharSpan charSpan)
      • getCharacters

        public java.lang.CharSequence getCharacters​(Component comp)
      • getCharacters

        public java.lang.CharSequence getCharacters()
        Specified by:
        getCharacters in class Node
        Returns:
        The character sequence in this node.
      • getCharacters

        public java.lang.CharSequence getCharacters​(Span range)
      • getCharacters

        public java.lang.CharSequence getCharacters​(int start,
                                                    int end)
      • getCharacters

        public java.lang.CharSequence getCharacters​(CharSpan charSpan)
      • getCharacterAt

        public char getCharacterAt​(int offset)
        Specified by:
        getCharacterAt in class Node
        Parameters:
        offset - Offset relative to this node.
        Returns:
        The character at the given offset.
      • getCharacterCount

        public int getCharacterCount()
        Specified by:
        getCharacterCount in class Node
        Returns:
        The number of characters in this node.
      • insertRange

        @UnsupportedOperation
        public void insertRange​(Node range,
                                int offset)
        Description copied from class: Node
        Inserts a range into the node. Note that the contents of the range, rather than the range itself, is added to the node.
        Specified by:
        insertRange in class Node
        Parameters:
        range - The node containing the text to insert.
        offset - Offset relative to this node.
      • removeRange

        @UnsupportedOperation
        public Node removeRange​(int offset,
                                int span)
        Description copied from class: Node
        Removes a range from the node.
        Specified by:
        removeRange in class Node
        Parameters:
        offset - Offset relative to this node.
        span - Count of characters to remove.
        Returns:
        The removed range. This will be a copy of the node structure relative to this node.
      • getRange

        public Node getRange​(int offset,
                             int characterCount)
        Description copied from class: Node
        Returns a range from the node.
        Specified by:
        getRange in class Node
        Parameters:
        offset - Offset relative to this node.
        characterCount - Count of characters to get.
        Returns:
        A node containing a copy of the node structure spanning the given range, relative to this node.
      • duplicate

        public Node duplicate​(boolean recursive)
        Description copied from class: Node
        Creates a copy of this node.
        Specified by:
        duplicate in class Node
        Parameters:
        recursive - Whether to duplicate the children also.
        Returns:
        A copy of the current node.