Class Index | File Index

Classes


Class zwt.ui.table.TableSelectionModel


Extends zwt.Object.

A table selection model represents the current state of the selection in a table.

Every methods that modify the selection use an array of cells in the data model. A cell is represented by an array of two elements: the row index and the column index in the data model.

In order to enable cell selection in a Table, use a zwt.ui.table.CellSelectionModel.

In order to enable row selection in a Table, use a zwt.ui.table.RowSelectionModel.

In order to enable column selection in a Table, use a zwt.ui.table.ColumnSelectionModel.

You can also provide your own implementation for specific selection models.


Defined in: TableSelectionModel.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Construct a table selection model.
Method Summary
Method Attributes Method Name and Description
 
addSelection(array_cells, boolean_exclusive)
Add to the current selection using the specified array of cells.
 
Change the selection to the empty set.
 
Return the selection model event manager attached to the model.
 
isCellSelected(int_rowIndex, int_colIndex)
Determine whether the specified cell is selected.
 
isColumnSelected(int_rowIndex)
Determine whether the specified column is selected.
 
isRowSelected(int_rowIndex)
Determine whether the specified row is selected.
 
isSelectable(int_rowIndex, int_colIndex)
Determine whether the specified cell is selectable.
 
onEvent(zwt_ui_table_TableSelectionModelEvent_event)
Dispatch the specified selection model event to the appropriate event manager.
 
removeSelection(array_cells)
Remove from the current selection using the specified array of cells.
 
setSelection(array_cells, boolean_exclusive)
Change the selection using the specified array of cells.
 
shiftRows(array_rows, boolean_remove)
Shift the row indices of current selection.
Class Detail
zwt.ui.table.TableSelectionModel()
Construct a table selection model.
Author: Jeremy KUHN.
See:
zwt.ui.table.CellSelectionModel
zwt.ui.table.RowSelectionModel
zwt.ui.table.ColumnSelectionModel
zwt.ui.table.Table
Method Detail
addSelection(array_cells, boolean_exclusive)
Add to the current selection using the specified array of cells.

If this represents a change to the current selection then an event is emitted to notify the change.

Parameters:
{Integer[][]} array_cells
The array of cells in the underlying model to use to add to the selection
{Boolean} boolean_exclusive
If exclusive, the change should deselect currently selected data

clearSelection()
Change the selection to the empty set.

If this represents a change to the current selection then an event is emitted to notify the change.


{zwt.ui.table.TableSelectionModelEventManager} getTableSelectionModelEventManager()
Return the selection model event manager attached to the model.
Returns:
The selection model event manager

{Boolean} isCellSelected(int_rowIndex, int_colIndex)
Determine whether the specified cell is selected.

This method always returns false by default. You may need to override this method for specific implementation.

Parameters:
{Integer} int_rowIndex
The index of the row in the data model
{Integer} int_colIndex
The index of the column in the data model
Returns:
true if the cell is selected, false otherwise

{Boolean} isColumnSelected(int_rowIndex)
Determine whether the specified column is selected.

This method always returns false by default. You may need to override this method for specific implementation.

Parameters:
{Integer} int_rowIndex
The index of the column in the data model
Returns:
true if the column is selected, false otherwise.

{Boolean} isRowSelected(int_rowIndex)
Determine whether the specified row is selected.

This method always returns false by default. You may need to override this method for specific implementation.

Parameters:
{Integer} int_rowIndex
The index of the row in the data model
Returns:
true if the row is selected, false otherwise

{Boolean} isSelectable(int_rowIndex, int_colIndex)
Determine whether the specified cell is selectable.

This method always returns true. You may override this method to make a specific row/column/cell unselectable.

Parameters:
{Integer} int_rowIndex
The index of the row in the data model
{Integer} int_colIndex
The index of the column in the data model
Returns:
true if the cell is selectable, false otherwise

onEvent(zwt_ui_table_TableSelectionModelEvent_event)
Dispatch the specified selection model event to the appropriate event manager.
Parameters:
{zwt.ui.table.TableSelectionModelEvent} zwt_ui_table_TableSelectionModelEvent_event
The selection model event to dispatch

removeSelection(array_cells)
Remove from the current selection using the specified array of cells.

If this represents a change to the current selection then an event is emitted to notify the change.

Parameters:
{Integer[][]} array_cells
The array of cells in the underlying model to use to remove from the selection

setSelection(array_cells, boolean_exclusive)
Change the selection using the specified array of cells.

If this represents a change to the current selection then an event is emitted to notify the change.

Parameters:
{Integer[][]} array_cells
The array of cells in the underlying model to use to change the selection
{Boolean} boolean_exclusive
If exclusive, the change should deselect currently selected data.

shiftRows(array_rows, boolean_remove)
Shift the row indices of current selection.

This method is called to sync the selection model with a corresponding change in the data model.

Parameters:
{Integer[]} array_rows
the list of rows (indices) to consider for the shift
{Boolean} boolean_remove
If true, remove from the row indices

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Jan 12 2012 02:07:54 GMT+0100 (CET)