org.apache.pivot.wtk.text
Class ComponentNode

java.lang.Object
  extended by org.apache.pivot.wtk.text.Node
      extended by org.apache.pivot.wtk.text.ComponentNode

public class ComponentNode
extends Node

Node representing a live pivot component.


Constructor Summary
ComponentNode()
           
ComponentNode(Component component)
           
ComponentNode(ComponentNode componentNode)
           
 
Method Summary
 Node duplicate(boolean recursive)
          Creates a copy of this node.
 char getCharacterAt(int offset)
          Returns the character at the given offset.
 int getCharacterCount()
          Returns the number of characters in this node.
 CharSequence getCharacters(int start, int end)
           
 CharSequence getCharacters(Span range)
           
 Component getComponent()
           
 ListenerList<ComponentNodeListener> getComponentNodeListeners()
           
 Node getRange(int offset, int characterCount)
          Returns a range from the node.
 String getSubstring(int start, int end)
           
 String getSubstring(Span range)
           
 String getText()
           
 void insertRange(Node range, int offset)
          Inserts a range into the node.
 Node removeRange(int offset, int span)
          Removes a range from the node.
 void setComponent(Component component)
           
 
Methods inherited from class org.apache.pivot.wtk.text.Node
getDocumentOffset, getDocumentSpan, getNodeListeners, getOffset, getParent, nodeInserted, nodesRemoved, rangeInserted, rangeRemoved, replaceRange, setOffset, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 String getText()

getSubstring

public String getSubstring(Span range)

getSubstring

public String getSubstring(int start,
                           int end)

getCharacters

public CharSequence getCharacters(Span range)

getCharacters

public CharSequence getCharacters(int start,
                                  int end)

getCharacterAt

public char getCharacterAt(int offset)
Description copied from class: Node
Returns the character at the given offset.

Specified by:
getCharacterAt in class Node

getCharacterCount

public int getCharacterCount()
Description copied from class: Node
Returns the number of characters in this node.

Specified by:
getCharacterCount in class Node

insertRange

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

removeRange

public Node removeRange(int offset,
                        int span)
Description copied from class: Node
Removes a range from the node.

Specified by:
removeRange in class Node
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
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

getComponentNodeListeners

public ListenerList<ComponentNodeListener> getComponentNodeListeners()