com.google.gwt.widgetideas.table.client
Class MutableTableModel.TableModelAdaptor

java.lang.Object
  extended by com.google.gwt.widgetideas.table.client.TableModel
      extended by com.google.gwt.widgetideas.table.client.MutableTableModel
          extended by com.google.gwt.widgetideas.table.client.MutableTableModel.TableModelAdaptor
Enclosing class:
MutableTableModel

public static class MutableTableModel.TableModelAdaptor
extends MutableTableModel

TableModelAdapter wraps a read-only TableModel in a MutableTableModel wrapper, throwing UnsupportedOperationException when appropriate. This was done to simplify the design of tables, such as ScrollTable which may or may not have mutable data.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.widgetideas.table.client.MutableTableModel
MutableTableModel.TableModelAdaptor
 
Nested classes/interfaces inherited from class com.google.gwt.widgetideas.table.client.TableModel
TableModel.Callback, TableModel.ClientResponse, TableModel.ClientTableModel, TableModel.ListTableModel, TableModel.Request, TableModel.Response
 
Field Summary
 
Fields inherited from class com.google.gwt.widgetideas.table.client.TableModel
ALL_ROWS
 
Constructor Summary
MutableTableModel.TableModelAdaptor(TableModel readOnlyTableModel)
          Constructor for MutableTableModel.TableModelAdaptor.
 
Method Summary
 void onRowInserted(int beforeRow)
          Event fired when a row is inserted.
 void onRowRemoved(int row)
          Event fired when a row is removed.
 void onSetData(int firstRow, java.util.Collection rows)
          Event fired when the local data changes.
 void onSetData(int row, int cell, java.lang.Object data)
          Event fired when the local data changes.
 void requestRows(TableModel.Request request, TableModel.Callback callback)
          Generate a Response based on a specific Request.
 
Methods inherited from class com.google.gwt.widgetideas.table.client.TableModel
requestRows
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutableTableModel.TableModelAdaptor

public MutableTableModel.TableModelAdaptor(TableModel readOnlyTableModel)
Constructor for MutableTableModel.TableModelAdaptor.

Parameters:
readOnlyTableModel - the underlying read only table model
Method Detail

onRowInserted

public void onRowInserted(int beforeRow)
Description copied from class: MutableTableModel
Event fired when a row is inserted.

Specified by:
onRowInserted in class MutableTableModel
Parameters:
beforeRow - the row index of the new row

onRowRemoved

public void onRowRemoved(int row)
Description copied from class: MutableTableModel
Event fired when a row is removed.

Specified by:
onRowRemoved in class MutableTableModel
Parameters:
row - the row index of the removed row

onSetData

public void onSetData(int row,
                      int cell,
                      java.lang.Object data)
Description copied from class: MutableTableModel
Event fired when the local data changes.

Specified by:
onSetData in class MutableTableModel
Parameters:
row - the row index
cell - the cell index
data - the new contents of the cell

onSetData

public void onSetData(int firstRow,
                      java.util.Collection rows)
Description copied from class: MutableTableModel
Event fired when the local data changes.

Specified by:
onSetData in class MutableTableModel
Parameters:
firstRow - the first row index
rows - the 2D collection of row data

requestRows

public void requestRows(TableModel.Request request,
                        TableModel.Callback callback)
Description copied from class: TableModel
Generate a Response based on a specific Request. After the is created, it is passed into the Callback.

Specified by:
requestRows in class TableModel
Parameters:
request - the request
callback - the callback to use for the response