com.google.gwt.widgetideas.table.client
Class BulkLoader

java.lang.Object
  extended by com.google.gwt.widgetideas.table.client.BulkLoader

public class BulkLoader
extends java.lang.Object

A helper class to enable bulk loading of tables from a TableModel.


Nested Class Summary
static interface BulkLoader.BulkLoadable
           
static interface BulkLoader.OnLoadCompleteCallBack
          CallBack for when loading the table is complete.
 
Field Summary
 int MAX_TIME
          Maximum time allowable to create the table string.
 BulkLoader.OnLoadCompleteCallBack onLoadComplete
          A bulk loader may have a single BulkLoader.OnLoadCompleteCallBack so the user may continue processing after the table is fully loaded.
static int TIME_SLICE
          Time slice in milliseconds that the construction of the string can take before flushing the event cue.
 
Constructor Summary
BulkLoader(BulkLoader.BulkLoadable table)
           
 
Method Summary
 int getRowsPerTimeCheck()
           
 void renderRows(java.util.List rows)
          Sets the table's rows to the list of rows provided.
 void renderRows(TableModel tableModel)
          Sets the table's rows to all the data contained in the given tableModel.
 void renderRows(TableModel tableModel, int startRow, int numRows)
          Init rows removes all rows in the current table and adds the rows supplied by the tableModel.
 void renderRows(TableModel tableModel, int startRow, int numRows, java.lang.String headerRow)
          Init rows removes all rows in the current table and adds the rows supplied by the tableModel.
 void renderRows(TableModel tableModel, int startRow, int numRows, java.lang.String headerRow, java.lang.String startCell, java.lang.String endCell)
          Init rows removes all rows in the current table and adds the rows supplied by the tableModel.
 void setRowsPerTimeCheck(int rowsPerTimeCheck)
          Sets how many rows should be processed before time is checked for an event flush.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

onLoadComplete

public BulkLoader.OnLoadCompleteCallBack onLoadComplete
A bulk loader may have a single BulkLoader.OnLoadCompleteCallBack so the user may continue processing after the table is fully loaded.


TIME_SLICE

public static int TIME_SLICE
Time slice in milliseconds that the construction of the string can take before flushing the event cue. As time is only checked periodically, this number should always be set conservatively.

Note: TIME_SLICE does not to anything unless rowsPerTimeCheck is set to something other than Integer.MAX_VALUE.


MAX_TIME

public int MAX_TIME
Maximum time allowable to create the table string. Ever.

Note: MAX_TIME does not to anything unless rowsPerTimeCheck is set to something other than Integer.MAX_VALUE.

Constructor Detail

BulkLoader

public BulkLoader(BulkLoader.BulkLoadable table)
Method Detail

renderRows

public void renderRows(java.util.List rows)
Sets the table's rows to the list of rows provided.

Parameters:
rows - list of rows. Each row itself must be another list

renderRows

public void renderRows(TableModel tableModel)
Sets the table's rows to all the data contained in the given tableModel.

Parameters:
tableModel - the data tableModel

renderRows

public void renderRows(TableModel tableModel,
                       int startRow,
                       int numRows)
Init rows removes all rows in the current table and adds the rows supplied by the tableModel.

Parameters:
tableModel - the table data
startRow - the tableModel's start row index
numRows - the number of rows to request from the tableModel -1 indicates all of them

renderRows

public void renderRows(TableModel tableModel,
                       int startRow,
                       int numRows,
                       java.lang.String headerRow)
Init rows removes all rows in the current table and adds the rows supplied by the tableModel.

Parameters:
tableModel - the table data
startRow - the tableModel's start row index
numRows - the number of rows to request from the tableModel -1 indicates all of them
headerRow - the initial row of the table. As this can have custom styling, it is passed into the renderer

renderRows

public void renderRows(TableModel tableModel,
                       int startRow,
                       int numRows,
                       java.lang.String headerRow,
                       java.lang.String startCell,
                       java.lang.String endCell)
Init rows removes all rows in the current table and adds the rows supplied by the tableModel.

Parameters:
tableModel - the table data
startRow - the tableModel's start row index
numRows - the number of rows to request from the tableModel -1 indicates all of them
headerRow - the initial row of the table. As this can have custom styling, it is passed into the renderer
startCell - the with all extra needed tags
endCell - the " with any extra needed tags

setRowsPerTimeCheck

public void setRowsPerTimeCheck(int rowsPerTimeCheck)
Sets how many rows should be processed before time is checked for an event flush. Note: If rowsPerTimeCheck is set to anything other than Integer.MAX_VALUE, then the table is constructed asynchronously.

Parameters:
rowsPerTimeCheck -

getRowsPerTimeCheck

public int getRowsPerTimeCheck()