com.google.gwt.widgetideas.table.client
Class ListTableModel<R>
java.lang.Object
com.google.gwt.widgetideas.table.client.TableModel<R>
com.google.gwt.widgetideas.table.client.ClientTableModel<R>
com.google.gwt.widgetideas.table.client.ListTableModel<R>
- Type Parameters:
R
- the data type of the row values
- All Implemented Interfaces:
- SourceTableModelEvents
public class ListTableModel<R>
- extends ClientTableModel<R>
A class to retrieve row data to be used in a table.
Constructor Summary |
ListTableModel(java.util.List<java.util.List<java.lang.Object>> rows)
Constructor. |
Method Summary |
java.lang.Object |
getCell(int rowNum,
int cellNum)
Get the value for a given cell. |
protected boolean |
onRowInserted(int beforeRow)
Event fired when a row is inserted. |
protected boolean |
onRowRemoved(int row)
Event fired when a row is removed. |
protected boolean |
onSetData(int row,
int cell,
java.lang.Object data)
Event fired when the local data changes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ListTableModel
public ListTableModel(java.util.List<java.util.List<java.lang.Object>> rows)
- Constructor.
- Parameters:
rows
- the data that this model feeds from
getCell
public java.lang.Object getCell(int rowNum,
int cellNum)
- Description copied from class:
ClientTableModel
- Get the value for a given cell. Return null if no more values are
available.
- Specified by:
getCell
in class ClientTableModel<R>
- Parameters:
rowNum
- the row indexcellNum
- the column index
- Returns:
- the value at the given row and column
- See Also:
ClientTableModel
onRowInserted
protected boolean onRowInserted(int beforeRow)
- Description copied from class:
TableModel
- Event fired when a row is inserted. Returning true will increment the row
count by one.
- Specified by:
onRowInserted
in class TableModel<R>
- Parameters:
beforeRow
- the row index of the new row
- Returns:
- true if the action is successful
onRowRemoved
protected boolean onRowRemoved(int row)
- Description copied from class:
TableModel
- Event fired when a row is removed. Returning true will decrement the row
count by one.
- Specified by:
onRowRemoved
in class TableModel<R>
- Parameters:
row
- the row index of the removed row
- Returns:
- true if the action is successful
onSetData
protected boolean onSetData(int row,
int cell,
java.lang.Object data)
- Description copied from class:
TableModel
- Event fired when the local data changes. Returning true will ensure that
the row count is at least as one greater than the row index.
- Specified by:
onSetData
in class TableModel<R>
- Parameters:
row
- the row indexcell
- the cell indexdata
- the new contents of the cell
- Returns:
- true if the action is successful