Package muntjac :: Package ui :: Module table :: Class Table
[hide private]
[frames] | no frames]

Class Table

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 is used for representing data or components in a pageable and selectable table.

Scalability of the Table is largely dictated by the container. A table does not have a limit for the number of items and is just as fast with hundreds of thousands of items as with just a few. The current GWT implementation with scrolling however limits the number of rows to around 500000, depending on the browser and the pixel height of rows.

Components in a Table will not have their caption nor icon rendered.


Authors:
Vaadin Ltd., Richard Lincoln

Version: 1.1.2

Instance Methods [hide private]
 
__init__(self, caption=None, dataSource=None)
Creates a new table with caption and connect it to a IContainer.
source code
 
getVisibleColumns(self)
Gets the array of visible column id:s, including generated columns.
source code
 
setVisibleColumns(self, visibleColumns)
Sets the array of visible column property ids.
source code
 
getColumnHeaders(self)
Gets the headers of the columns.
source code
 
setColumnHeaders(self, columnHeaders)
Sets the headers of the columns.
source code
 
getColumnIcons(self)
Gets the icons of the columns.
source code
 
setColumnIcons(self, columnIcons)
Sets the icons of the columns.
source code
 
getColumnAlignments(self)
Gets the array of column alignments.
source code
 
setColumnAlignments(self, columnAlignments)
Sets the column alignments.
source code
 
setColumnWidth(self, propertyId, width)
Sets columns width (in pixels).
source code
 
setColumnExpandRatio(self, propertyId, expandRatio)
Sets the column expand ratio for given column.
source code
 
getColumnExpandRatio(self, propertyId) source code
 
getColumnWidth(self, propertyId)
Gets the pixel width of column
source code
 
getPageLength(self)
Gets the page length.
source code
 
setPageLength(self, pageLength)
Sets the page length.
source code
 
setCacheRate(self, cacheRate)
This method adjusts a possible caching mechanism of table implementation.
source code
 
getCacheRate(self)
Returns: the current cache rate value
source code
 
getCurrentPageFirstItemId(self)
Getter for property currentPageFirstItem.
source code
 
getIdByIndex(self, index) source code
 
setCurrentPageFirstItemId(self, currentPageFirstItemId)
Setter for property currentPageFirstItemId.
source code
 
indexOfId(self, itemId) source code
 
getColumnIcon(self, propertyId)
Gets the icon Resource for the specified column.
source code
 
setColumnIcon(self, propertyId, icon)
Sets the icon Resource for the specified column.
source code
 
getColumnHeader(self, propertyId)
Gets the header for the specified column.
source code
 
setColumnHeader(self, propertyId, header)
Sets the column header for the specified column;
source code
 
getColumnAlignment(self, propertyId)
Gets the specified column's alignment.
source code
 
setColumnAlignment(self, propertyId, alignment)
Sets the specified column's alignment.
source code
 
isColumnCollapsed(self, propertyId)
Checks if the specified column is collapsed.
source code
 
setColumnCollapsed(self, propertyId, collapsed)
Sets whether the specified column is collapsed or not.
source code
 
isColumnCollapsingAllowed(self)
Checks if column collapsing is allowed.
source code
 
setColumnCollapsingAllowed(self, collapsingAllowed)
Sets whether column collapsing is allowed or not.
source code
 
isColumnReorderingAllowed(self)
Checks if column reordering is allowed.
source code
 
setColumnReorderingAllowed(self, columnReorderingAllowed)
Sets whether column reordering is allowed or not.
source code
 
setColumnOrder(self, columnOrder) source code
 
getCurrentPageFirstItemIndex(self)
Getter for property currentPageFirstItem.
source code
 
setCurrentPageFirstItemIndex(self, newIndex, needsPageBufferReset=True)
Setter for property currentPageFirstItem.
source code
 
isPageBufferingEnabled(self)
Getter for property pageBuffering.
source code
 
setPageBufferingEnabled(self, pageBuffering)
Setter for property pageBuffering.
source code
 
isSelectable(self)
Getter for property selectable.
source code
 
setSelectable(self, selectable)
Setter for property selectable.
source code
 
getColumnHeaderMode(self)
Getter for property columnHeaderMode.
source code
 
setColumnHeaderMode(self, columnHeaderMode)
Setter for property columnHeaderMode.
source code
 
refreshRenderedCells(self)
Refreshes the rows in the internal cache.
source code
 
requestRepaint(self)
Requests that the Table should be repainted as soon as possible.
source code
 
removeRowsFromCacheAndFillBottom(self, firstIndex, rows) source code
 
getVisibleCellsUpdateCacheRows(self, firstIndex, rows) source code
 
getVisibleCellsInsertIntoCache(self, firstIndex, rows) source code
 
getVisibleCellsNoCache(self, firstIndex, rows, replaceListeners)
Render rows with index "firstIndex" to "firstIndex+rows-1" to a new buffer.
source code
 
registerComponent(self, component) source code
 
listenProperty(self, p, oldListenedProperties) source code
 
unregisterComponentsAndPropertiesInRows(self, firstIx, count) source code
 
unregisterPropertiesAndComponents(self, oldListenedProperties, oldVisibleComponents)
Helper method to remove listeners and maintain correct component hierarchy.
source code
 
unregisterComponent(self, component)
This method cleans up a IComponent that has been generated when Table is in editable mode.
source code
 
refreshCurrentPage(self)
Refreshes the current page contents.
source code
 
setRowHeaderMode(self, mode)
Sets the row header mode.
source code
 
getRowHeaderMode(self)
Gets the row header mode.
source code
 
addItem(self, *args)
Adds the new row to table and fill the visible cells (except generated columns) with given values.
source code
 
refreshRowCache(self)
Discards and recreates the internal row cache.
source code
 
setContainerDataSource(self, newDataSource)
Sets the IContainer that serves as the data source of the viewer.
source code
 
getItemIdsInRange(self, itemId, length)
Gets items ids from a range of key values
source code
 
handleSelectedItems(self, variables)
Handles selection if selection is a multiselection
source code
 
getCurrentlyRenderedItemIds(self) source code
 
changeVariables(self, source, variables)
Invoked when the value of a variable has changed.
source code
 
handleClickEvent(self, variables)
Handles click event.
source code
 
handleColumnResizeEvent(self, variables)
Handles the column resize event sent by the client.
source code
 
fireColumnResizeEvent(self, propertyId, previousWidth, currentWidth) source code
 
handleColumnWidthUpdates(self, variables) source code
 
disableContentRefreshing(self)
Go to mode where content updates are not done.
source code
 
enableContentRefreshing(self, refreshContent)
Go to mode where content content refreshing has effect.
source code
 
paintContent(self, target)
Paints the content of this component.
source code
 
setRowCacheInvalidated(self, invalidated) source code
 
isRowCacheInvalidated(self) source code
 
paintPartialRowUpdate(self, target, actionSet) source code
 
paintPartialRowUpdates(self, target, actionSet) source code
 
paintPartialRowAdditions(self, target, actionSet) 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
 
shouldHideAddedRows(self)
Subclass and override this to enable removing of rows, bypassing the normal caching and lazy loading mechanism.
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
 
paintTableAttributes(self, target, rows, total) source code
 
resetVariablesAndPageBuffer(self, target)
Resets and paints "to be painted next" variables.
source code
 
areColumnHeadersEnabled(self) source code
 
paintVisibleColumns(self, target) source code
 
paintAvailableColumns(self, target) source code
 
paintActions(self, target, actionSet) source code
 
paintColumnOrder(self, target) source code
 
paintSorting(self, target) source code
 
paintRows(self, target, cells, actionSet) source code
 
findCellsWithComponents(self) source code
 
paintVisibleColumnOrder(self, target) source code
 
findAndPaintBodyActions(self, target) source code
 
shouldHideNullSelectionItem(self) source code
 
findNumRowsToPaint(self, target, cells) source code
 
paintSelectMode(self, target) source code
 
findSelectedKeys(self) source code
 
paintDragMode(self, target) source code
 
paintTabIndex(self, target) source code
 
paintColumnWidth(self, target, columnId) source code
 
rowHeadersAreEnabled(self) source code
 
paintRow(self, target, cells, iseditable, actionSet, iscomponent, indexInRowbuffer, itemId) source code
 
paintCellTooltips(self, target, itemId, columnId) source code
 
paintRowTooltips(self, target, itemId) source code
 
paintRowAttributes(self, *args)
A method where extended Table implementations may add their custom attributes for rows.
source code
 
paintGeneratedRowInfo(self, target, cells, indexInRowBuffer) source code
 
paintRowHeader(self, target, cells, indexInRowbuffer) source code
 
paintRowIcon(self, target, cells, indexInRowbuffer) source code
 
getVisibleCells(self)
Gets the cached visible table contents.
source code
 
getPropertyValue(self, rowId, colId, prop)
Gets the value of property.
source code
 
formatPropertyValue(self, rowId, colId, prop)
Formats table cell property values.
source code
 
addActionHandler(self, actionHandler)
Registers a new action handler for this container
source code
 
removeActionHandler(self, actionHandler)
Removes a previously registered action handler for the contents of this container.
source code
 
removeAllActionHandlers(self)
Removes all action handlers
source code
 
valueChange(self, event)
Notifies this listener that the Property's value has changed.
source code
 
resetPageBuffer(self)
Clears the current page buffer.
source code
 
attach(self)
Notifies the component that it is connected to an application.
source code
 
detach(self)
Notifies the component that it is detached from the application
source code
 
removeAllItems(self)
Removes all Items from the IContainer.
source code
 
removeItem(self, itemId)
Removes the Item identified by ItemId from the IContainer.
source code
 
removeContainerProperty(self, propertyId)
Removes a Property specified by the given Property ID from the IContainer.
source code
 
addContainerProperty(self, *args)
Adds a new property to the table and show it as a visible column.
source code
 
addGeneratedColumn(self, idd, generatedColumn)
Adds a generated column to the Table.
source code
 
getColumnGenerator(self, columnId)
Returns the IColumnGenerator used to generate the given column.
source code
 
removeGeneratedColumn(self, columnId)
Removes a generated column previously added with addGeneratedColumn.
source code
 
getVisibleItemIds(self)
Returns item identifiers of the items which are currently rendered on the client.
source code
 
containerItemSetChange(self, event)
IContainer datasource item set change.
source code
 
containerPropertySetChange(self, event)
IContainer datasource property set change.
source code
 
setNewItemsAllowed(self, allowNewOptions)
Adding new items is not supported.
source code
 
nextItemId(self, itemId)
Gets the ID of the Item following the Item that corresponds to itemId.
source code
 
prevItemId(self, itemId)
Gets the ID of the Item preceding the Item that corresponds to the itemId.
source code
 
firstItemId(self)
Gets the ID of the first Item in the IContainer.
source code
 
lastItemId(self)
Gets the ID of the last Item in the IContainer.
source code
 
isFirstId(self, itemId)
Tests if the Item corresponding to the given Item ID is the first Item in the IContainer.
source code
 
isLastId(self, itemId)
Tests if the Item corresponding to the given Item ID is the last Item in the IContainer.
source code
 
addItemAfter(self, previousItemId, newItemId=None)
Adds new item after the given item.
source code
 
setTableFieldFactory(self, fieldFactory)
Sets the TableFieldFactory that is used to create editor for table cells.
source code
 
getTableFieldFactory(self)
Gets the TableFieldFactory that is used to create editor for table cells.
source code
 
getFieldFactory(self)
Gets the IFieldFactory that is used to create editor for table cells.
source code
 
setFieldFactory(self, fieldFactory)
Sets the IFieldFactory that is used to create editor for table cells.
source code
 
isEditable(self)
Is table editable.
source code
 
setEditable(self, editable)
Sets the editable property.
source code
 
sort(self, *args)
Sorts the table.
source code
 
getSortableContainerPropertyIds(self)
Gets the container property IDs, which can be used to sort the item.
source code
 
getSortContainerPropertyId(self)
Gets the currently sorted column property ID.
source code
 
setSortContainerPropertyId(self, propertyId, doSort=True)
Sets the currently sorted column property id.
source code
 
isSortAscending(self)
Is the table currently sorted in ascending order.
source code
 
setSortAscending(self, ascending, doSort=True)
Sets the table in ascending order.
source code
 
isSortDisabled(self)
Is sorting disabled altogether.
source code
 
setSortDisabled(self, sortDisabled)
Disables the sorting altogether.
source code
 
setLazyLoading(self, useLazyLoading)
Table does not support lazy options loading mode.
source code
 
setCellStyleGenerator(self, cellStyleGenerator)
Set cell style generator for Table.
source code
 
getCellStyleGenerator(self)
Get the current cell style generator.
source code
 
addListener(self, listener, iface=None)
Adds a header click/footer click/column resize/column reorder listener which handles the click events when the user clicks on a column header cell in the Table.
source code
 
addCallback(self, callback, eventType=None, *args) source code
 
removeListener(self, listener, iface=None)
Removes a listener from the Table.
source code
 
removeCallback(self, callback, eventType=None) source code
 
setEnabled(self, enabled)
Enables or disables the component.
source code
 
requestRepaintAll(self) source code
 
setDragMode(self, newDragMode)
Sets the drag start mode of the Table.
source code
 
getDragMode(self)
Returns: the current start mode of the Table.
source code
 
getTransferable(self, rawVariables)
IDragSource may convert data added by client side component to meaningful values for server side developer or add other data based on it.
source code
 
getDropHandler(self)
Returns: the drop handler that will receive the dragged data or null if drops are not currently accepted
source code
 
setDropHandler(self, dropHandler) source code
 
translateDropTargetDetails(self, clientVariables)
Called before the DragAndDropEvent is passed to DropHandler.
source code
 
setMultiSelectMode(self, mode)
Sets the behavior of how the multi-select mode should behave when the table is both selectable and in multi-select mode.
source code
 
getMultiSelectMode(self)
Returns the select mode in which multi-select is used.
source code
 
getColumnFooter(self, propertyId)
Gets the footer caption beneath the rows
source code
 
setColumnFooter(self, propertyId, footer)
Sets the column footer caption.
source code
 
setFooterVisible(self, visible)
Sets the footer visible in the bottom of the table.
source code
 
setItemDescriptionGenerator(self, generator)
Set the item description generator which generates tooltips for cells and rows in the Table
source code
 
getItemDescriptionGenerator(self)
Get the item description generator which generates tooltips for cells and rows in the Table.
source code
 
isFooterVisible(self)
Is the footer currently visible?
source code
 
setRowGenerator(self, generator)
Assigns a row generator to the table.
source code
 
getRowGenerator(self)
@return the current row generator
source code

Inherited from abstract_select.AbstractSelect: __len__, containsId, fireItemSetChange, firePropertySetChange, getCaptionChangeListener, getContainerDataSource, getContainerProperty, getContainerPropertyIds, getItem, getItemCaption, getItemCaptionMode, getItemCaptionPropertyId, getItemIcon, getItemIconPropertyId, getItemIds, getListeners, getNewItemHandler, getNullSelectionItemId, getType, getValue, isEmpty, isMultiSelect, isNewItemsAllowed, isNullSelectionAllowed, isSelected, paintItem, select, setItemCaption, setItemCaptionMode, setItemCaptionPropertyId, setItemIcon, setItemIconPropertyId, setMultiSelect, setNewItemHandler, setNullSelectionAllowed, setNullSelectionItemId, setValue, size, 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, getParent, 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, setParent, 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]
  CLIENT_WIDGET = None
hash(x)
  CELL_KEY = 0
  CELL_HEADER = 1
  CELL_ICON = 2
  CELL_ITEMID = 3
  CELL_GENERATED_ROW = 4
  CELL_FIRSTCOL = 5
  ALIGN_LEFT = 'b'
  ALIGN_CENTER = 'c'
  ALIGN_RIGHT = 'e'
  COLUMN_HEADER_MODE_HIDDEN = -1
  COLUMN_HEADER_MODE_ID = 0
  COLUMN_HEADER_MODE_EXPLICIT = 1
  COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID = 2
  ROW_HEADER_MODE_HIDDEN = -1
  ROW_HEADER_MODE_ID = 0
  ROW_HEADER_MODE_ITEM = 1
  ROW_HEADER_MODE_INDEX = 2
  ROW_HEADER_MODE_EXPLICIT = 4
  ROW_HEADER_MODE_PROPERTY = 6
  ROW_HEADER_MODE_ICON_ONLY = 5
  ROW_HEADER_MODE_EXPLICIT_DEFAULTS_ID = 3
  _CACHE_RATE_DEFAULT = 2
  _ROW_HEADER_COLUMN_KEY = '0'
  _ROW_HEADER_FAKE_PROPERTY_ID = object()

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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

source code 

Creates a new table with caption and connect it to a IContainer.

Parameters:
  • args - tuple of the form
    • ()
    • (caption)
      1. the caption of the component.
    • (caption, dataSource)
      1. the caption of the component.
      2. the IContainer datasource to be selected from by this select.
    • (caption, options)
      1. the caption of the component.
      2. the Collection containing the options.
Overrides: object.__init__

getVisibleColumns(self)

source code 

Gets the array of visible column id:s, including generated columns.

The columns are show in the order of their appearance in this array.

Returns:
an array of currently visible propertyIds and generated column ids.

setVisibleColumns(self, visibleColumns)

source code 

Sets the array of visible column property ids.

The columns are show in the order of their appearance in this array.

Parameters:
  • visibleColumns - the array of shown property ids.

getColumnHeaders(self)

source code 

Gets the headers of the columns.

The headers match the property id:s given my the set visible column headers. The table must be set in either COLUMN_HEADER_MODE_EXPLICIT or COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID mode to show the headers. In the defaults mode any nulls in the headers array are replaced with id.__str__.

Returns:
the array of column headers.

setColumnHeaders(self, columnHeaders)

source code 

Sets the headers of the columns.

The headers match the property id:s given my the set visible column headers. The table must be set in either COLUMN_HEADER_MODE_EXPLICIT or COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID mode to show the headers. In the defaults mode any nulls in the headers array are replaced with id.toString() outputs when rendering.

Parameters:
  • columnHeaders - the Array of column headers that match the getVisibleColumns method.

getColumnIcons(self)

source code 

Gets the icons of the columns.

The icons in headers match the property ids given my the set visible column headers. The table must be set in either COLUMN_HEADER_MODE_EXPLICIT or COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID mode to show the headers with icons.

Returns:
the array of icons that match the getVisibleColumns.

setColumnIcons(self, columnIcons)

source code 

Sets the icons of the columns.

The icons in headers match the property id:s given my the set visible column headers. The table must be set in either COLUMN_HEADER_MODE_EXPLICIT or COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID mode to show the headers with icons.

Parameters:

getColumnAlignments(self)

source code 

Gets the array of column alignments.

The items in the array must match the properties identified by getVisibleColumns. The possible values for the alignments include:

The alignments default to ALIGN_LEFT: any null values are rendered as align lefts.

Returns:
the column alignments array.

setColumnAlignments(self, columnAlignments)

source code 

Sets the column alignments.

The items in the array must match the properties identified by getVisibleColumns. The possible values for the alignments include:

The alignments default to ALIGN_LEFT

Parameters:
  • columnAlignments - the column alignments array.

setColumnWidth(self, propertyId, width)

source code 

Sets columns width (in pixels). Theme may not necessary respect very small or very big values. Setting width to -1 (default) means that theme will make decision of width.

Column can either have a fixed width or expand ratio. The latter one set is used. See @link setColumnExpandRatio.

Parameters:
  • propertyId - colunmns property id
  • width - width to be reserved for colunmns content

setColumnExpandRatio(self, propertyId, expandRatio)

source code 

Sets the column expand ratio for given column.

Expand ratios can be defined to customize the way how excess space is divided among columns. Table can have excess space if it has its width defined and there is horizontally more space than columns consume naturally. Excess space is the space that is not used by columns with explicit width (see setColumnWidth) or with natural width (no width nor expand ratio).

By default (without expand ratios) the excess space is divided proportionally to columns natural widths.

Only expand ratios of visible columns are used in final calculations.

Column can either have a fixed width or expand ratio. The latter one set is used.

A column with expand ratio is considered to be minimum width by default (if no excess space exists). The minimum width is defined by terminal implementation.

If terminal implementation supports re-sizable columns the column becomes fixed width column if users resizes the column.

Parameters:
  • propertyId - columns property id
  • expandRatio - the expandRatio used to divide excess space for this column

getColumnWidth(self, propertyId)

source code 

Gets the pixel width of column

Returns:
width of column or -1 when value not set

getPageLength(self)

source code 

Gets the page length.

Setting page length 0 disables paging.

Returns:
the length of one page.

setPageLength(self, pageLength)

source code 

Sets the page length.

Setting page length 0 disables paging. The page length defaults to 15.

If Table has width set (setWidth ) the client side may update the page length automatically the correct value.

Parameters:
  • pageLength - the length of one page.

setCacheRate(self, cacheRate)

source code 

This method adjusts a possible caching mechanism of table implementation.

Table component may fetch and render some rows outside visible area. With complex tables (for example containing layouts and components), the client side may become unresponsive. Setting the value lower, UI will become more responsive. With higher values scrolling in client will hit server less frequently.

The amount of cached rows will be cacheRate multiplied with pageLength setPageLength both below and above visible area.

Parameters:
  • cacheRate - a value over 0 (fastest rendering time). Higher value will cache more rows on server (smoother scrolling). Default value is 2.

getCacheRate(self)

source code 
Returns:
the current cache rate value

See Also: setCacheRate

getCurrentPageFirstItemId(self)

source code 

Getter for property currentPageFirstItem.

Returns:
the Value of property currentPageFirstItem.

setCurrentPageFirstItemId(self, currentPageFirstItemId)

source code 

Setter for property currentPageFirstItemId.

Parameters:
  • currentPageFirstItemId - the new value of property currentPageFirstItemId.

getColumnIcon(self, propertyId)

source code 

Gets the icon Resource for the specified column.

Parameters:
  • propertyId - the propertyId identifying the column.
Returns:
the icon for the specified column; null if the column has no icon set, or if the column is not visible.

setColumnIcon(self, propertyId, icon)

source code 

Sets the icon Resource for the specified column.

Throws ValueError if the specified column is not visible.

Parameters:
  • propertyId - the propertyId identifying the column.
  • icon - the icon Resource to set.

getColumnHeader(self, propertyId)

source code 

Gets the header for the specified column.

Parameters:
  • propertyId - the propertyId identifying the column.
Returns:
the header for the specified column if it has one.

setColumnHeader(self, propertyId, header)

source code 

Sets the column header for the specified column;

Parameters:
  • propertyId - the propertyId identifying the column.
  • header - the header to set.

getColumnAlignment(self, propertyId)

source code 

Gets the specified column's alignment.

Parameters:
  • propertyId - the propertyID identifying the column.
Returns:
the specified column's alignment if it as one; null otherwise.

setColumnAlignment(self, propertyId, alignment)

source code 

Sets the specified column's alignment.

Throws IllegalArgumentException if the alignment is not one of the following: ALIGN_LEFT, ALIGN_CENTER or ALIGN_RIGHT

Parameters:
  • propertyId - the propertyID identifying the column.
  • alignment - the desired alignment.

isColumnCollapsed(self, propertyId)

source code 

Checks if the specified column is collapsed.

Parameters:
  • propertyId - the propertyID identifying the column.
Returns:
true if the column is collapsed; false otherwise;

setColumnCollapsed(self, propertyId, collapsed)

source code 

Sets whether the specified column is collapsed or not.

Parameters:
  • propertyId - the propertyID identifying the column.
  • collapsed - the desired collapsedness.
Raises:
  • ValueError - if column collapsing is not allowed

isColumnCollapsingAllowed(self)

source code 

Checks if column collapsing is allowed.

Returns:
true if columns can be collapsed; false otherwise.

setColumnCollapsingAllowed(self, collapsingAllowed)

source code 

Sets whether column collapsing is allowed or not.

Parameters:
  • collapsingAllowed - specifies whether column collapsing is allowed.

isColumnReorderingAllowed(self)

source code 

Checks if column reordering is allowed.

Returns:
true if columns can be reordered; false otherwise.

setColumnReorderingAllowed(self, columnReorderingAllowed)

source code 

Sets whether column reordering is allowed or not.

Parameters:
  • columnReorderingAllowed - specifies whether column reordering is allowed.

getCurrentPageFirstItemIndex(self)

source code 

Getter for property currentPageFirstItem.

Returns:
the Value of property currentPageFirstItem.

setCurrentPageFirstItemIndex(self, newIndex, needsPageBufferReset=True)

source code 

Setter for property currentPageFirstItem.

Parameters:
  • newIndex - the New value of property currentPageFirstItem.

isPageBufferingEnabled(self)

source code 

Getter for property pageBuffering.

Returns:
the value of property pageBuffering.

Deprecated: functionality is not needed in ajax rendering model

setPageBufferingEnabled(self, pageBuffering)

source code 

Setter for property pageBuffering.

Parameters:
  • pageBuffering - the new value of property pageBuffering.

Deprecated: functionality is not needed in ajax rendering model

isSelectable(self)

source code 

Getter for property selectable.

The table is not selectable by default.

Returns:
the Value of property selectable.

setSelectable(self, selectable)

source code 

Setter for property selectable.

The table is not selectable by default.

Parameters:
  • selectable - the new value of property selectable.

getColumnHeaderMode(self)

source code 

Getter for property columnHeaderMode.

Returns:
the value of property columnHeaderMode.

setColumnHeaderMode(self, columnHeaderMode)

source code 

Setter for property columnHeaderMode.

Parameters:
  • columnHeaderMode - the new value of property columnHeaderMode.

refreshRenderedCells(self)

source code 

Refreshes the rows in the internal cache. Only if resetPageBuffer is called before this then all values are guaranteed to be recreated.

requestRepaint(self)

source code 

Requests that the Table should be repainted as soon as possible.

Note that a Table does not necessarily repaint its contents when this method has been called. See refreshRowCache for forcing an update of the contents.

Overrides: terminal.paintable.IPaintable.requestRepaint

getVisibleCellsInsertIntoCache(self, firstIndex, rows)

source code 
Parameters:
  • firstIndex - The position where new rows should be inserted
  • rows - The maximum number of rows that should be inserted at position firstIndex. Less rows will be inserted if the page buffer is too small.

getVisibleCellsNoCache(self, firstIndex, rows, replaceListeners)

source code 

Render rows with index "firstIndex" to "firstIndex+rows-1" to a new buffer.

Reuses values from the current page buffer if the rows are found there.

unregisterComponentsAndPropertiesInRows(self, firstIx, count)

source code 
Parameters:
  • firstIx - Index of the first row to process. Global index, not relative to page buffer.
  • count

unregisterPropertiesAndComponents(self, oldListenedProperties, oldVisibleComponents)

source code 

Helper method to remove listeners and maintain correct component hierarchy. Detaches properties and components if those are no more rendered in client.

Parameters:
  • oldListenedProperties - set of properties that where listened in last render
  • oldVisibleComponents - set of components that where attached in last render

unregisterComponent(self, component)

source code 

This method cleans up a IComponent that has been generated when Table is in editable mode. The component needs to be detached from its parent and if it is a field, it needs to be detached from its property data source in order to allow garbage collection to take care of removing the unused component from memory.

Override this method and getPropertyValue with custom logic if you need to deal with buffered fields.

Parameters:
  • component - a set of components that should be unregistered.

See Also: getPropertyValue

refreshCurrentPage(self)

source code 

Refreshes the current page contents.

Deprecated: should not need to be used

setRowHeaderMode(self, mode)

source code 

Sets the row header mode.

The mode can be one of the following ones:

The default value is ROW_HEADER_MODE_HIDDEN

Parameters:
  • mode - the one of the modes listed above.

getRowHeaderMode(self)

source code 

Gets the row header mode.

Returns:
the row header mode.

See Also: setRowHeaderMode

addItem(self, *args)

source code 

Adds the new row to table and fill the visible cells (except generated columns) with given values.

Parameters:
  • args - tuple of the form
    • (cells, itemId)
      1. the Object array that is used for filling the visible cells new row. The types must be settable to visible column property types.
      2. the Id the new row. If null, a new id is automatically assigned. If given, the table cant already have a item with given id.
Returns:
Returns item id for the new row. Returns null if operation fails.
Raises:
  • NotImplementedError - if adding an item with an explicit item ID is not supported by the container
Overrides: data.container.IContainer.addItem

refreshRowCache(self)

source code 

Discards and recreates the internal row cache. Call this if you make changes that affect the rows but the information about the changes are not automatically propagated to the Table.

Do not call this e.g. if you have updated the data model through a Property. These types of changes are automatically propagated to the Table.

A typical case when this is needed is if you update a generator (e.g. CellStyleGenerator) and want to ensure that the rows are redrawn with new styles.

Note that calling this method is not cheap so avoid calling it unnecessarily.

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)

handleSelectedItems(self, variables)

source code 

Handles selection if selection is a multiselection

Parameters:
  • variables - The variables

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

See Also: Select.changeVariables

disableContentRefreshing(self)

source code 

Go to mode where content updates are not done. This is due we want to bypass expensive content for some reason (like when we know we may have other content changes on their way).

Returns:
true if content refresh flag was enabled prior this call

enableContentRefreshing(self, refreshContent)

source code 

Go to mode where content content refreshing has effect.

Parameters:
  • refreshContent - true if content refresh needs to be done

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.

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.

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.

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.

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.

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.

resetVariablesAndPageBuffer(self, target)

source code 

Resets and paints "to be painted next" variables. Also reset pageBuffer

getVisibleCells(self)

source code 

Gets the cached visible table contents.

Returns:
the cached visible table contents.

getPropertyValue(self, rowId, colId, prop)

source code 

Gets the value of property.

By default if the table is editable the fieldFactory is used to create editors for table cells. Otherwise formatPropertyValue is used to format the value representation.

Parameters:
  • rowId - the Id of the row (same as item Id).
  • colId - the Id of the column.
  • prop - the Property to be presented.
Returns:
Object either formatted value or IComponent for field.

formatPropertyValue(self, rowId, colId, prop)

source code 

Formats table cell property values. By default the property.__str__ and return a empty string for null properties.

Parameters:
  • rowId - the Id of the row (same as item Id).
  • colId - the Id of the column.
  • prop - the Property to be formatted.
Returns:
the string representation of property and its value.

addActionHandler(self, actionHandler)

source code 

Registers a new action handler for this container

See Also: action.container.addActionHandler

removeActionHandler(self, actionHandler)

source code 

Removes a previously registered action handler for the contents of this container.

See Also: container.removeActionHandler

valueChange(self, event)

source code 

Notifies this listener that the Property's value has changed.

Also listens changes in rendered items to refresh content area.

Parameters:
  • event - the value change event telling the data source contents have changed.
Overrides: data.property.IValueChangeListener.valueChange

resetPageBuffer(self)

source code 

Clears the current page buffer. Call this before refreshRenderedCells to ensure that all content is updated from the properties.

attach(self)

source code 

Notifies the component that it is connected to an application.

Overrides: component.IComponent.attach

See Also: IComponent.attach

detach(self)

source code 

Notifies the component that it is detached from the application

Overrides: component.IComponent.detach

See Also: IComponent.detach

removeAllItems(self)

source code 

Removes all Items from the IContainer.

Returns:
True if the operation succeeded.
Raises:
  • NotImplementedError - if the container does not support removing all items
Overrides: data.container.IContainer.removeAllItems

removeItem(self, itemId)

source code 

Removes the Item identified by ItemId from the IContainer.

Parameters:
  • itemId - ID of the Item to remove
Returns:
True if the operation succeeded, False if not
Raises:
  • NotImplementedError - if the container does not support removing individual items
Overrides: data.container.IContainer.removeItem

removeContainerProperty(self, propertyId)

source code 

Removes a Property specified by the given Property ID from the IContainer.

Parameters:
  • propertyId - ID of the Property to remove
Returns:
True if the operation succeeded.
Raises:
  • NotImplementedError - if the container does not support removing container properties
Overrides: data.container.IContainer.removeContainerProperty

addContainerProperty(self, *args)

source code 

Adds a new property to the table and show it as a visible column.

Parameters:
  • args - tuple of the form
    • (propertyId, type, defaultValue)
      1. the Id of the proprty.
      2. the class of the property.
      3. the default value given for all existing items.
    • (propertyId, type, defaultValue, columnHeader, columnIcon, columnAlignment)
      1. the Id of the proprty
      2. the class of the property
      3. the default value given for all existing items
      4. the Explicit header of the column. If explicit header is not needed, this should be set null.
      5. the Icon of the column. If icon is not needed, this should be set null.
      6. the Alignment of the column. Null implies align left.
Returns:
True if the operation succeeded.
Raises:
  • NotImplementedError - if the operation is not supported.
Overrides: data.container.IContainer.addContainerProperty

addGeneratedColumn(self, idd, generatedColumn)

source code 

Adds a generated column to the Table.

A generated column is a column that exists only in the Table, not as a property in the underlying IContainer. It shows up just as a regular column.

A generated column will override a property with the same id, so that the generated column is shown instead of the column representing the property. Note that getContainerProperty() will still get the real property.

Table will not listen to value change events from properties overridden by generated columns. If the content of your generated column depends on properties that are not directly visible in the table, attach value change listener to update the content on all depended properties. Otherwise your UI might not get updated as expected.

Also note that getVisibleColumns() will return the generated columns, while getContainerPropertyIds() will not.

Parameters:
  • idd - the id of the column to be added
  • generatedColumn - the IColumnGenerator to use for this column

getColumnGenerator(self, columnId)

source code 

Returns the IColumnGenerator used to generate the given column.

Parameters:
  • columnId - The id of the generated column
Returns:
The IColumnGenerator used for the given columnId or null.

removeGeneratedColumn(self, columnId)

source code 

Removes a generated column previously added with addGeneratedColumn.

Parameters:
  • columnId - id of the generated column to remove
Returns:
true if the column could be removed (existed in the Table)

getVisibleItemIds(self)

source code 

Returns item identifiers of the items which are currently rendered on the client.

Note, that some due to historical reasons the name of the method is bit misleading. Some items may be partly or totally out of the viewport of the table's scrollable area. Actully detecting rows which can be actually seen by the end user may be problematic due to the client server architecture. Using getCurrentPageFirstItemId combined with getPageLength may produce good enough estimates in some situations.

Overrides: abstract_select.AbstractSelect.getVisibleItemIds

See Also: Select.getVisibleItemIds

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

See Also: container.ItemSetChangeListener.containerItemSetChange

containerPropertySetChange(self, event)

source code 

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

Parameters:
  • event - Change event.
Overrides: data.container.IPropertySetChangeListener.containerPropertySetChange

See Also: container.PropertySetChangeListener.containerPropertySetChange

setNewItemsAllowed(self, allowNewOptions)

source code 

Adding new items is not supported.

Parameters:
  • allowNewOptions - the New value of property allowNewOptions.
Raises:
  • NotImplementedError - if set to true.
Overrides: abstract_select.AbstractSelect.setNewItemsAllowed

See Also: Select.setNewItemsAllowed

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

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

firstItemId(self)

source code 

Gets the ID of the first Item in the IContainer.

Returns:
ID of the first visible Item in the IContainer
Overrides: data.container.IOrdered.firstItemId

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

isFirstId(self, itemId)

source code 

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

Parameters:
  • itemId - ID of an Item in the IContainer
Returns:
True if the Item is first visible item in the IContainer, False if not
Overrides: data.container.IOrdered.isFirstId

See Also: IOrdered.isFirstId

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

See Also: IOrdered.isLastId

addItemAfter(self, previousItemId, newItemId=None)

source code 

Adds new item after the given item.

Parameters:
  • previousItemId - Id of the visible item in ordered container after which to insert the new item.
  • newItemId - Id of the new item to be added.
Returns:
new item or null if the operation fails.
Raises:
  • NotImplementedError - if the operation is not supported by the container
Overrides: data.container.IOrdered.addItemAfter

setTableFieldFactory(self, fieldFactory)

source code 

Sets the TableFieldFactory that is used to create editor for table cells.

The TableFieldFactory is only used if the Table is editable. By default the DefaultFieldFactory is used.

Parameters:
  • fieldFactory - the field factory to set.

getTableFieldFactory(self)

source code 

Gets the TableFieldFactory that is used to create editor for table cells.

The IFieldFactory is only used if the Table is editable.

Returns:
TableFieldFactory used to create the IField instances.

See Also: isEditable

getFieldFactory(self)

source code 

Gets the IFieldFactory that is used to create editor for table cells.

The IFieldFactory is only used if the Table is editable.

Returns:
IFieldFactory used to create the IField instances.

See Also: isEditable

Deprecated: use getTableFieldFactory instead

setFieldFactory(self, fieldFactory)

source code 

Sets the IFieldFactory that is used to create editor for table cells.

The IFieldFactory is only used if the Table is editable. By default the BaseFieldFactory is used.

Parameters:
  • fieldFactory - the field factory to set.
See Also:
isEditable, BaseFieldFactory

Deprecated: use setTableFieldFactory() instead

isEditable(self)

source code 

Is table editable.

If table is editable a editor of type IField is created for each table cell. The assigned IFieldFactory is used to create the instances.

To provide custom editors for table cells create a class implementing the IFieldFactory interface, and assign it to table, and set the editable property to true.

Returns:
true if table is editable, false otherwise.
See Also:
IField, IFieldFactory

setEditable(self, editable)

source code 

Sets the editable property.

If table is editable a editor of type IField is created for each table cell. The assigned IFieldFactory is used to create the instances.

To provide custom editors for table cells create a class implementins the IFieldFactory interface, and assign it to table, and set the editable property to true.

Parameters:
  • editable - true if table should be editable by user.
See Also:
IField, IFieldFactory

sort(self, *args)

source code 

Sorts the table.

Parameters:
  • propertyId - Array of container property IDs, whose values are used to sort the items in container as primary, secondary, ... sorting criterion. All of the item IDs must be in the collection returned by getSortableContainerPropertyIds
  • ascending - Array of sorting order flags corresponding to each property ID used in sorting. If this array is shorter than propertyId array, ascending order is assumed for items where the order is not specified. Use True to sort in ascending order, False to use descending order.
Raises:
  • NotImplementedError - if the container data source does not implement container.ISortable
Overrides: data.container.ISortable.sort

See Also: ISortable.sort

getSortableContainerPropertyIds(self)

source code 

Gets the container property IDs, which can be used to sort the item.

Returns:
the IDs of the properties that can be used for sorting the container
Overrides: data.container.ISortable.getSortableContainerPropertyIds

getSortContainerPropertyId(self)

source code 

Gets the currently sorted column property ID.

Returns:
the IContainer property id of the currently sorted column.

setSortContainerPropertyId(self, propertyId, doSort=True)

source code 

Sets the currently sorted column property id. With doSort flag actual sorting may be bypassed.

Parameters:
  • propertyId - the IContainer property id of the currently sorted column.
  • doSort

isSortAscending(self)

source code 

Is the table currently sorted in ascending order.

Returns:
True if ascending, False if descending.

setSortAscending(self, ascending, doSort=True)

source code 

Sets the table in ascending order. With doSort flag actual sort can be bypassed.

Parameters:
  • ascending - True if ascending, False if descending.
  • doSort

isSortDisabled(self)

source code 

Is sorting disabled altogether.

True iff no sortable columns are given even in the case where data source would support this.

Returns:
True iff sorting is disabled.

setSortDisabled(self, sortDisabled)

source code 

Disables the sorting altogether.

To disable sorting altogether, set to true. In this case no sortable columns are given even in the case where datasource would support this.

Parameters:
  • sortDisabled - True iff sorting is disabled.

setLazyLoading(self, useLazyLoading)

source code 

Table does not support lazy options loading mode. Setting this true will throw NotImplementedError.

See Also: Select.setLazyLoading

setCellStyleGenerator(self, cellStyleGenerator)

source code 

Set cell style generator for Table.

Parameters:
  • cellStyleGenerator - New cell style generator or null to remove generator.

addListener(self, listener, iface=None)

source code 

Adds a header click/footer click/column resize/column reorder listener which handles the click events when the user clicks on a column header cell in the Table.

The listener will receive events which contain information about which column was clicked and some details about the mouse event.

Parameters:
  • listener - The handler which should handle the events.
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 a listener from the Table.

Parameters:
  • listener - The listener to remove
Overrides: data.container.IItemSetChangeNotifier.removeListener

removeCallback(self, callback, eventType=None)

source code 
Overrides: data.container.IItemSetChangeNotifier.removeCallback

setEnabled(self, enabled)

source code 

Enables or disables the component. The user can not interact disabled components, which are shown with a style that indicates the status, usually shaded in light gray color. Components are enabled by default. Children of a disabled component are automatically disabled; if a child component is explicitly set as disabled, changes in the disabled status of its parents do not change its status:

 enabled = new Button("Enabled")
 enabled.setEnabled(True)  # the default
 layout.addComponent(enabled)

 disabled = Button("Disabled")
 disabled.setEnabled(False)
 layout.addComponent(disabled)

This method will trigger a RepaintRequestEvent for the component and, if it is a ComponentContainer, for all its children recursively.

Parameters:
  • enabled - a boolean value specifying if the component should be enabled or not
Overrides: component.IComponent.setEnabled
(inherited documentation)

setDragMode(self, newDragMode)

source code 

Sets the drag start mode of the Table. Drag start mode controls how Table behaves as a drag source.

getDragMode(self)

source code 
Returns:
the current start mode of the Table. Drag start mode controls how Table behaves as a drag source.

getTransferable(self, rawVariables)

source code 

IDragSource may convert data added by client side component to meaningful values for server side developer or add other data based on it.

For example Tree converts item identifiers to generated string keys for the client side. Muntjac developer don't and can't know anything about these generated keys, only about item identifiers. When tree node is dragged client puts that key to Transferables client side counterpart. In Tree.getTransferable the key is converted back to item identifier that the server side developer can use.

Parameters:
  • rawVariables - the data that client side initially included in Transferables client side counterpart.
Returns:
the Transferable instance that will be passed to DropHandler (and/or AcceptCriterion)
Overrides: event.dd.drag_source.IDragSource.getTransferable
(inherited documentation)

getDropHandler(self)

source code 
Returns:
the drop handler that will receive the dragged data or null if drops are not currently accepted
Overrides: event.dd.drop_target.IDropTarget.getDropHandler
(inherited documentation)

translateDropTargetDetails(self, clientVariables)

source code 

Called before the DragAndDropEvent is passed to DropHandler. Implementation may for example translate the drop target details provided by the client side (drop target) to meaningful server side values. If null is returned the terminal implementation will automatically create a TargetDetails with raw client side data.

Parameters:
  • clientVariables - data passed from the DropTargets client side counterpart.
Returns:
A DropTargetDetails object with the translated data or null to use a default implementation.
Overrides: event.dd.drop_target.IDropTarget.translateDropTargetDetails
(inherited documentation)

setMultiSelectMode(self, mode)

source code 

Sets the behavior of how the multi-select mode should behave when the table is both selectable and in multi-select mode.

Note, that on some clients the mode may not be respected. E.g. on touch based devices CTRL/SHIFT base selection method is invalid, so touch based browsers always use the MultiSelectMode.SIMPLE.

Parameters:
  • mode - The select mode of the table

getMultiSelectMode(self)

source code 

Returns the select mode in which multi-select is used.

Returns:
The multi select mode

getColumnFooter(self, propertyId)

source code 

Gets the footer caption beneath the rows

Parameters:
  • propertyId - The propertyId of the column *
Returns:
The caption of the footer or NULL if not set

setColumnFooter(self, propertyId, footer)

source code 

Sets the column footer caption. The column footer caption is the text displayed beneath the column if footers have been set visible.

Parameters:
  • propertyId - The properyId of the column
  • footer - The caption of the footer

setFooterVisible(self, visible)

source code 

Sets the footer visible in the bottom of the table.

The footer can be used to add column related data like sums to the bottom of the Table using setColumnFooter.

Parameters:
  • visible - Should the footer be visible

setItemDescriptionGenerator(self, generator)

source code 

Set the item description generator which generates tooltips for cells and rows in the Table

Parameters:
  • generator - The generator to use or null to disable

isFooterVisible(self)

source code 

Is the footer currently visible?

Returns:
Returns true if visible else false

setRowGenerator(self, generator)

source code 

Assigns a row generator to the table. The row generator will be able to replace rows in the table when it is rendered.

Parameters:
  • generator - the new row generator