|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.common.tree.directory.FileSystemEntryEditor
public class FileSystemEntryEditor
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 |
Constructor Summary | |
---|---|
protected |
FileSystemEntryEditor(FileSystemView view)
|
Method Summary | |
---|---|
protected void |
assertDescendentOfRoot(TreeNode descendent)
|
protected FileSystemEntry |
assertFileSystemEntry(PropertiedObject obj)
|
protected FileSystemEntry |
assertFileSystemEntry(TreeNode obj)
|
TreeNode |
copy(TreeNode node,
TreeNode newParent)
Copy this TreeNode as a child of the specified new parent. |
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 |
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. |
protected TreeNode |
getActualParent(TreeNode possibleParent)
|
java.util.List |
getAllowedValues(PropertiedObject obj,
PropertyDefinition def)
Get the allowed values for the property on the specified object. |
PropertyDefinition |
getDescriptionPropertyDefinition(TreeNode obj)
Filter the specified PropertyDefinition instances and return the first definition that is mapped to "the description" property for the metadata 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. |
protected java.lang.String |
getNewFileName()
|
protected java.lang.String |
getNewFolderName()
|
PropertyAccessPolicy |
getPolicy()
|
java.util.List |
getPropertyDefinitions(PropertiedObject obj)
Obtain the list of PropertyDefinitions that apply to the specified object's type. |
java.lang.Object |
getValue(PropertiedObject obj,
PropertyDefinition def)
Obtain from the specified PropertiedObject the property value that corresponds to the specified PropertyDefinition. |
protected FileSystemView |
getView()
|
boolean |
isAncestorOf(TreeNode ancestor,
TreeNode descendent)
Determine whether the specified node is a descendent of the given ancestor node. |
boolean |
isMarked(TreeNode entry)
Return the marked state of the specified entry. |
boolean |
isNameValid(java.lang.String newName)
Determine whether the specified name is valid for a file or folder on the current file system. |
boolean |
isParentOf(TreeNode parent,
TreeNode child)
Determine whether the specified node is a child of the given parent node. |
boolean |
isReadOnly(PropertiedObject obj)
Return whether this editor may be used to set property values on the specified PropertiedObject. |
boolean |
isReadOnly(PropertiedObject obj,
PropertyDefinition def)
|
boolean |
isValidValue(PropertiedObject obj,
PropertyDefinition def,
java.lang.Object value)
Return whether the specified value is considered valid. |
boolean |
makeExist(DirectoryEntry entry)
Check for the existance of the specified entry, and creates an underlying resource for the entry if one does not exist. |
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 |
reset(PropertiedObject obj)
|
void |
setMarked(TreeNode entry,
boolean marked)
Set the marked state of the TreeNode entry. |
void |
setPolicy(PropertyAccessPolicy policy)
|
void |
setReadOnly(PropertiedObject obj,
boolean readOnly)
|
void |
setReadOnly(PropertiedObject obj,
PropertyDefinition def,
boolean readOnly)
|
void |
setValue(PropertiedObject obj,
PropertyDefinition def,
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 |
---|
protected FileSystemEntryEditor(FileSystemView view)
Method Detail |
---|
protected FileSystemView getView()
protected TreeNode getActualParent(TreeNode possibleParent)
public void setMarked(TreeNode entry, boolean marked)
setMarked
in interface TreeNodeEditor
marked
- the marked state of the entry.public boolean isMarked(TreeNode entry)
isMarked
in interface TreeNodeEditor
public boolean isParentOf(TreeNode parent, TreeNode child)
isParentOf
in interface TreeNodeEditor
public boolean isAncestorOf(TreeNode ancestor, TreeNode descendent)
isAncestorOf
in interface TreeNodeEditor
public TreeNode create(TreeNode parent, ObjectDefinition type)
The resulting node will not exist (see makeExist()
)
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.
java.lang.IllegalArgumentException
- if the parent and the new TreeNode
are not compatible
java.lang.AssertionError
- if parent
or type
is nullpublic TreeNode create(TreeNode parent, java.lang.String name, ObjectDefinition type)
The resulting node will not exist (see makeExist()
)
create
in interface TreeNodeEditor
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 nullpublic boolean makeExist(DirectoryEntry entry)
makeExist
in interface DirectoryEntryEditor
obj
- the node to be deleted; may not be null
java.lang.AssertionError
- if obj
is nullpublic boolean delete(TreeNode node)
delete
in interface TreeNodeEditor
obj
- the node to be deleted; may not be null
java.lang.AssertionError
- if obj
is nullpublic TreeNode 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.
paste
in interface TreeNodeEditor
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 nullpublic boolean 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.
move
in interface TreeNodeEditor
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 nullpublic boolean 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.
move
in interface TreeNodeEditor
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
public boolean moveChild(TreeNode child, int newIndex)
moveChild
in interface TreeNodeEditor
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 nullpublic TreeNode copy(TreeNode node, TreeNode newParent)
obj
- the node to be copied; may not be null and must existnewParent
- the node that is to be considered the
parent of the copied instance; may not be null
java.lang.AssertionError
- if either of obj
or newParent
is nullpublic boolean rename(TreeNode node, java.lang.String newName)
rename
in interface TreeNodeEditor
newName
- the new name for the object; may not be null or zero-length,
and must not be used by an existing sibling
public java.util.List getPropertyDefinitions(PropertiedObject obj)
getPropertyDefinitions
in interface PropertiedObjectEditor
obj
- the propertied object for which the PropertyDefinitions are
to be obtained; may not be null
java.lang.AssertionError
- if obj
is nullpublic java.util.List getAllowedValues(PropertiedObject obj, PropertyDefinition def)
getAllowedValues
in interface PropertiedObjectEditor
obj
- 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)
getNamePropertyDefinition
in interface TreeNodeEditor
obj
- the tree node; may not be null
public PropertyDefinition getDescriptionPropertyDefinition(TreeNode obj)
getDescriptionPropertyDefinition
in interface DirectoryEntryEditor
obj
- the tree node; may not be null
public boolean isNameValid(java.lang.String newName)
isNameValid
in interface DirectoryEntryEditor
newName
- the new name to be checked
public java.lang.Object getValue(PropertiedObject obj, PropertyDefinition def)
getValue
in interface PropertiedObjectEditor
obj
- 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
java.lang.AssertionError
- if either of obj
or def
is nullpublic boolean isValidValue(PropertiedObject obj, PropertyDefinition def, java.lang.Object value)
isValidValue
in interface PropertiedObjectEditor
obj
- the propertied object whose property value is to be validated;
may not be nulldef
- 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 may be a collection if
the property is multi-valued, or may be null if the multiplicity
includes "0"
java.lang.AssertionError
- if either of obj
or def
is nullpublic void setValue(PropertiedObject obj, PropertyDefinition def, java.lang.Object value)
setValue
in interface PropertiedObjectEditor
obj
- the propertied object whose property value is to be set;
may not be nulldef
- the reference to the PropertyDefinition describing the
property whose value is to be changed; may not be nullvalue
- the new value for the property; the cardinality and type
must conform PropertyDefinition
java.lang.IllegalArgumentException
- if the value does not correspond
to the PropertyDefinition requirements.
java.lang.AssertionError
- if either of obj
or def
is nullpublic void setPolicy(PropertyAccessPolicy policy)
setPolicy
in interface PropertiedObjectEditor
public PropertyAccessPolicy getPolicy()
getPolicy
in interface PropertiedObjectEditor
public boolean isReadOnly(PropertiedObject obj)
isReadOnly
in interface PropertiedObjectEditor
isReadOnly
in interface PropertyAccessPolicy
obj
- the propertied object; may not be null
java.lang.AssertionError
- if obj
is nullpublic boolean isReadOnly(PropertiedObject obj, PropertyDefinition def)
isReadOnly
in interface PropertyAccessPolicy
public void setReadOnly(PropertiedObject obj, PropertyDefinition def, boolean readOnly)
setReadOnly
in interface PropertyAccessPolicy
public void setReadOnly(PropertiedObject obj, boolean readOnly)
setReadOnly
in interface PropertyAccessPolicy
public void reset(PropertiedObject obj)
reset
in interface PropertyAccessPolicy
public UserTransaction createReadTransaction()
createReadTransaction
in interface UserTransactionFactory
public UserTransaction createWriteTransaction()
createWriteTransaction
in interface UserTransactionFactory
public UserTransaction createWriteTransaction(java.lang.Object source)
createWriteTransaction
in interface UserTransactionFactory
source
- the object that is considered to be the source of the transaction;
may be null
protected FileSystemEntry assertFileSystemEntry(TreeNode obj)
protected FileSystemEntry assertFileSystemEntry(PropertiedObject obj)
protected void assertDescendentOfRoot(TreeNode descendent)
protected java.lang.String getNewFolderName()
protected java.lang.String getNewFileName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |