Class Index | File Index

Classes


Class zwt.ui.table.TableModel


Extends zwt.Object.

A table model holds the data displayed in a table.

Basically the model is queried by the table to get the values to display.

This implementation uses an array of arrays to store the cell value objects.


Defined in: TableModel.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Construct a table model.
Method Summary
Method Attributes Method Name and Description
 
addRows(array_rows)
Add the specified rows at the end of the model.
 
Return the number of rows in the model.
 
Return the rows in the model.
 
Return the table model event manager attached to the model.
 
getValueAt(int_row, int_column)
Return the cell value object at the specified location.
 
insertRows(array_rows, int_index)
Insert the specified array of rows at the specified location in the model.
 
isCellEditable(int_row, int_column)
Determine whether the specified cell is editable.
 
onEvent(zwt_ui_table_TableModelEvent_event)
Dispatch the specified table model event to the appropriate event manager.
 
removeRowsAt(int_index, int_length)
Remove rows at the specified location.
 
setRows(array_rows)
Change the data in the model to be the specified array of rows.
 
setValueAt(object_value, int_row, int_column)
Set the specified cell value object at the specified location.
Class Detail
zwt.ui.table.TableModel()
Construct a table model.
Author: Jeremy KUHN.
See:
zwt.ui.table.Table
zwt.ui.table.TableModelEvent
Method Detail
addRows(array_rows)
Add the specified rows at the end of the model.
Parameters:
{Object[][]} array_rows
The rows to add

{Integer} getRowCount()
Return the number of rows in the model.
Returns:
The number of rows

{Object[][]} getRows()
Return the rows in the model.

The return array should never be modified directly as it is managed by the model.

Returns:
An array of rows

{zwt.ui.table.TableModelEventManager} getTableModelEventManager()
Return the table model event manager attached to the model.
Returns:
The table model event manager

{Object} getValueAt(int_row, int_column)
Return the cell value object at the specified location.
Parameters:
{Integer} int_row
The cell row index
{Integer} int_column
The cell column index
Returns:
The cell value object

insertRows(array_rows, int_index)
Insert the specified array of rows at the specified location in the model.
Parameters:
{Object[][]} array_rows
The rows to insert
{Integer} int_index
The location where to insert the rows

{Boolean} isCellEditable(int_row, int_column)
Determine whether the specified cell is editable.

This method always returns true by default. You may override this method to prevent cells from being edited.

Parameters:
{Integer} int_row
The cell row index
{Integer} int_column
The cell column index
Returns:
true if the cell is editable, false otherwise

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

removeRowsAt(int_index, int_length)
Remove rows at the specified location.
Parameters:
{Integer} int_index
The location where to start removing rows
{Integer} int_length
The number of rows to remove

setRows(array_rows)
Change the data in the model to be the specified array of rows.
Parameters:
{Object[][]} array_rows
The rows to set

setValueAt(object_value, int_row, int_column)
Set the specified cell value object at the specified location.
Parameters:
{Object} object_value
the object to set
{Integer} int_row
The cell row index
{Integer} int_column
The cell column index

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Nov 09 2011 19:29:09 GMT+0100 (CET)