|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.toolbox.ui.widget.tree.DefaultTreeNodeEditor
public class DefaultTreeNodeEditor
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 |
Constructor Summary | |
---|---|
DefaultTreeNodeEditor(DefaultTreeNode root,
java.util.HashMap parentMap,
java.util.HashMap childrenMap)
|
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 childName,
ObjectDefinition type)
Create a new instance of a TreeNode under the specified parent, with the specified type and with the specified name |
UserTransaction |
createReadTransaction()
Create a new instance of a UserTransaction that may be used to read information. |
UserTransaction |
createWriteTransaction()
Create a new instance of a UserTransaction that may be used to write and/or update information. |
UserTransaction |
createWriteTransaction(java.lang.Object source)
Create a new instance of a UserTransaction that may be used to write and/or update information. |
boolean |
delete(TreeNode node)
Removes the specified TreeNode instance (and all its children) from its parent. |
java.util.List |
getAllowedValues(PropertiedObject object,
PropertyDefinition def)
Get the allowed values for the property on the specified object. |
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. |
PropertyAccessPolicy |
getPolicy()
|
java.util.List |
getPropertyDefinitions(PropertiedObject object)
Obtain the list of PropertyDefinitions that apply to the specified object's type. |
java.lang.Object |
getValue(PropertiedObject object,
PropertyDefinition definition)
Obtain from the specified PropertiedObject the property value that corresponds to the specified PropertyDefinition. |
protected void |
initializeDefaultTreeEditor()
|
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 |
isReadOnly(PropertiedObject object)
Return whether this editor may be used to set property values on the specified PropertiedObject. |
boolean |
isReadOnly(PropertiedObject object,
PropertyDefinition definition)
|
boolean |
isValidValue(PropertiedObject object,
PropertyDefinition definition,
java.lang.Object value)
Return whether the specified value is considered valid. |
boolean |
move(TreeNode child,
TreeNode parent)
Moves this TreeNode to be a child of the specified new parent. |
boolean |
move(TreeNode child,
TreeNode parent,
int index)
Moves this TreeNode to be a child at a particular index in the specified new parent. |
boolean |
moveChild(TreeNode child,
int index)
Moves this TreeNode to the specified location within the ordered list of children for the node's parent. |
TreeNode |
paste(TreeNode child,
TreeNode parent,
boolean isCopyDeep)
Creates and places a copy of the specified original TreeNode under the specified new parent. |
boolean |
rename(TreeNode node,
java.lang.String name)
Renames this TreeNode to the specified new name. |
void |
reset(PropertiedObject object)
|
void |
setMarked(TreeNode node,
boolean isMarked)
Set the marked state of the TreeNode node. |
void |
setPolicy(PropertyAccessPolicy policy)
|
void |
setReadOnly(PropertiedObject object,
boolean isReadOnly)
|
void |
setReadOnly(PropertiedObject object,
PropertyDefinition definition,
boolean isReadOnly)
|
void |
setValue(PropertiedObject object,
PropertyDefinition definition,
java.lang.Object value)
Set on the specified PropertiedObject the value defined by the specified PropertyDefinition. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultTreeNodeEditor(DefaultTreeNode root, java.util.HashMap parentMap, java.util.HashMap childrenMap)
Method Detail |
---|
public TreeNode create(TreeNode parent, ObjectDefinition type)
TreeNodeEditor
create
in interface TreeNodeEditor
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.
public TreeNode create(TreeNode parent, java.lang.String childName, ObjectDefinition type)
TreeNodeEditor
create
in interface TreeNodeEditor
parent
- the TreeNode that is to be the parent of the new tree node objectchildName
- the name for the new objecttype
- the ObjectDefinition instance that defines the type of tree node
object to instantiate.
public UserTransaction createReadTransaction()
UserTransactionFactory
The returned transaction object will not be bound to an underlying
system transaction until begin()
is called on the returned
object.
createReadTransaction
in interface UserTransactionFactory
public UserTransaction createWriteTransaction()
UserTransactionFactory
The returned transaction object will not be bound to an underlying
system transaction until begin()
is called on the returned
object.
createWriteTransaction
in interface UserTransactionFactory
public UserTransaction createWriteTransaction(java.lang.Object source)
UserTransactionFactory
The returned transaction object will not be bound to an underlying
system transaction until begin()
is called on the returned
object.
createWriteTransaction
in interface UserTransactionFactory
source
- the object that is considered to be the source of the transaction;
may be null
public boolean delete(TreeNode node)
TreeNodeEditor
delete
in interface TreeNodeEditor
public PropertyAccessPolicy getPolicy()
getPolicy
in interface PropertiedObjectEditor
public java.util.List getPropertyDefinitions(PropertiedObject object)
PropertiedObjectEditor
getPropertyDefinitions
in interface PropertiedObjectEditor
object
- the propertied object for which the PropertyDefinitions are
to be obtained; may not be null
public java.util.List getAllowedValues(PropertiedObject object, PropertyDefinition def)
PropertiedObjectEditor
getAllowedValues
in interface PropertiedObjectEditor
object
- the propertied object whose property value is to be obtained;
may not be nulldef
- the reference to the PropertyDefinition describing the
property whose value is to be returned; may not be null
#hasAllowedValues
public PropertyDefinition getNamePropertyDefinition(TreeNode obj)
TreeNodeEditor
getNamePropertyDefinition
in interface TreeNodeEditor
obj
- the tree node; may not be null
public java.lang.Object getValue(PropertiedObject object, PropertyDefinition definition)
PropertiedObjectEditor
getValue
in interface PropertiedObjectEditor
object
- the propertied object whose property value is to be obtained;
may not be nulldefinition
- the reference to the PropertyDefinition describing the
property whose value is to be returned; may not be null
protected void initializeDefaultTreeEditor()
public boolean isAncestorOf(TreeNode ancestor, TreeNode descendent)
TreeNodeEditor
isAncestorOf
in interface TreeNodeEditor
public boolean isMarked(TreeNode node)
TreeNodeEditor
isMarked
in interface TreeNodeEditor
public boolean isParentOf(TreeNode parent, TreeNode child)
TreeNodeEditor
isParentOf
in interface TreeNodeEditor
public boolean isReadOnly(PropertiedObject object)
PropertiedObjectEditor
isReadOnly
in interface PropertiedObjectEditor
isReadOnly
in interface PropertyAccessPolicy
object
- the propertied object; may not be null
public boolean isReadOnly(PropertiedObject object, PropertyDefinition definition)
isReadOnly
in interface PropertyAccessPolicy
public boolean isValidValue(PropertiedObject object, PropertyDefinition definition, java.lang.Object value)
PropertiedObjectEditor
isValidValue
in interface PropertiedObjectEditor
object
- the propertied object whose property value is to be validated;
may not be nulldefinition
- the reference to the PropertyDefinition describing the
property whose value is to be validated; may not be nullvalue
- the proposed value for the property, which must be an object array if
the property is multi-valued, and which may be null if the multiplicity
includes "0"
public boolean move(TreeNode child, TreeNode parent)
TreeNodeEditor
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.
move
in interface TreeNodeEditor
parent
- the node that is to be considered the
parent of the existing instance; may not be null
public boolean move(TreeNode child, TreeNode parent, int index)
TreeNodeEditor
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.
move
in interface TreeNodeEditor
parent
- the node that is to be considered the
parent of the existing instance; may not be nullindex
- the position that this node will occupy within the ordered list
of children for newParent.
public boolean moveChild(TreeNode child, int index)
TreeNodeEditor
moveChild
in interface TreeNodeEditor
child
- the node to be moved; may not be nullindex
- the position that this node will occupy within the ordered list
of children for the node's parent.
public TreeNode paste(TreeNode child, TreeNode parent, boolean isCopyDeep)
TreeNodeEditor
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.
paste
in interface TreeNodeEditor
child
- the original node to be copied; may not be nullparent
- the nodethat is to be considered the
parent of the newly created instances; may not be nullisCopyDeep
- 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.
public boolean rename(TreeNode node, java.lang.String name)
TreeNodeEditor
rename
in interface TreeNodeEditor
name
- the new name for the object; may not be null or zero-length,
and must not be used by an existing sibling
public void reset(PropertiedObject object)
reset
in interface PropertyAccessPolicy
public void setMarked(TreeNode node, boolean isMarked)
TreeNodeEditor
setMarked
in interface TreeNodeEditor
isMarked
- the marked state of the node.public void setPolicy(PropertyAccessPolicy policy)
setPolicy
in interface PropertiedObjectEditor
public void setReadOnly(PropertiedObject object, boolean isReadOnly)
setReadOnly
in interface PropertyAccessPolicy
public void setReadOnly(PropertiedObject object, PropertyDefinition definition, boolean isReadOnly)
setReadOnly
in interface PropertyAccessPolicy
public void setValue(PropertiedObject object, PropertyDefinition definition, java.lang.Object value)
PropertiedObjectEditor
setValue
in interface PropertiedObjectEditor
object
- the propertied object whose property value is to be set;
may not be nulldefinition
- the reference to the PropertyDefinition describing the
property whose value is to be changed; may not be nullvalue
- the proposed value for the property, which must be an object array if
the property is multi-valued, and which may be null if the multiplicity
includes "0"
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |