Top Description Fields Constructors Methods
org.dom4j.swing

public Class LeafTreeNode

extends Object
implements TreeNode
Class Inheritance
All Implemented Interfaces
javax.swing.tree.TreeNode
Known Direct Subclasses
org.dom4j.swing.BranchTreeNode
Imports
java.util.Enumeration, javax.swing.tree.TreeNode, org.dom4j.Node

LeafTreeNode implements the Swing TreeNode interface to bind a leaf XML nodes to a Swing TreeModel.

Authors
James Strachan , Jakob Jenkov
Version
$Revision: 1.7 $

Field Summary

Modifier and TypeField and Description
protected static final Enumeration<? extends TreeNode>
private TreeNode
parent

The parent node of this TreeNode

protected Node
xmlNode

The dom4j Node which contains the

Constructor Summary

AccessConstructor and Description
public
public
LeafTreeNode(Node xmlNode)

public
LeafTreeNode(TreeNode parent, Node xmlNode)

Method Summary

Modifier and TypeMethod and Description
public Enumeration<? extends TreeNode>
children()

Implements javax.swing.tree.TreeNode.children.

Returns the children of the receiver as an Enumeration.
public boolean
getAllowsChildren()

Implements javax.swing.tree.TreeNode.getAllowsChildren.

Returns true if the receiver allows children.
public TreeNode
getChildAt(int
index of child
childIndex
)

Implements javax.swing.tree.TreeNode.getChildAt.

Returns the child TreeNode at index childIndex.
public int
getChildCount()

Implements javax.swing.tree.TreeNode.getChildCount.

Returns the number of children TreeNodes the receiver contains.
public int
getIndex(TreeNode
node to be loked for
node
)

Implements javax.swing.tree.TreeNode.getIndex.

Returns the index of node in the receivers children.
public TreeNode
getParent()

Implements javax.swing.tree.TreeNode.getParent.

Returns the parent TreeNode of the receiver.
public Node
public boolean
isLeaf()

Implements javax.swing.tree.TreeNode.isLeaf.

Returns true if the receiver is a leaf.
public void
setParent(LeafTreeNode
DOCUMENT ME!
parent
)

Sets the parent of this node but doesn't change the parents children

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

EMPTY_ENUMERATIONback to summary
protected static final Enumeration<? extends TreeNode> EMPTY_ENUMERATION
parentback to summary
private TreeNode parent

The parent node of this TreeNode

xmlNodeback to summary
protected Node xmlNode

The dom4j Node which contains the

Constructor Detail

LeafTreeNodeback to summary
public LeafTreeNode()
LeafTreeNodeback to summary
public LeafTreeNode(Node xmlNode)
LeafTreeNodeback to summary
public LeafTreeNode(TreeNode parent, Node xmlNode)

Method Detail

childrenback to summary
public Enumeration<? extends TreeNode> children()

Implements javax.swing.tree.TreeNode.children.

Doc from javax.swing.tree.TreeNode.children.

Returns the children of the receiver as an Enumeration.

Returns:Enumeration<? extends TreeNode>

the children of the receiver as an Enumeration

getAllowsChildrenback to summary
public boolean getAllowsChildren()

Implements javax.swing.tree.TreeNode.getAllowsChildren.

Doc from javax.swing.tree.TreeNode.getAllowsChildren.

Returns true if the receiver allows children.

Returns:boolean

whether the receiver allows children

getChildAtback to summary
public TreeNode getChildAt(int childIndex)

Implements javax.swing.tree.TreeNode.getChildAt.

Doc from javax.swing.tree.TreeNode.getChildAt.

Returns the child TreeNode at index childIndex.

Parameters
childIndex:int

index of child

Returns:TreeNode

the child node at given index

getChildCountback to summary
public int getChildCount()

Implements javax.swing.tree.TreeNode.getChildCount.

Doc from javax.swing.tree.TreeNode.getChildCount.

Returns the number of children TreeNodes the receiver contains.

Returns:int

the number of children the receiver contains

getIndexback to summary
public int getIndex(TreeNode node)

Implements javax.swing.tree.TreeNode.getIndex.

Doc from javax.swing.tree.TreeNode.getIndex.

Returns the index of node in the receivers children. If the receiver does not contain node, -1 will be returned.

Parameters
node:TreeNode

node to be loked for

Returns:int

index of specified node

getParentback to summary
public TreeNode getParent()

Implements javax.swing.tree.TreeNode.getParent.

Doc from javax.swing.tree.TreeNode.getParent.

Returns the parent TreeNode of the receiver.

Returns:TreeNode

the parent of the receiver

getXmlNodeback to summary
public Node getXmlNode()
isLeafback to summary
public boolean isLeaf()

Implements javax.swing.tree.TreeNode.isLeaf.

Doc from javax.swing.tree.TreeNode.isLeaf.

Returns true if the receiver is a leaf.

Returns:boolean

whether the receiver is a leaf

setParentback to summary
public void setParent(LeafTreeNode parent)

Sets the parent of this node but doesn't change the parents children

Parameters
parent:LeafTreeNode

DOCUMENT ME!

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.