Interface Container.Hierarchical
-
- All Superinterfaces:
Container,Serializable
- All Known Subinterfaces:
Collapsible
- All Known Implementing Classes:
ContainerHierarchicalWrapper,FilesystemContainer,HierarchicalContainer,HierarchicalContainerOrderedWrapper,Tree,TreeTable
- Enclosing interface:
- Container
@Deprecated public static interface Container.Hierarchical extends Container
Deprecated.SeeHierarchicalDataProviderand its implementations.Interface for
Containerclasses whose Items can be arranged hierarchically. This means that the Items in the container belong in a tree-like structure, with the following quirks:- The Item structure may have more than one root elements
- The Items in the hierarchy can be declared explicitly to be able or unable to have children.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.v7.data.Container
Container.Editor, Container.Filter, Container.Filterable, Container.Hierarchical, Container.Indexed, Container.ItemSetChangeEvent, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeEvent, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.SimpleFilterable, Container.Sortable, Container.Viewer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleanareChildrenAllowed(Object itemId)Deprecated.Tests if the Item with given ID can have children.Collection<?>getChildren(Object itemId)Deprecated.Gets the IDs of all Items that are children of the specified Item.ObjectgetParent(Object itemId)Deprecated.Gets the ID of the parent Item of the specified Item.booleanhasChildren(Object itemId)Deprecated.Tests if the Item specified withitemIdhas child Items or if it is a leaf.booleanisRoot(Object itemId)Deprecated.Tests if the Item specified withitemIdis a root Item.booleanremoveItem(Object itemId)Deprecated.Removes the Item identified byItemIdfrom the Container.Collection<?>rootItemIds()Deprecated.Gets the IDs of all Items in the container that don't have a parent.booleansetChildrenAllowed(Object itemId, boolean areChildrenAllowed)Deprecated.Sets the given Item's capability to have children.booleansetParent(Object itemId, Object newParentId)Deprecated.Sets the parent of an Item.-
Methods inherited from interface com.vaadin.v7.data.Container
addContainerProperty, addItem, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, removeAllItems, removeContainerProperty, size
-
-
-
-
Method Detail
-
getChildren
Collection<?> getChildren(Object itemId)
Deprecated.Gets the IDs of all Items that are children of the specified Item. The returned collection is unmodifiable.- Parameters:
itemId- ID of the Item whose children the caller is interested in- Returns:
- An unmodifiable
collectioncontaining the IDs of all other Items that are children in the container hierarchy;nullif item does not have any children.
-
getParent
Object getParent(Object itemId)
Deprecated.Gets the ID of the parent Item of the specified Item.- Parameters:
itemId- ID of the Item whose parent the caller wishes to find out.- Returns:
- the ID of the parent Item. Will be
nullif the specified Item is a root element.
-
rootItemIds
Collection<?> rootItemIds()
Deprecated.Gets the IDs of all Items in the container that don't have a parent. Such items are calledrootItems. The returned collection is unmodifiable.- Returns:
- An unmodifiable
collectioncontaining IDs of all root elements of the container
-
setParent
boolean setParent(Object itemId, Object newParentId) throws UnsupportedOperationException
Deprecated.Sets the parent of an Item. The new parent item must exist and be able to have children. (
). It is also possible to detach a node from the hierarchy (and thus make it root) by setting the parentareChildrenAllowed(Object)== truenull.This operation is optional.
- Parameters:
itemId- ID of the item to be set as the child of the Item identified withnewParentIdnewParentId- ID of the Item that's to be the new parent of the Item identified withitemId- Returns:
trueif the operation succeeded,falseif not- Throws:
UnsupportedOperationException
-
areChildrenAllowed
boolean areChildrenAllowed(Object itemId)
Deprecated.Tests if the Item with given ID can have children.- Parameters:
itemId- ID of the Item in the container whose child capability is to be tested- Returns:
trueif the specified Item exists in the Container and it can have children,falseif it's not found from the container or it can't have children.
-
setChildrenAllowed
boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed) throws UnsupportedOperationException
Deprecated.Sets the given Item's capability to have children. If the Item identified with
itemIdalready has children andis false this method fails andareChildrenAllowed(Object)falseis returned.The children must be first explicitly removed with
setParent(Object itemId, Object newParentId)orContainer.removeItem(Object itemId).This operation is optional. If it is not implemented, the method always returns
false.- Parameters:
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- Returns:
trueif the operation succeeded,falseif not- Throws:
UnsupportedOperationException
-
isRoot
boolean isRoot(Object itemId)
Deprecated.Tests if the Item specified withitemIdis a root Item. The hierarchical container can have more than one root and must have at least one unless it is empty. ThegetParent(Object itemId)method always returnsnullfor root Items.- Parameters:
itemId- ID of the Item whose root status is to be tested- Returns:
trueif the specified Item is a root,falseif not
-
hasChildren
boolean hasChildren(Object itemId)
Deprecated.Tests if the Item specified with
itemIdhas child Items or if it is a leaf. ThegetChildren(Object itemId)method always returnsnullfor leaf Items.Note that being a leaf does not imply whether or not an Item is allowed to have children.
- Parameters:
itemId- ID of the Item to be tested- Returns:
trueif the specified Item has children,falseif not (is a leaf)
-
removeItem
boolean removeItem(Object itemId) throws UnsupportedOperationException
Deprecated.Removes the Item identified by
ItemIdfrom the Container.Note that this does not remove any children the item might have.
- Specified by:
removeItemin interfaceContainer- Parameters:
itemId- ID of the Item to remove- Returns:
trueif the operation succeeded,falseif not- Throws:
UnsupportedOperationException- if the container does not support removing individual items
-
-