|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TreeNodeEditor
This interface defines a view of a hierarchy of TreeNode instances.
Field Summary |
---|
Fields inherited from interface com.metamatrix.common.object.PropertiedObjectEditor |
---|
NO_VALUE |
Fields inherited from interface com.metamatrix.common.object.PropertyAccessPolicy |
---|
DEFAULT_READ_ONLY_PRIVILEGE |
Method Summary | |
---|---|
TreeNode |
create(TreeNode parent,
ObjectDefinition type)
Create a new instance of a TreeNode under the specified parent and with the specified type. |
TreeNode |
create(TreeNode parent,
java.lang.String name,
ObjectDefinition type)
Create a new instance of a TreeNode under the specified parent, with the specified type and with the specified name |
boolean |
delete(TreeNode node)
Removes the specified TreeNode instance (and all its children) from its parent. |
PropertyDefinition |
getNamePropertyDefinition(TreeNode obj)
Filter the specified PropertyDefinition instances and return the first definition that is mapped to "the name" property for the tree node. |
boolean |
isAncestorOf(TreeNode ancestor,
TreeNode descendent)
Determine whether the specified node is a descendent of the given ancestor node. |
boolean |
isMarked(TreeNode node)
Return the marked state of the specified node. |
boolean |
isParentOf(TreeNode parent,
TreeNode child)
Determine whether the specified node is a child of the given parent node. |
boolean |
move(TreeNode node,
TreeNode newParent)
Moves this TreeNode to be a child of the specified new parent. |
boolean |
move(TreeNode node,
TreeNode newParent,
int indexInNewParent)
Moves this TreeNode to be a child at a particular index in the specified new parent. |
boolean |
moveChild(TreeNode child,
int newIndex)
Moves this TreeNode to the specified location within the ordered list of children for the node's parent. |
TreeNode |
paste(TreeNode original,
TreeNode newParent,
boolean deepCopy)
Creates and places a copy of the specified original TreeNode under the specified new parent. |
boolean |
rename(TreeNode node,
java.lang.String newName)
Renames this TreeNode to the specified new name. |
void |
setMarked(TreeNode node,
boolean marked)
Set the marked state of the TreeNode node. |
Methods inherited from interface com.metamatrix.common.object.PropertiedObjectEditor |
---|
getAllowedValues, getPolicy, getPropertyDefinitions, getValue, isReadOnly, isValidValue, setPolicy, setValue |
Methods inherited from interface com.metamatrix.common.object.PropertyAccessPolicy |
---|
isReadOnly, reset, setReadOnly, setReadOnly |
Methods inherited from interface com.metamatrix.common.transaction.UserTransactionFactory |
---|
createReadTransaction, createWriteTransaction, createWriteTransaction |
Method Detail |
---|
void setMarked(TreeNode node, boolean marked)
marked
- the marked state of the node.boolean isMarked(TreeNode node)
boolean isParentOf(TreeNode parent, TreeNode child)
boolean isAncestorOf(TreeNode ancestor, TreeNode descendent)
TreeNode create(TreeNode parent, ObjectDefinition type)
parent
- the TreeNode that is to be the parent of the new tree node objecttype
- the ObjectDefinition instance that defines the type of tree node
object to instantiate.
java.lang.IllegalArgumentException
- if the parent and the new TreeNode
are not compatible
java.lang.AssertionError
- if parent
or type
is nullTreeNode create(TreeNode parent, java.lang.String name, ObjectDefinition type)
parent
- the TreeNode that is to be the parent of the new tree node objectname
- the name for the new objecttype
- the ObjectDefinition instance that defines the type of tree node
object to instantiate.
java.lang.IllegalArgumentException
- if the parent and the new TreeNode
are not compatible
java.lang.AssertionError
- if parent
or type
is nullboolean delete(TreeNode node)
obj
- the node to be deleted; may not be null
java.lang.AssertionError
- if obj
is nullTreeNode paste(TreeNode original, TreeNode newParent, boolean deepCopy)
This methods may be used in conjunction with a reference to an existing TreeNode instance in this or another session to copy TreeNode instances and paste them in this session.
original
- the original node to be copied; may not be nullnewParent
- the nodethat is to be considered the
parent of the newly created instances; may not be nulldeepCopy
- true if this paste operation is to place a deep copy of
original
, or false if only the original
node and its immediate properties are to be pasted.
java.lang.AssertionError
- if either of original
or newParent
is nullboolean move(TreeNode node, TreeNode newParent)
This method may be used in conjunction with the delete
method
of an editor from this or another another session to cut TreeNode instances
from the original's session and paste them (or move them) into this session.
obj
- the node to be moved; may not be nullnewParent
- the node that is to be considered the
parent of the existing instance; may not be null
java.lang.AssertionError
- if either of obj
or newParent
is nullboolean move(TreeNode node, TreeNode newParent, int indexInNewParent)
This method may be used in conjunction with the delete
method
of an editor from this or another another session to cut TreeNode instances
from the original's session and paste them (or move them) into this session.
obj
- the node to be moved; may not be nullnewParent
- the node that is to be considered the
parent of the existing instance; may not be nullindexInNewParent
- the position that this node will occupy within the ordered list
of children for newParent.
java.lang.AssertionError
- if either of obj
or newParent
is null
java.lang.IndexOutOfBoundsException
- if the index is not within the range
0 <= newIndex < childCount
boolean moveChild(TreeNode child, int newIndex)
child
- the node to be moved; may not be nullnewIndex
- the position that this node will occupy within the ordered list
of children for the node's parent.
java.lang.AssertionError
- if either of obj
or newParent
is null
java.lang.IndexOutOfBoundsException
- if the index is not within the range
0 <= newIndex < childCount
boolean rename(TreeNode node, java.lang.String newName)
obj
- the node to be renamed; may not be nullnewName
- the new name for the object; may not be null or zero-length,
and must not be used by an existing sibling
java.lang.AssertionError
- if either of obj
or newName
is null,
or if newName
is zero-lengthPropertyDefinition getNamePropertyDefinition(TreeNode obj)
obj
- the tree node; may not be null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |