org.eclipse.nebula.widgets.nattable.extension.glazedlists
Class GlazedListsDataProvider<T>

java.lang.Object
  extended by org.eclipse.nebula.widgets.nattable.data.ListDataProvider<T>
      extended by org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsDataProvider<T>
All Implemented Interfaces:
IDataProvider, IRowDataProvider<T>

public class GlazedListsDataProvider<T>
extends ListDataProvider<T>

This class implements "last row" caching for much faster column value access on the table. As normally the default implementation would fetch the row object for each cell in a column, we know what the last row we fetched was, and if it's a re-request of the same row as last time, we simply return the last cached row object (assuming the list didn't change in some important way, as then we clear out our cache).

Author:
Emil Crumhorn

Field Summary
 
Fields inherited from class org.eclipse.nebula.widgets.nattable.data.ListDataProvider
columnAccessor, list
 
Constructor Summary
GlazedListsDataProvider(ca.odell.glazedlists.EventList<T> list, IColumnAccessor<T> columnAccessor)
           
 
Method Summary
 Object getDataValue(int colIndex, int rowIndex)
          Gets the value at the given column and row index.
 T getRowObject(int rowIndex)
           
 void inputChanged()
           
 
Methods inherited from class org.eclipse.nebula.widgets.nattable.data.ListDataProvider
getColumnCount, getList, getRowCount, indexOfRowObject, setDataValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlazedListsDataProvider

public GlazedListsDataProvider(ca.odell.glazedlists.EventList<T> list,
                               IColumnAccessor<T> columnAccessor)
Method Detail

inputChanged

public void inputChanged()

getRowObject

public T getRowObject(int rowIndex)
Specified by:
getRowObject in interface IRowDataProvider<T>
Overrides:
getRowObject in class ListDataProvider<T>

getDataValue

public Object getDataValue(int colIndex,
                           int rowIndex)
Description copied from interface: IDataProvider
Gets the value at the given column and row index.

Specified by:
getDataValue in interface IDataProvider
Overrides:
getDataValue in class ListDataProvider<T>
Returns:
the data value associated with the specified cell


Copyright © 2015. All rights reserved.