Class DefaultColumnHeaderDataProvider
java.lang.Object
org.eclipse.nebula.widgets.nattable.grid.data.DefaultColumnHeaderDataProvider
- All Implemented Interfaces:
IDataProvider
The default
IDataProvider for the column header. Returns the data
value from the provided static data.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultColumnHeaderDataProvider(String[] columnLabels) DefaultColumnHeaderDataProvider(String[] propertyNames, Map<String, String> propertyToLabelMap) -
Method Summary
Modifier and TypeMethodDescriptionintgetColumnHeaderLabel(int columnIndex) getDataValue(int columnIndex, int rowIndex) Gets the value at the given column and row index.intvoidsetDataValue(int columnIndex, int rowIndex, Object newValue) Sets the value at the given column and row index.
-
Constructor Details
-
DefaultColumnHeaderDataProvider
- Parameters:
columnLabels- The labels that should be shown in the column header.
-
DefaultColumnHeaderDataProvider
public DefaultColumnHeaderDataProvider(String[] propertyNames, Map<String, String> propertyToLabelMap) - Parameters:
propertyNames- The property names/keys that are also used to access the row objects via reflection.propertyToLabelMap- The mapping between property name/key to the value that should be shown in the column header.
-
-
Method Details
-
getColumnHeaderLabel
- Parameters:
columnIndex- The column index for which the column header label is requested.- Returns:
- The column header label for the given column index.
-
getColumnCount
public int getColumnCount()- Specified by:
getColumnCountin interfaceIDataProvider- Returns:
- The number of columns this
IDataProviderhandles.
-
getRowCount
public int getRowCount()- Specified by:
getRowCountin interfaceIDataProvider- Returns:
- The number of rows this
IDataProviderhandles.
-
getDataValue
Description copied from interface:IDataProviderGets the value at the given column and row index.- Specified by:
getDataValuein 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
Description copied from interface:IDataProviderSets the value at the given column and row index. Optional operation. Should throw UnsupportedOperationException if this operation is not supported.- Specified by:
setDataValuein 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.
-