Class IdIndexKeyHandler<T>
java.lang.Object
org.eclipse.nebula.widgets.nattable.datachange.IdIndexKeyHandler<T>
- Type Parameters:
T- The type of the objects handled inside the NatTable.
- All Implemented Interfaces:
CellKeyHandler<IdIndexIdentifier<T>>
Implementation of
CellKeyHandler that uses IdIndexIdentifier
as key object. Operates via IRowDataProvider and
IRowIdAccessor to find the row index even in sorted or filtered
collections again.- Since:
- 1.6
-
Constructor Summary
ConstructorsConstructorDescriptionIdIndexKeyHandler(IRowDataProvider<T> rowDataProvider, IRowIdAccessor<T> rowIdAccessor) Creates anIdIndexKeyHandlerthat identifies the type to handle via reflection.IdIndexKeyHandler(IRowDataProvider<T> rowDataProvider, IRowIdAccessor<T> rowIdAccessor, Class<T> type) -
Method Summary
Modifier and TypeMethodDescriptionintgetColumnIndex(IdIndexIdentifier<T> key) getKey(int columnIndex, int rowIndex) Creates the cell key based on the given column index and row index.getKeyWithColumnUpdate(IdIndexIdentifier<T> oldKey, int columnIndex) Creates a new cell key based on the given key with an updated column index.getKeyWithRowUpdate(IdIndexIdentifier<T> oldKey, int rowIndex) Creates a new cell key based on the given key with an updated row index.intgetRowIndex(IdIndexIdentifier<T> key) booleanboolean
-
Constructor Details
-
IdIndexKeyHandler
Creates anIdIndexKeyHandlerthat identifies the type to handle via reflection. If the reflection fails or produces strange results, try to pass the type viaIdIndexKeyHandler(IRowDataProvider, IRowIdAccessor, Class)- Parameters:
rowDataProvider- TheIRowDataProviderneeded to retrieve the modified row object.rowIdAccessor- TheIRowIdAccessorneeded to retrieve the row object id.
-
IdIndexKeyHandler
public IdIndexKeyHandler(IRowDataProvider<T> rowDataProvider, IRowIdAccessor<T> rowIdAccessor, Class<T> type) - Parameters:
rowDataProvider- TheIRowDataProviderneeded to retrieve the modified row object.rowIdAccessor- TheIRowIdAccessorneeded to retrieve the row object id.type- The type of objects handled by the IRowDataProvider and the IRowIdAcccessor.- Since:
- 2.1
-
-
Method Details
-
getKey
Description copied from interface:CellKeyHandlerCreates the cell key based on the given column index and row index.- Specified by:
getKeyin interfaceCellKeyHandler<T>- Parameters:
columnIndex- The column index of the cell whose key should be generated.rowIndex- The row index of the cell whose key should be generated.- Returns:
- The key of the cell with the given indexes.
-
getKeyWithColumnUpdate
Description copied from interface:CellKeyHandlerCreates a new cell key based on the given key with an updated column index.- Specified by:
getKeyWithColumnUpdatein interfaceCellKeyHandler<T>- Parameters:
oldKey- The key that should be copied.columnIndex- The column index that should be updated in the existing key.- Returns:
- The key of the cell with the previous row identifier and the updated column identifier.
-
getKeyWithRowUpdate
Description copied from interface:CellKeyHandlerCreates a new cell key based on the given key with an updated row index.- Specified by:
getKeyWithRowUpdatein interfaceCellKeyHandler<T>- Parameters:
oldKey- The key that should be copied.rowIndex- The row index that should be updated in the existing key.- Returns:
- The key of the cell with the previous column identifier and the updated row identifier.
-
getColumnIndex
- Specified by:
getColumnIndexin interfaceCellKeyHandler<T>- Parameters:
key- The key from which the column index should be retrieved.- Returns:
- The column index for the cell key.
-
getRowIndex
- Specified by:
getRowIndexin interfaceCellKeyHandler<T>- Parameters:
key- The key from which the row index should be retrieved.- Returns:
- The row index for the cell key.
-
updateOnHorizontalStructuralChange
public boolean updateOnHorizontalStructuralChange()- Specified by:
updateOnHorizontalStructuralChangein interfaceCellKeyHandler<T>- Returns:
trueif the keys created by this handler need to be updated on horizontal structural changes,falseif the keys update automatically.
-
updateOnVerticalStructuralChange
public boolean updateOnVerticalStructuralChange()- Specified by:
updateOnVerticalStructuralChangein interfaceCellKeyHandler<T>- Returns:
trueif the keys created by this handler need to be updated on vertical structural changes,falseif the keys update automatically.
-