org.kuali.student.common.ui.client.widgets.pagetable
Class GenericTableModel<RowType>

java.lang.Object
  extended by com.google.gwt.gen2.table.client.TableModel<RowType>
      extended by com.google.gwt.gen2.table.client.MutableTableModel<RowType>
          extended by org.kuali.student.common.ui.client.widgets.pagetable.GenericTableModel<RowType>
Type Parameters:
IsSerializiable -
All Implemented Interfaces:
com.google.gwt.gen2.table.event.client.HasRowCountChangeHandlers, com.google.gwt.gen2.table.event.client.HasRowInsertionHandlers, com.google.gwt.gen2.table.event.client.HasRowRemovalHandlers, com.google.gwt.gen2.table.event.client.HasRowValueChangeHandlers<RowType>

public class GenericTableModel<RowType>
extends com.google.gwt.gen2.table.client.MutableTableModel<RowType>

This is a description of what this class does - Gary Struthers don't forget to fill this in.

Author:
Kuali Student Team (gstruthers@berkeley.edu)

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.gen2.table.client.TableModel
com.google.gwt.gen2.table.client.TableModel.Callback<RowType>
 
Field Summary
private  List<com.google.gwt.gen2.table.client.AbstractColumnDefinition<ResultRow,?>> columnDefs
           
private  boolean errorMode
          A boolean indicating that we should throw an error.
private  int fromIndex
           
private  int lastSortDirection
           
private  int lastSortedColumn
           
private  List<RowType> rowDTOs
           
private  boolean zeroMode
          A boolean indicating that we should return 0 rowDTOs in the response.
 
Fields inherited from class com.google.gwt.gen2.table.client.TableModel
ALL_ROWS, UNKNOWN_ROW_COUNT
 
Constructor Summary
GenericTableModel()
          This constructs an empty table model for the RowType
GenericTableModel(List<RowType> rows)
          This constructs a populated table model for the RowType
 
Method Summary
 com.google.gwt.gen2.table.client.CachedTableModel<RowType> createCachedTableModel(int pageSize, int pages)
          This returns cached table model for the RowType
 int getRowCount()
          This overridden method returns the static size the table
 boolean isErrorMode()
           
 boolean isZeroMode()
           
protected  boolean onRowInserted(int beforeRow)
          This overridden method ...
protected  boolean onRowRemoved(int row)
          This overridden method ...
protected  boolean onSetRowValue(int row, RowType rowValue)
          This overridden method ...
 void requestRows(com.google.gwt.gen2.table.client.TableModelHelper.Request request, com.google.gwt.gen2.table.client.TableModel.Callback<RowType> callback)
          This overridden method handles only errorMode, zeroMode, and local dtos Production code will need rpc to load server side dto's, that feature can be added in a subclass and perhaps here if it can be done generically
 void setColumnDefs(List<com.google.gwt.gen2.table.client.AbstractColumnDefinition<ResultRow,?>> columnDefs)
           
 void setErrorMode(boolean errorMode)
           
 void setRows(List<RowType> rows)
           
 void setZeroMode(boolean zeroMode)
           
 
Methods inherited from class com.google.gwt.gen2.table.client.MutableTableModel
addRowInsertionHandler, addRowRemovalHandler, addRowValueChangeHandler, insertRow, removeRow, setRowValue
 
Methods inherited from class com.google.gwt.gen2.table.client.TableModel
addHandler, addRowCountChangeHandler, fireEvent, getHandlerManager, isEventHandled, removeHandler, setRowCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rowDTOs

private List<RowType> rowDTOs

fromIndex

private int fromIndex

lastSortedColumn

private int lastSortedColumn

lastSortDirection

private int lastSortDirection

columnDefs

private List<com.google.gwt.gen2.table.client.AbstractColumnDefinition<ResultRow,?>> columnDefs

errorMode

private boolean errorMode
A boolean indicating that we should throw an error.


zeroMode

private boolean zeroMode
A boolean indicating that we should return 0 rowDTOs in the response.

Constructor Detail

GenericTableModel

public GenericTableModel()
This constructs an empty table model for the RowType


GenericTableModel

public GenericTableModel(List<RowType> rows)
This constructs a populated table model for the RowType

Method Detail

createCachedTableModel

public com.google.gwt.gen2.table.client.CachedTableModel<RowType> createCachedTableModel(int pageSize,
                                                                                         int pages)
This returns cached table model for the RowType


onRowInserted

protected boolean onRowInserted(int beforeRow)
This overridden method ...

Specified by:
onRowInserted in class com.google.gwt.gen2.table.client.MutableTableModel<RowType>
See Also:
MutableTableModel.onRowInserted(int)

onRowRemoved

protected boolean onRowRemoved(int row)
This overridden method ...

Specified by:
onRowRemoved in class com.google.gwt.gen2.table.client.MutableTableModel<RowType>
See Also:
MutableTableModel.onRowRemoved(int)

onSetRowValue

protected boolean onSetRowValue(int row,
                                RowType rowValue)
This overridden method ...

Specified by:
onSetRowValue in class com.google.gwt.gen2.table.client.MutableTableModel<RowType>
See Also:
MutableTableModel.onSetRowValue(int, java.lang.Object)

requestRows

public void requestRows(com.google.gwt.gen2.table.client.TableModelHelper.Request request,
                        com.google.gwt.gen2.table.client.TableModel.Callback<RowType> callback)
This overridden method handles only errorMode, zeroMode, and local dtos Production code will need rpc to load server side dto's, that feature can be added in a subclass and perhaps here if it can be done generically

Specified by:
requestRows in class com.google.gwt.gen2.table.client.TableModel<RowType>
See Also:
TableModel.requestRows(com.google.gwt.gen2.table.client.TableModelHelper.Request, com.google.gwt.gen2.table.client.TableModel.Callback)

setRows

public void setRows(List<RowType> rows)
Parameters:
rowDTOs - the rowDTOs to set

getRowCount

public int getRowCount()
This overridden method returns the static size the table

Overrides:
getRowCount in class com.google.gwt.gen2.table.client.TableModel<RowType>
See Also:
TableModel.getRowCount()

isErrorMode

public boolean isErrorMode()
Returns:
the errorMode

setErrorMode

public void setErrorMode(boolean errorMode)
Parameters:
errorMode - the errorMode to set

isZeroMode

public boolean isZeroMode()
Returns:
the zeroMode

setZeroMode

public void setZeroMode(boolean zeroMode)
Parameters:
zeroMode - the zeroMode to set

setColumnDefs

public void setColumnDefs(List<com.google.gwt.gen2.table.client.AbstractColumnDefinition<ResultRow,?>> columnDefs)


Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.