|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public static interface Container.Hierarchical
Interface for Container classes whose Items can be
arranged hierarchically. This means that the Items in the container
belong in a tree-like structure, with the following quirks:
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.itmill.toolkit.data.Container |
|---|
Container.Editor, Container.Hierarchical, Container.Indexed, Container.ItemSetChangeEvent, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeEvent, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.Sortable, Container.Viewer |
| Field Summary |
|---|
| Fields inherited from interface com.itmill.toolkit.data.Container |
|---|
NULL_ITEM_ID |
| Method Summary | |
|---|---|
boolean |
areChildrenAllowed(Object itemId)
Tests if the Item with given ID can have any children. |
Collection |
getChildren(Object itemId)
Gets the IDs of all Items that are children of the specified Item. |
Object |
getParent(Object itemId)
Gets the ID of the parent Item of the specified Item. |
boolean |
hasChildren(Object itemId)
Tests if the Item specified with itemId has any child
Items, that is, is it a leaf Item. |
boolean |
isRoot(Object itemId)
Tests if the Item specified with itemId is a root
Item. |
Collection |
rootItemIds()
Gets the IDs of all Items in the container that don't have a parent. |
boolean |
setChildrenAllowed(Object itemId,
boolean areChildrenAllowed)
Sets the given Item's capability to have children. |
boolean |
setParent(Object itemId,
Object newParentId)
Sets the parent of an Item. |
| Methods inherited from interface com.itmill.toolkit.data.Container |
|---|
addContainerProperty, addItem, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, removeAllItems, removeContainerProperty, removeItem, size |
| Method Detail |
|---|
Collection getChildren(Object itemId)
itemId - ID of the Item whose children the caller is interested in
collection
containing the IDs of all other Items that are children in
the container hierarchyObject getParent(Object itemId)
itemId - ID of the Item whose parent the caller wishes to find out.
null if the
specified Item is a root element.Collection rootItemIds()
root Items. The returned
collection is unmodifiable.
collection
containing IDs of all root elements of the container
boolean setParent(Object itemId,
Object newParentId)
throws UnsupportedOperationException
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.
This operation is optional.
itemId - ID of the item to be set as the child of the Item
identified with newParentIdnewParentId - ID of the Item that's to be the new parent of the Item
identified with itemId
true if the operation succeeded,
false if not
UnsupportedOperationExceptionboolean areChildrenAllowed(Object itemId)
Managed interface, the
items created with newItem can have children by
default.
itemId - ID of the Item in the container whose child capability is
to be tested
true if the specified Item exists in the
Container and it can have children, false if
it's not found from the container or it can't have children.
boolean setChildrenAllowed(Object itemId,
boolean areChildrenAllowed)
throws UnsupportedOperationException
Sets the given Item's capability to have children. If the Item
identified with itemId already has children and
areChildrenAllowed is false this method fails and
false is returned.
The children must be first explicitly removed with
setParent(Object itemId, Object newParentId)or
Container.removeItem(Object itemId).
This operation is optional. If it is not implemented, the method
always returns false.
itemId - ID of the Item in the container whose child capability is
to be setareChildrenAllowed - boolean value specifying if the Item can have children or
not
true if the operation succeeded,
false if not
UnsupportedOperationExceptionboolean isRoot(Object itemId)
itemId is a root
Item. The hierarchical container can have more than one root and must
have at least one unless it is empty. The
getParent(Object itemId)method always returns
null for root Items.
itemId - ID of the Item whose root status is to be tested
true if the specified Item is a root,
false if notboolean hasChildren(Object itemId)
Tests if the Item specified with itemId has any child
Items, that is, is it a leaf Item. The
getChildren(Object itemId)method always returns
null for leaf Items.
Note that being a leaf does not imply whether or not an Item is allowed to have children.
.
itemId - ID of the Item whose leaf status is to be tested
true if the specified Item is a leaf,
false if not
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||