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>>
public class IdIndexKeyHandler<T> extends Object implements CellKeyHandler<IdIndexIdentifier<T>>
Implementation ofCellKeyHandler
that usesIdIndexIdentifier
as key object. Operates viaIRowDataProvider
andIRowIdAccessor
to find the row index even in sorted or filtered collections again.- Since:
- 1.6
-
-
Constructor Summary
Constructors Constructor Description IdIndexKeyHandler(IRowDataProvider<T> rowDataProvider, IRowIdAccessor<T> rowIdAccessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumnIndex(IdIndexIdentifier<T> key)
IdIndexIdentifier<T>
getKey(int columnIndex, int rowIndex)
Creates the cell key based on the given column index and row index.IdIndexIdentifier<T>
getKeyWithColumnUpdate(IdIndexIdentifier<T> oldKey, int columnIndex)
Creates a new cell key based on the given key with an updated column index.IdIndexIdentifier<T>
getKeyWithRowUpdate(IdIndexIdentifier<T> oldKey, int rowIndex)
Creates a new cell key based on the given key with an updated row index.int
getRowIndex(IdIndexIdentifier<T> key)
boolean
updateOnHorizontalStructuralChange()
boolean
updateOnVerticalStructuralChange()
-
-
-
Constructor Detail
-
IdIndexKeyHandler
public IdIndexKeyHandler(IRowDataProvider<T> rowDataProvider, IRowIdAccessor<T> rowIdAccessor)
-
-
Method Detail
-
getKey
public IdIndexIdentifier<T> getKey(int columnIndex, int rowIndex)
Description copied from interface:CellKeyHandler
Creates the cell key based on the given column index and row index.- Specified by:
getKey
in 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
public IdIndexIdentifier<T> getKeyWithColumnUpdate(IdIndexIdentifier<T> oldKey, int columnIndex)
Description copied from interface:CellKeyHandler
Creates a new cell key based on the given key with an updated column index.- Specified by:
getKeyWithColumnUpdate
in 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
public IdIndexIdentifier<T> getKeyWithRowUpdate(IdIndexIdentifier<T> oldKey, int rowIndex)
Description copied from interface:CellKeyHandler
Creates a new cell key based on the given key with an updated row index.- Specified by:
getKeyWithRowUpdate
in 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
public int getColumnIndex(IdIndexIdentifier<T> key)
- Specified by:
getColumnIndex
in interfaceCellKeyHandler<T>
- Parameters:
key
- The key from which the column index should be retrieved.- Returns:
- The column index for the cell key.
-
getRowIndex
public int getRowIndex(IdIndexIdentifier<T> key)
- Specified by:
getRowIndex
in 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:
updateOnHorizontalStructuralChange
in interfaceCellKeyHandler<T>
- Returns:
true
if the keys created by this handler need to be updated on horizontal structural changes,false
if the keys update automatically.
-
updateOnVerticalStructuralChange
public boolean updateOnVerticalStructuralChange()
- Specified by:
updateOnVerticalStructuralChange
in interfaceCellKeyHandler<T>
- Returns:
true
if the keys created by this handler need to be updated on vertical structural changes,false
if the keys update automatically.
-
-