Package muntjac :: Package ui :: Package treetable :: Module hierarchical_container_ordered_wrapper :: Class HierarchicalContainerOrderedWrapper
[hide private]
[frames] | no frames]

Class HierarchicalContainerOrderedWrapper

source code

                                         object --+            
                                                  |            
                          data.container.IContainer --+        
                                                      |        
                                data.container.IOrdered --+    
                                                          |    
                                             object --+   |    
                                                      |   |    
                  data.container.IItemSetChangeNotifier --+    
                                                          |    
                                             object --+   |    
                                                      |   |    
              data.container.IPropertySetChangeNotifier --+    
                                                          |    
data.util.container_ordered_wrapper.ContainerOrderedWrapper --+
                                                              |
                                             object --+       |
                                                      |       |
                              data.container.IContainer --+   |
                                                          |   |
                               data.container.IHierarchical --+
                                                              |
                                                             HierarchicalContainerOrderedWrapper

Helper for TreeTable. Does the same thing as ContainerOrderedWrapper to fit into table but retains Hierarchical feature.

Instance Methods [hide private]
 
__init__(self, toBeWrapped)
Constructs a new ordered wrapper for an existing Container.
source code
 
areChildrenAllowed(self, itemId)
Tests if the Item with given ID can have children.
source code
 
getChildren(self, itemId)
Gets the IDs of all Items that are children of the specified Item.
source code
 
getParent(self, itemId)
Gets the ID of the parent Item of the specified Item.
source code
 
hasChildren(self, itemId)
Tests if the Item specified with itemId has child Items or if it is a leaf.
source code
 
isRoot(self, itemId)
Tests if the Item specified with itemId is a root Item.
source code
 
rootItemIds(self)
Gets the IDs of all Items in the container that don't have a parent.
source code
 
setChildrenAllowed(self, itemId, areChildrenAllowed)
Sets the given Item's capability to have children.
source code
 
setParent(self, itemId, newParentId)
Sets the parent of an Item.
source code

Inherited from data.util.container_ordered_wrapper.ContainerOrderedWrapper: __len__, addCallback, addContainerProperty, addItem, addItemAfter, addListener, addToOrderWrapper, containsId, firstItemId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, isFirstId, isLastId, lastItemId, nextItemId, prevItemId, removeAllItems, removeCallback, removeContainerProperty, removeFromOrderWrapper, removeItem, removeListener, size, updateOrderWrapper

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, toBeWrapped)
(Constructor)

source code 
Constructs a new ordered wrapper for an existing Container. Works even if
the to-be-wrapped container already implements the Container.Ordered
interface.

@param toBeWrapped
           the container whose contents need to be ordered.

Overrides: object.__init__
(inherited documentation)

areChildrenAllowed(self, itemId)

source code 

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:
True if the specified Item exists in the IContainer and it can have children, False if it's not found from the container or it can't have children.
Overrides: data.container.IHierarchical.areChildrenAllowed
(inherited documentation)

getChildren(self, itemId)

source code 

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 iterable containing the IDs of all other Items that are children in the container hierarchy
Overrides: data.container.IHierarchical.getChildren
(inherited documentation)

getParent(self, itemId)

source code 

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 None if the specified Item is a root element.
Overrides: data.container.IHierarchical.getParent
(inherited documentation)

hasChildren(self, itemId)

source code 

Tests if the Item specified with itemId has child Items or if it is a leaf. The getChildren method always returns None for 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:
True if the specified Item has children, False if not (is a leaf)
Overrides: data.container.IHierarchical.hasChildren
(inherited documentation)

isRoot(self, itemId)

source code 

Tests if the Item specified with 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 method always returns None for root Items.

Parameters:
  • itemId - ID of the Item whose root status is to be tested
Returns:
True if the specified Item is a root, False if not
Overrides: data.container.IHierarchical.isRoot
(inherited documentation)

rootItemIds(self)

source code 

Gets the IDs of all Items in the container that don't have a parent. Such items are called root Items. The returned collection is unmodifiable.

Returns:
An iterable containing IDs of all root elements of the container
Overrides: data.container.IHierarchical.rootItemIds
(inherited documentation)

setChildrenAllowed(self, itemId, areChildrenAllowed)

source code 

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 or removeItem.

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 set
  • areChildrenAllowed - boolean value specifying if the Item can have children or not
Returns:
True if the operation succeeded, False if not
Overrides: data.container.IHierarchical.setChildrenAllowed
(inherited documentation)

setParent(self, itemId, newParentId)

source code 

Sets the parent of an Item. The new parent item must exist and be able to have children. (areChildrenAllowed == True). It is also possible to detach a node from the hierarchy (and thus make it root) by setting the parent None.

This operation is optional.

Parameters:
  • itemId - ID of the item to be set as the child of the Item identified with newParentId
  • newParentId - ID of the Item that's to be the new parent of the Item identified with itemId
Returns:
True if the operation succeeded, False if not
Overrides: data.container.IHierarchical.setParent
(inherited documentation)