public class VirtualCTreeNode extends Object
Modifier and Type | Field and Description |
---|---|
static VirtualCTreeNode[] |
EMPTY_ARRAY
An empty array of nodes.
|
Constructor and Description |
---|
VirtualCTreeNode()
Constructs the node without text, image, tooltip text and attachment.
|
VirtualCTreeNode(String text)
Constructs the node with specified text.
|
VirtualCTreeNode(String text,
Object attachment)
Constructs the node with specified text and attachment.
|
VirtualCTreeNode(String text,
String image)
Constructs the node with specified text and image.
|
VirtualCTreeNode(String text,
String image,
Object attachment)
Constructs the node with specified text, image and attachment.
|
VirtualCTreeNode(String text,
String image,
String tooltipText)
Constructs the node with specified text, image and tooltip text.
|
VirtualCTreeNode(String text,
String image,
String tooltipText,
Object attachment)
Constructs the node with specified text, image, tooltip text and attachment.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(int index,
VirtualCTreeNode child)
Adds a child node by inserting it at the specified position.
|
boolean |
add(VirtualCTreeNode child)
Adds a child node last of all children.
|
int |
addAll(VirtualCTreeNode[] children)
Adds all children node last of all children.
|
boolean |
collapse()
Collapses this node.
|
boolean |
collapseAll()
Collapses this node and all below it.
|
boolean |
expand()
Collapses this node.
|
boolean |
expandAll()
Collapses this node and all below it.
|
Object |
getAttachment()
Gets the attachment.
|
VirtualCTreeNode[] |
getChildren()
Gets the children nodes.
|
String |
getImage()
Get the image associated with the node.
|
VirtualCTreeNode |
getParent()
Gets the parent node.
|
Object |
getSynchronizer()
Gets the synchronize objects for the tree.
|
String |
getText()
Gets the text of this node.
|
String |
getTooltipText()
Get the tooltip associated with the node.
|
VirtualCTree |
getTree()
Gets the tree associated with this node.
|
boolean |
isLeaf()
Checks if this node is a leaf.
|
boolean |
isRoot()
Checks if this is the root node.
|
boolean |
remove()
Removes the node from the parent node.
|
boolean |
remove(VirtualCTreeNode child)
Removes a child node.
|
int |
removeAll()
Removes all children nodes.
|
void |
setAttachment(Object attachment)
Assigns the attachment.
|
boolean |
setImage(String image)
Set the image associated with the node.
|
boolean |
setText(String text)
Sets the text of this node.
|
boolean |
setTooltipText(String tooltipText)
Set or clears the tooltip text associated with the node.
|
public static final VirtualCTreeNode[] EMPTY_ARRAY
public VirtualCTreeNode()
public VirtualCTreeNode(String text)
public VirtualCTreeNode(String text, Object attachment)
public VirtualCTreeNode(String text, String image)
Note: the image string can contain a tab character '\t', and if it does, the first image is the collapsed node image and the second the expanded node image. If no, the same image is used for both collapsed and expanded states.
text
- The text, or null for none.image
- The image, or null for none.public VirtualCTreeNode(String text, String image, String tooltipText)
Note: the image string can contain a tab character '\t', and if it does, the first image is the collapsed node image and the second the expanded node image. If no, the same image is used for both collapsed and expanded states.
text
- The text, or null for none.image
- The image, or null for none.tooltipText
- The tooltip text, or null for none.public VirtualCTreeNode(String text, String image, Object attachment)
Note: the image string can contain a tab character '\t', and if it does, the first image is the collapsed node image and the second the expanded node image. If no, the same image is used for both collapsed and expanded states.
text
- The text, or null for none.image
- The image, or null for none.attachment
- The custom attachment Object, can be null.public VirtualCTreeNode(String text, String image, String tooltipText, Object attachment)
Note: the image string can contain a tab character '\t', and if it does, the first image is the collapsed node image and the second the expanded node image. If no, the same image is used for both collapsed and expanded states.
text
- The text, or null for none.image
- The image, or null for none.tooltipText
- The tooltip text, or null for none.attachment
- The custom attachment Object, can be null.public VirtualCTree getTree()
public Object getSynchronizer()
public VirtualCTreeNode getParent()
public boolean isRoot()
public boolean isLeaf()
public VirtualCTreeNode[] getChildren()
public boolean add(VirtualCTreeNode child)
This method triggers a change in the tree to send updates to the client.
child
- The child node.public int addAll(VirtualCTreeNode[] children)
This method triggers a change in the tree to send updates to the client.
children
- The children nodes.public boolean add(int index, VirtualCTreeNode child)
This method triggers a change in the tree to send updates to the client.
index
- The index, -1 to add it last.child
- The child node.IndexOutOfBoundsException
- if the index is out of range.UnsupportedOperationException
- if the child is already added to a parent.public boolean remove()
This method triggers a change in the tree to send updates to the client.
public boolean remove(VirtualCTreeNode child)
This method triggers a change in the tree to send updates to the client.
child
- The child node.public int removeAll()
public boolean setText(String text)
text
- The text of this node, null for none.public String getText()
public boolean setImage(String image)
Note: the image string can contain a tab character '\t', and if it does, the first image is the collapsed node image and the second the expanded node image. If no, the same image is used for both collapsed and expanded states.
image
- The image to use, or null to use default image for the tree component.public String getImage()
Note: the image string can contain a tab character '\t', and if it does, the first image is the collapsed node image and the second the expanded node image. If no, the same image is used for both collapsed and expanded states.
public boolean setTooltipText(String tooltipText)
tooltipText
- The tooltip text to use for the node, or null to clear or remove it.public String getTooltipText()
public void setAttachment(Object attachment)
attachment
- The custom attachment Object, can be null.public Object getAttachment()
public boolean collapse()
public boolean collapseAll()
public boolean expand()
public boolean expandAll()
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.