com.metamatrix.common.tree
Interface TreeNodeSource

All Known Implementing Classes:
BasicTreeNodeSource

public interface TreeNodeSource

This interface defines an interface to a source of TreeNode information.


Method Summary
 boolean allowsChildren(TreeNode node)
          Determine whether the specified TreeNode may contain children.
 TreeNodeEditor createTreeNodeEditor()
          Create a new instance of TreeNodeEditor, which is an editor that may be used to access and/or modify a single TreeNode object.
 java.util.List getChildren(TreeNode parent)
          Obtain the set of entries that are considered the children of the specified TreeNode.
 TreeNode getParent(TreeNode node)
          Determine the parent TreeNode for the specified entry, or null if the specified entry is a root.
 boolean isAncestorOf(TreeNode ancestor, TreeNode descendent)
          Determine whether the specified node is a descendent of the given ancestor node.
 boolean isParentOf(TreeNode parent, TreeNode child)
          Determine whether the specified node is a child of the given parent node.
 boolean isReadOnly(TreeNode node)
          Determine whether the specified TreeNode is considered read-only
 

Method Detail

getChildren

java.util.List getChildren(TreeNode parent)
Obtain the set of entries that are considered the children of the specified TreeNode.

Parameters:
parent - the TreeNode instance for which the child entries are to be obtained; may not be null
Returns:
the list of TreeNode instances that are considered the children of the specified entry; never null but possibly empty

getParent

TreeNode getParent(TreeNode node)
Determine the parent TreeNode for the specified entry, or null if the specified entry is a root.

Parameters:
entry - the TreeNode instance for which the parent is to be obtained; may not be null
Returns:
the parent entry, or null if there is no parent

createTreeNodeEditor

TreeNodeEditor createTreeNodeEditor()
Create a new instance of TreeNodeEditor, which is an editor that may be used to access and/or modify a single TreeNode object.

Returns:
the new editor instance; never null

allowsChildren

boolean allowsChildren(TreeNode node)
Determine whether the specified TreeNode may contain children.

Parameters:
entry - the TreeNode instance that is to be checked; may not be null
Returns:
true if the entry can contain children, or false otherwise.

isParentOf

boolean isParentOf(TreeNode parent,
                   TreeNode child)
Determine whether the specified node is a child of the given parent node.

Returns:
true if the node is a child of the given parent node.

isAncestorOf

boolean isAncestorOf(TreeNode ancestor,
                     TreeNode descendent)
Determine whether the specified node is a descendent of the given ancestor node.

Returns:
true if the node is a descendent of the given ancestor node.

isReadOnly

boolean isReadOnly(TreeNode node)
Determine whether the specified TreeNode is considered read-only

Parameters:
entry - the TreeNode instance that is to be checked; may not be null
Returns:
true if the entry is read-only, or false otherwise.


Copyright © 2009. All Rights Reserved.