Class ListDataProvider<T>
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.data.ListDataProvider<T>
-
- Type Parameters:
T
- type of the Objects in the backing list.
- All Implemented Interfaces:
IDataProvider
,IRowDataProvider<T>
- Direct Known Subclasses:
AbstractFilterListDataProvider
,ColumnStructureUpdatesExampleGridLayer.ListDataProviderExample
,DefaultBodyDataProvider
,GlazedListsDataProvider
public class ListDataProvider<T> extends Object implements IRowDataProvider<T>
Enables the use of aList
containing POJO(s) as a backing data source. By default a bean at position 'X' in the list is displayed in row 'X' in the table. The properties of the bean are used to populate the columns. AIColumnPropertyResolver
is used to retrieve column data from the bean properties.- See Also:
IColumnPropertyResolver
-
-
Field Summary
Fields Modifier and Type Field Description protected IColumnAccessor<T>
columnAccessor
protected List<T>
list
-
Constructor Summary
Constructors Constructor Description ListDataProvider(List<T> list, IColumnAccessor<T> columnAccessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumnCount()
Object
getDataValue(int columnIndex, int rowIndex)
Gets the value at the given column and row index.List<T>
getList()
int
getRowCount()
T
getRowObject(int rowIndex)
int
indexOfRowObject(T rowObject)
void
setDataValue(int columnIndex, int rowIndex, Object newValue)
Sets the value at the given column and row index.
-
-
-
Field Detail
-
columnAccessor
protected IColumnAccessor<T> columnAccessor
-
-
Constructor Detail
-
ListDataProvider
public ListDataProvider(List<T> list, IColumnAccessor<T> columnAccessor)
-
-
Method Detail
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interfaceIDataProvider
- Returns:
- The number of columns this
IDataProvider
handles.
-
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in interfaceIDataProvider
- Returns:
- The number of rows this
IDataProvider
handles.
-
getDataValue
public Object getDataValue(int columnIndex, int rowIndex)
Description copied from interface:IDataProvider
Gets the value at the given column and row index.- Specified by:
getDataValue
in interfaceIDataProvider
- Parameters:
columnIndex
- The column index of the cell whose value is requested.rowIndex
- The row index of the cell whose value is requested.- Returns:
- The data value associated with the specified cell coordintates.
-
setDataValue
public void setDataValue(int columnIndex, int rowIndex, Object newValue)
Description copied from interface:IDataProvider
Sets the value at the given column and row index. Optional operation. Should throw UnsupportedOperationException if this operation is not supported.- Specified by:
setDataValue
in interfaceIDataProvider
- Parameters:
columnIndex
- The column index of the cell whose value should be changed.rowIndex
- The row index of the cell whose value should be changed.newValue
- The new value that should be set.
-
getRowObject
public T getRowObject(int rowIndex)
- Specified by:
getRowObject
in interfaceIRowDataProvider<T>
-
indexOfRowObject
public int indexOfRowObject(T rowObject)
- Specified by:
indexOfRowObject
in interfaceIRowDataProvider<T>
-
-