| java.lang.Object org.millstone.base.data.util.ContainerHierarchicalWrapper
ContainerHierarchicalWrapper | public ContainerHierarchicalWrapper(Container toBeWrapped)(Code) | | Constructs a new hierarchical wrapper for an existing Container.
Works even if the to-be-wrapped container already implements the
Container.Hierarchical interface.
Parameters: toBeWrapped - the container that needs to be accessedhierarchically |
addContainerProperty | public boolean addContainerProperty(Object propertyId, Class type, Object defaultValue) throws UnsupportedOperationException(Code) | | Adds a new Property to all Items in the Container.
Parameters: propertyId - ID of the new Property Parameters: type - Data type of the new Property Parameters: defaultValue - The value all created Properties areinitialized to true if the operation succeeded,false if not |
addItem | public Object addItem() throws UnsupportedOperationException(Code) | | Creates a new Item into the Container, assigns it an
automatic ID, and adds it to the hierarchy.
the autogenerated ID of the new Item or null if the operation failed |
areChildrenAllowed | public boolean areChildrenAllowed(Object itemId)(Code) | | |
removeAllItems | public boolean removeAllItems() throws UnsupportedOperationException(Code) | | Removes all items from the underlying container and from the
hierarcy.
true if the operation succeeded,false if not |
removeContainerProperty | public boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException(Code) | | Removes the specified Property from the underlying container and
from the hierarchy. Note that the Property will be removed from all
Items in the Container.
Parameters: propertyId - ID of the Property to remove true if the operation succeeded,false if not |
removeItem | public boolean removeItem(Object itemId) throws UnsupportedOperationException(Code) | | Removes an Item specified by itemId from the underlying
container and from the hierarcy.
true if the operation succeeded,false if not |
setParent | public boolean setParent(Object itemId, Object newParentId)(Code) | | Sets the parent of an Item. The new parent item must exist and be
able to have children.
(canHaveChildren(newParentId) == true ). It is also
possible to detach a node from the hierarchy (and thus make it root)
by setting the parent null .
Parameters: itemId - ID of the item to be set as the child of the Itemidentified with newParentId Parameters: newParentId - ID of the Item that's to be the new parentof the Item identified with itemId true if the operation succeeded,false if not |
updateHierarchicalWrapper | public void updateHierarchicalWrapper()(Code) | | Updates the wrapper's internal hierarchy data to include all Items
in the underlying container. If the contents of the wrapped container
change without the wrapper's knowledge, this method needs to be
called to update the hierarchy information of the Items.
|
|
|