Package muntjac :: Package ui :: Module tree_table :: Class TreeTable
[hide private]
[frames] | no frames]

Class TreeTable

source code

                            object --+                            
                                     |                            
                   util.IEventListener --+                        
                                         |                        
             terminal.paintable.IPaintable --+                    
                                             |                    
                                object --+   |                    
                                         |   |                    
    terminal.variable_owner.IVariableOwner --+                    
                                             |                    
                                object --+   |                    
                                         |   |                    
               terminal.sizeable.ISizeable --+                    
                                             |                    
                          component.IComponent --+                
                                                 |                
                                    object --+   |                
                                             |   |                
  event.method_event_source.IMethodEventSource --+                
                                                 |                
              abstract_component.AbstractComponent --+            
                                                     |            
                                object --+           |            
                                         |           |            
                   data.buffered.IBuffered --+       |            
                                             |       |            
                                object --+   |       |            
                                         |   |       |            
             data.validatable.IValidatable --+       |            
                                             |       |            
            data.buffered.IBufferedValidatable --+   |            
                                                 |   |            
                                    object --+   |   |            
                                             |   |   |            
            data.property.IValueChangeNotifier --+   |            
                                                 |   |            
                                    object --+   |   |            
                                             |   |   |            
            data.property.IValueChangeListener --+   |            
                                                 |   |            
                                object --+       |   |            
                                         |       |   |            
                     data.property.IViewer --+   |   |            
                                             |   |   |            
                         data.property.IEditor --+   |            
                                                 |   |            
                        object --+               |   |            
                                 |               |   |            
               util.IEventListener --+           |   |            
                                     |           |   |            
         terminal.paintable.IPaintable --+       |   |            
                                         |       |   |            
                            object --+   |       |   |            
                                     |   |       |   |            
terminal.variable_owner.IVariableOwner --+       |   |            
                                         |       |   |            
                            object --+   |       |   |            
                                     |   |       |   |            
           terminal.sizeable.ISizeable --+       |   |            
                                         |       |   |            
                      component.IComponent --+   |   |            
                                             |   |   |            
                          component.IFocusable --+   |            
                                                 |   |            
                                      field.IField --+            
                                                     |            
                                        object --+   |            
                                                 |   |            
                    event.action.IShortcutNotifier --+            
                                                     |            
                                        object --+   |            
                                                 |   |            
       data.property.IReadOnlyStatusChangeNotifier --+            
                                                     |            
                                        object --+   |            
                                                 |   |            
       data.property.IReadOnlyStatusChangeListener --+            
                                                     |            
                          abstract_field.AbstractField --+        
                                                         |        
                                            object --+   |        
                                                     |   |        
                             data.container.IContainer --+        
                                                         |        
                                            object --+   |        
                                                     |   |        
                                data.container.IViewer --+        
                                                         |        
                                            object --+   |        
                                                     |   |        
             data.container.IPropertySetChangeListener --+        
                                                         |        
                                            object --+   |        
                                                     |   |        
             data.container.IPropertySetChangeNotifier --+        
                                                         |        
                                            object --+   |        
                                                     |   |        
                 data.container.IItemSetChangeNotifier --+        
                                                         |        
                                            object --+   |        
                                                     |   |        
                 data.container.IItemSetChangeListener --+        
                                                         |        
                            abstract_select.AbstractSelect --+    
                                                             |    
                                        object --+           |    
                                                 |           |    
                         data.container.IContainer --+       |    
                                                     |       |    
                               data.container.IOrdered --+   |    
                                                         |   |    
                                  data.container.ISortable --+    
                                                             |    
                                            object --+       |    
                                                     |       |    
             event.item_click_event.IItemClickNotifier --+   |    
                                                         |   |    
                   event.item_click_event.IItemClickSource --+    
                                                             |    
                                                object --+   |    
                                                         |   |    
                 event.item_click_event.IItemClickNotifier --+    
                                                             |    
                                    object --+               |    
                                             |               |    
                           util.IEventListener --+           |    
                                                 |           |    
                     terminal.paintable.IPaintable --+       |    
                                                     |       |    
                                        object --+   |       |    
                                                 |   |       |    
            terminal.variable_owner.IVariableOwner --+       |    
                                                     |       |    
                                        object --+   |       |    
                                                 |   |       |    
                       terminal.sizeable.ISizeable --+       |    
                                                     |       |    
                                  component.IComponent --+   |    
                                                         |   |    
                          event.dd.drag_source.IDragSource --+    
                                                             |    
                                    object --+               |    
                                             |               |    
                           util.IEventListener --+           |    
                                                 |           |    
                     terminal.paintable.IPaintable --+       |    
                                                     |       |    
                                        object --+   |       |    
                                                 |   |       |    
            terminal.variable_owner.IVariableOwner --+       |    
                                                     |       |    
                                        object --+   |       |    
                                                 |   |       |    
                       terminal.sizeable.ISizeable --+       |    
                                                     |       |    
                                  component.IComponent --+   |    
                                                         |   |    
                          event.dd.drop_target.IDropTarget --+    
                                                             |    
                                                   table.Table --+
                                                                 |
                                                object --+       |
                                                         |       |
                                 data.container.IContainer --+   |
                                                             |   |
                                  data.container.IHierarchical --+
                                                                 |
                                                                TreeTable

TreeTable extends the Table component so that it can also visualize a hierarchy of its Items in a similar manner that {@link Tree} does. The tree hierarchy is always displayed in the first actual column of the TreeTable.

The TreeTable supports the usual {@link Table} features like lazy loading, so it should be no problem to display lots of items at once. Only required rows and some cache rows are sent to the client.

TreeTable supports standard IHierarchical container interfaces, but also a more fine tuned version - ICollapsible. A container implementing the ICollapsible interface stores the collapsed/expanded state internally and can this way scale better on the server side than with standard Hierarchical implementations. Developer must however note that ICollapsible containers can not be shared among several users as they share UI state in the container.

Instance Methods [hide private]
 
__init__(self, caption=None, dataSource=None)
Creates a TreeTable instance with optional captions and data source.
source code
 
getContainerStrategy(self) source code
 
paintRowAttributes(self, target, itemId)
A method where extended Table implementations may add their custom attributes for rows.
source code
 
paintRowIcon(self, target, cells, indexInRowbuffer) source code
 
changeVariables(self, source, variables)
Invoked when the value of a variable has changed.
source code
 
focusParent(self, itemId) source code
 
setFocusedRow(self, itemId) source code
 
paintContent(self, target)
Paints the content of this component.
source code
 
isPartialRowUpdate(self)
Subclass and override this to enable partial row updates and additions, which bypass the normal caching mechanism.
source code
 
getFirstAddedItemIndex(self)
Subclass and override this to enable partial row additions, bypassing the normal caching mechanism.
source code
 
getAddedRowCount(self)
Subclass and override this to enable partial row additions, bypassing the normal caching mechanism.
source code
 
countSubNodesRecursively(self, hc, itemId) source code
 
getFirstUpdatedItemIndex(self)
Subclass and override this to enable partial row updates, bypassing the normal caching and lazy loading mechanism.
source code
 
getUpdatedRowCount(self)
Subclass and override this to enable partial row updates, bypassing the normal caching and lazy loading mechanism.
source code
 
shouldHideAddedRows(self)
Subclass and override this to enable removing of rows, bypassing the normal caching and lazy loading mechanism.
source code
 
toggleChildVisibility(self, itemId) source code
 
size(self)
Gets the number of visible Items in the IContainer.
source code
 
__len__(self) source code
 
getContainerDataSource(self)
Gets the viewing data-source container.
source code
 
setContainerDataSource(self, newDataSource)
Sets the IContainer that serves as the data source of the viewer.
source code
 
containerItemSetChange(self, event)
IContainer datasource item set change.
source code
 
getIdByIndex(self, index) source code
 
indexOfId(self, itemId) source code
 
nextItemId(self, itemId)
Gets the ID of the Item following the Item that corresponds to itemId.
source code
 
lastItemId(self)
Gets the ID of the last Item in the IContainer.
source code
 
prevItemId(self, itemId)
Gets the ID of the Item preceding the Item that corresponds to the itemId.
source code
 
isLastId(self, itemId)
Tests if the Item corresponding to the given Item ID is the last Item in the IContainer.
source code
 
getItemIds(self)
Gets the item Id collection from the 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=None)
Gets the parent component of the component.
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 component of the component.
source code
 
setCollapsed(self, itemId, collapsed)
Sets the Item specified by given identifier collapsed or expanded.
source code
 
isCollapsed(self, itemId)
Checks if Item with given identifier is collapsed in the UI.
source code
 
setHierarchyColumn(self, hierarchyColumnId)
Explicitly sets the column in which the TreeTable visualizes the hierarchy.
source code
 
getHierarchyColumnId(self)
Returns: the identifier of column into which the hierarchy will be visualized or null if the column is not explicitly defined.
source code
 
addListener(self, listener, iface=None)
Adds an expand/collapse listener.
source code
 
addCallback(self, callback, eventType=None, *args) source code
 
removeListener(self, listener, iface=None)
Removes an expand or collapselistener.
source code
 
removeCallback(self, callback, eventType=None) source code
 
fireExpandEvent(self, itemId)
Emits an expand event.
source code
 
fireCollapseEvent(self, itemId)
Emits a collapse event.
source code
 
isAnimationsEnabled(self)
@return true if animations are enabled
source code
 
setAnimationsEnabled(self, animationsEnabled)
Animations can be enabled by passing true to this method.
source code

Inherited from table.Table: addActionHandler, addContainerProperty, addGeneratedColumn, addItem, addItemAfter, areColumnHeadersEnabled, attach, containerPropertySetChange, detach, disableContentRefreshing, enableContentRefreshing, findAndPaintBodyActions, findCellsWithComponents, findNumRowsToPaint, findSelectedKeys, fireColumnResizeEvent, firstItemId, formatPropertyValue, getCacheRate, getCellStyleGenerator, getColumnAlignment, getColumnAlignments, getColumnExpandRatio, getColumnFooter, getColumnGenerator, getColumnHeader, getColumnHeaderMode, getColumnHeaders, getColumnIcon, getColumnIcons, getColumnWidth, getCurrentPageFirstItemId, getCurrentPageFirstItemIndex, getCurrentlyRenderedItemIds, getDragMode, getDropHandler, getFieldFactory, getItemDescriptionGenerator, getItemIdsInRange, getMultiSelectMode, getPageLength, getPropertyValue, getRowGenerator, getRowHeaderMode, getSortContainerPropertyId, getSortableContainerPropertyIds, getTableFieldFactory, getTransferable, getVisibleCells, getVisibleCellsInsertIntoCache, getVisibleCellsNoCache, getVisibleCellsUpdateCacheRows, getVisibleColumns, getVisibleItemIds, handleClickEvent, handleColumnResizeEvent, handleColumnWidthUpdates, handleSelectedItems, isColumnCollapsed, isColumnCollapsingAllowed, isColumnReorderingAllowed, isEditable, isFirstId, isFooterVisible, isPageBufferingEnabled, isRowCacheInvalidated, isSelectable, isSortAscending, isSortDisabled, listenProperty, paintActions, paintAvailableColumns, paintCellTooltips, paintColumnOrder, paintColumnWidth, paintDragMode, paintGeneratedRowInfo, paintPartialRowAdditions, paintPartialRowUpdate, paintPartialRowUpdates, paintRow, paintRowHeader, paintRowTooltips, paintRows, paintSelectMode, paintSorting, paintTabIndex, paintTableAttributes, paintVisibleColumnOrder, paintVisibleColumns, refreshCurrentPage, refreshRenderedCells, refreshRowCache, registerComponent, removeActionHandler, removeAllActionHandlers, removeAllItems, removeContainerProperty, removeGeneratedColumn, removeItem, removeRowsFromCacheAndFillBottom, requestRepaint, requestRepaintAll, resetPageBuffer, resetVariablesAndPageBuffer, rowHeadersAreEnabled, setCacheRate, setCellStyleGenerator, setColumnAlignment, setColumnAlignments, setColumnCollapsed, setColumnCollapsingAllowed, setColumnExpandRatio, setColumnFooter, setColumnHeader, setColumnHeaderMode, setColumnHeaders, setColumnIcon, setColumnIcons, setColumnOrder, setColumnReorderingAllowed, setColumnWidth, setCurrentPageFirstItemId, setCurrentPageFirstItemIndex, setDragMode, setDropHandler, setEditable, setEnabled, setFieldFactory, setFooterVisible, setItemDescriptionGenerator, setLazyLoading, setMultiSelectMode, setNewItemsAllowed, setPageBufferingEnabled, setPageLength, setRowCacheInvalidated, setRowGenerator, setRowHeaderMode, setSelectable, setSortAscending, setSortContainerPropertyId, setSortDisabled, setTableFieldFactory, setVisibleColumns, shouldHideNullSelectionItem, sort, translateDropTargetDetails, unregisterComponent, unregisterComponentsAndPropertiesInRows, unregisterPropertiesAndComponents, valueChange

Inherited from abstract_select.AbstractSelect: containsId, fireItemSetChange, firePropertySetChange, getCaptionChangeListener, getContainerProperty, getContainerPropertyIds, getItem, getItemCaption, getItemCaptionMode, getItemCaptionPropertyId, getItemIcon, getItemIconPropertyId, getListeners, getNewItemHandler, getNullSelectionItemId, getType, getValue, isEmpty, isMultiSelect, isNewItemsAllowed, isNullSelectionAllowed, isSelected, paintItem, select, setItemCaption, setItemCaptionMode, setItemCaptionPropertyId, setItemIcon, setItemIconPropertyId, setMultiSelect, setNewItemHandler, setNullSelectionAllowed, setNullSelectionItemId, setValue, unselect

Inherited from abstract_field.AbstractField: __str__, addShortcutListener, addValidator, commit, discard, fireReadOnlyStatusChange, fireValueChange, focus, getActionManager, getErrorMessage, getPropertyDataSource, getRequiredError, getTabIndex, getValidators, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isReadThrough, isRequired, isValid, isValidationVisible, isWriteThrough, readOnlyStatusChange, readValueFromProperty, removeShortcutListener, removeValidator, setCurrentBufferedSourceException, setInternalValue, setInvalidAllowed, setInvalidCommitted, setPropertyDataSource, setReadOnly, setReadThrough, setRequired, setRequiredError, setTabIndex, setValidationVisible, setWriteThrough, shouldHideErrors, validate

Inherited from abstract_component.AbstractComponent: __getstate__, __setstate__, addStyleName, childRequestedRepaint, fireComponentErrorEvent, fireComponentEvent, fireEvent, fireRequestRepaintEvent, getApplication, getCSSHeight, getCSSWidth, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getHeight, getHeightUnits, getIcon, getLocale, getStyle, getStyleName, getWidth, getWidthUnits, getWindow, handleError, hasListeners, isEnabled, isImmediate, isVisible, paint, parseStringSize, registerCallback, registerListener, removeStyleName, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setErrorHandler, setHeight, setHeightUnits, setIcon, setImmediate, setLocale, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, setWidth, setWidthUnits, withdrawCallback, withdrawListener

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

Class Methods [hide private]

Inherited from abstract_field.AbstractField: constructField

Class Variables [hide private]

Inherited from table.Table: ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, CELL_FIRSTCOL, CELL_GENERATED_ROW, CELL_HEADER, CELL_ICON, CELL_ITEMID, CELL_KEY, CLIENT_WIDGET, COLUMN_HEADER_MODE_EXPLICIT, COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID, COLUMN_HEADER_MODE_HIDDEN, COLUMN_HEADER_MODE_ID, ROW_HEADER_MODE_EXPLICIT, ROW_HEADER_MODE_EXPLICIT_DEFAULTS_ID, ROW_HEADER_MODE_HIDDEN, ROW_HEADER_MODE_ICON_ONLY, ROW_HEADER_MODE_ID, ROW_HEADER_MODE_INDEX, ROW_HEADER_MODE_ITEM, ROW_HEADER_MODE_PROPERTY

Inherited from abstract_select.AbstractSelect: ITEM_CAPTION_MODE_EXPLICIT, ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID, ITEM_CAPTION_MODE_ICON_ONLY, ITEM_CAPTION_MODE_ID, ITEM_CAPTION_MODE_INDEX, ITEM_CAPTION_MODE_ITEM, ITEM_CAPTION_MODE_PROPERTY

Inherited from abstract_component.AbstractComponent: SIZE_PATTERN

Inherited from terminal.sizeable.ISizeable: SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS, UNIT_SYMBOLS

Instance Variables [hide private]

Inherited from table.Table: alwaysRecalculateColumnWidths

Inherited from abstract_select.AbstractSelect: itemIdMapper, items

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, caption=None, dataSource=None)
(Constructor)

source code 

Creates a TreeTable instance with optional captions and data source.

Parameters:
  • caption - the caption for the component
  • dataSource - the dataSource that is used to list items in the component
Overrides: object.__init__

paintRowAttributes(self, target, itemId)

source code 

A method where extended Table implementations may add their custom attributes for rows.

Overrides: table.Table.paintRowAttributes
(inherited documentation)

paintRowIcon(self, target, cells, indexInRowbuffer)

source code 
Overrides: table.Table.paintRowIcon

changeVariables(self, source, variables)

source code 

Invoked when the value of a variable has changed.

Parameters:
  • source - the Source of the variable change. This is the origin of the event. For example in Web Adapter this is the request.
  • variables - the Mapping from variable names to new variable values.
Overrides: terminal.variable_owner.IVariableOwner.changeVariables
(inherited documentation)

paintContent(self, target)

source code 

Paints the content of this component.

Parameters:
  • target - the Paint Event.
Raises:
Overrides: abstract_component.AbstractComponent.paintContent
(inherited documentation)

isPartialRowUpdate(self)

source code 

Subclass and override this to enable partial row updates and additions, which bypass the normal caching mechanism. This is useful for e.g. TreeTable.

Returns:
true if this update is a partial row update, false if not. For plain Table it is always false.
Overrides: table.Table.isPartialRowUpdate
(inherited documentation)

getFirstAddedItemIndex(self)

source code 

Subclass and override this to enable partial row additions, bypassing the normal caching mechanism. This is useful for e.g. TreeTable, where expanding a node should only fetch and add the items inside of that node.

Returns:
The index of the first added item. For plain Table it is always 0.
Overrides: table.Table.getFirstAddedItemIndex
(inherited documentation)

getAddedRowCount(self)

source code 

Subclass and override this to enable partial row additions, bypassing the normal caching mechanism. This is useful for e.g. TreeTable, where expanding a node should only fetch and add the items inside of that node.

Returns:
the number of rows to be added, starting at the index returned by getFirstAddedItemIndex. For plain Table it is always 0.
Overrides: table.Table.getAddedRowCount
(inherited documentation)

getFirstUpdatedItemIndex(self)

source code 

Subclass and override this to enable partial row updates, bypassing the normal caching and lazy loading mechanism. This is useful for updating the state of certain rows, e.g. in the TreeTable the collapsed state of a single node is updated using this mechanism.

Returns:
the index of the first item to be updated. For plain Table it is always 0.
Overrides: table.Table.getFirstUpdatedItemIndex
(inherited documentation)

getUpdatedRowCount(self)

source code 
Subclass and override this to enable partial row updates, bypassing
the normal caching and lazy loading mechanism. This is useful for
updating the state of certain rows, e.g. in the TreeTable the collapsed
state of a single node is updated using this mechanism.

@return: the number of rows to update, starting at the index returned
         by L{getFirstUpdatedItemIndex}. For plain table it is always
         0.

Overrides: table.Table.getUpdatedRowCount
(inherited documentation)

shouldHideAddedRows(self)

source code 

Subclass and override this to enable removing of rows, bypassing the normal caching and lazy loading mechanism. This is useful for e.g. TreeTable, when you need to hide certain rows as a node is collapsed.

This should return true if the rows pointed to by getFirstAddedItemIndex and getAddedRowCount should be hidden instead of added.

Returns:
whether the rows to add (see getFirstAddedItemIndex and getAddedRowCount) should be added or hidden. For plain Table it is always false.
Overrides: table.Table.shouldHideAddedRows
(inherited documentation)

size(self)

source code 

Gets the number of visible Items in the IContainer.

Filtering can hide items so that they will not be visible through the container API.

Returns:
number of Items in the IContainer
Overrides: data.container.IContainer.size
(inherited documentation)

__len__(self)
(Length operator)

source code 
Overrides: abstract_select.AbstractSelect.__len__

getContainerDataSource(self)

source code 

Gets the viewing data-source container.

Returns:
data source IContainer
Overrides: data.container.IViewer.getContainerDataSource
(inherited documentation)

setContainerDataSource(self, newDataSource)

source code 

Sets the IContainer that serves as the data source of the viewer.

As a side-effect the fields value (selection) is set to null due old selection not necessary exists in new IContainer.

Parameters:
  • newDataSource - the new data source.
Overrides: data.container.IViewer.setContainerDataSource
(inherited documentation)

containerItemSetChange(self, event)

source code 

IContainer datasource item set change. Table must flush its buffers on change.

Parameters:
  • event - change event text
Overrides: data.container.IItemSetChangeListener.containerItemSetChange
(inherited documentation)

getIdByIndex(self, index)

source code 
Overrides: table.Table.getIdByIndex

indexOfId(self, itemId)

source code 
Overrides: table.Table.indexOfId

nextItemId(self, itemId)

source code 

Gets the ID of the Item following the Item that corresponds to itemId.

Parameters:
  • itemId - ID of a visible Item in the IContainer
Returns:
ID of the next visible Item or None
Overrides: data.container.IOrdered.nextItemId
(inherited documentation)

lastItemId(self)

source code 

Gets the ID of the last Item in the IContainer.

Returns:
ID of the last visible Item in the IContainer
Overrides: data.container.IOrdered.lastItemId
(inherited documentation)

prevItemId(self, itemId)

source code 

Gets the ID of the Item preceding the Item that corresponds to the itemId.

Parameters:
  • itemId - ID of a visible Item in the IContainer
Returns:
ID of the previous visible Item or None
Overrides: data.container.IOrdered.prevItemId
(inherited documentation)

isLastId(self, itemId)

source code 

Tests if the Item corresponding to the given Item ID is the last Item in the IContainer.

Returns:
True if the Item is last visible item in the IContainer, False if not
Overrides: data.container.IOrdered.isLastId
(inherited documentation)

getItemIds(self)

source code 

Gets the item Id collection from the container.

Returns:
the Collection of item ids.
Overrides: data.container.IContainer.getItemIds
(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=None)

source code 

Gets the parent component of the component.

Components can be nested but a component can have only one parent. A component that contains other components, that is, can be a parent, should usually inherit the ComponentContainer interface.

Parameters:
  • itemId - ID of the Item whose parent the caller wishes to find out.
Returns:
the parent component
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 component of the component.

This method automatically calls attach if the parent becomes attached to the application, regardless of whether it was attached previously. Conversely, if the parent is None and the component is attached to the application, detach is called for the component.

This method is rarely called directly. The ComponentContainer.addComponent method is normally used for adding components to a container and it will call this method implicitly.

It is not possible to change the parent without first setting the parent to None.

Parameters:
  • parent - the parent component
Returns:
True if the operation succeeded, False if not
Raises:
  • ValueError - if a parent is given even though the component already has a parent
Overrides: data.container.IHierarchical.setParent
(inherited documentation)

setCollapsed(self, itemId, collapsed)

source code 

Sets the Item specified by given identifier collapsed or expanded. If the Item is collapsed, its children is not displayed in for the user.

Parameters:
  • itemId - the identifier of the Item
  • collapsed - true if the Item should be collapsed, false if expanded

isCollapsed(self, itemId)

source code 

Checks if Item with given identifier is collapsed in the UI.

Parameters:
  • itemId - the identifier of the checked Item
Returns:
true if the Item with given id is collapsed

setHierarchyColumn(self, hierarchyColumnId)

source code 

Explicitly sets the column in which the TreeTable visualizes the hierarchy. If hierarchyColumnId is not set, the hierarchy is visualized in the first visible column.

getHierarchyColumnId(self)

source code 
Returns:
the identifier of column into which the hierarchy will be visualized or null if the column is not explicitly defined.

addListener(self, listener, iface=None)

source code 

Adds an expand/collapse listener.

Parameters:
  • listener - the Listener to be added.
Raises:
  • ValueError - unless method has a match in object
Overrides: data.container.IItemSetChangeNotifier.addListener

addCallback(self, callback, eventType=None, *args)

source code 
Overrides: data.container.IItemSetChangeNotifier.addCallback

removeListener(self, listener, iface=None)

source code 

Removes an expand or collapselistener.

Parameters:
  • listener - the Listener to be removed.
Overrides: data.container.IItemSetChangeNotifier.removeListener

removeCallback(self, callback, eventType=None)

source code 
Overrides: data.container.IItemSetChangeNotifier.removeCallback

fireExpandEvent(self, itemId)

source code 

Emits an expand event.

Parameters:
  • itemId - the item id.

fireCollapseEvent(self, itemId)

source code 

Emits a collapse event.

Parameters:
  • itemId - the item id.

setAnimationsEnabled(self, animationsEnabled)

source code 
Animations can be enabled by passing true to this method. Currently
expanding rows slide in from the top and collapsing rows slide out the
same way. NOTE! not supported in Internet Explorer 6 or 7.

@param animationsEnabled
           true or false whether to enable animations or not.