com.google.gwt.widgetideas.table.client
Class ReadOnlyTableModel<R>

java.lang.Object
  extended by com.google.gwt.widgetideas.table.client.TableModel<R>
      extended by com.google.gwt.widgetideas.table.client.ReadOnlyTableModel<R>
Type Parameters:
R - the data type of the row values
All Implemented Interfaces:
SourceTableModelEvents

public abstract class ReadOnlyTableModel<R>
extends TableModel<R>

A read-only version of the TableModel. If any modification methods are called, an exception is thrown.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.widgetideas.table.client.TableModel
TableModel.Callback<R>, TableModel.ColumnSortInfo, TableModel.ColumnSortList, TableModel.Request, TableModel.Response<R>, TableModel.SerializableResponse<R extends java.io.Serializable>
 
Field Summary
static java.lang.String READ_ONLY_ERROR
          Error message used when calling a write operation.
 
Fields inherited from class com.google.gwt.widgetideas.table.client.TableModel
ALL_ROWS, UNKNOWN_ROW_COUNT
 
Constructor Summary
ReadOnlyTableModel()
           
 
Method Summary
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 com.google.gwt.widgetideas.table.client.TableModel
addTableModelListener, getRowCount, insertRow, removeRow, removeTableModelListener, requestRows, setData, setRowCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READ_ONLY_ERROR

public static final java.lang.String READ_ONLY_ERROR
Error message used when calling a write operation.

See Also:
Constant Field Values
Constructor Detail

ReadOnlyTableModel

public ReadOnlyTableModel()
Method Detail

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 index
cell - the cell index
data - the new contents of the cell
Returns:
true if the action is successful