Class TemporaryUpdateDataChangeHandler
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.datachange.AbstractDataChangeHandler<T>
-
- org.eclipse.nebula.widgets.nattable.datachange.UpdateDataChangeHandler<TemporaryUpdateDataChange>
-
- org.eclipse.nebula.widgets.nattable.datachange.TemporaryUpdateDataChangeHandler
-
- All Implemented Interfaces:
ILayerCommandHandler<UpdateDataCommand>,DataChangeHandler,TemporaryDataProvider
public class TemporaryUpdateDataChangeHandler extends UpdateDataChangeHandler<TemporaryUpdateDataChange> implements TemporaryDataProvider, ILayerCommandHandler<UpdateDataCommand>
DataChangeHandlerto handleUpdateDataCommands for data changes that that should be stored temporarily and not directly performed on the backing data. CreatesUpdateDataChanges to track theUpdateDataCommands so they can be executed on the backing data on save.- Since:
- 1.6
-
-
Field Summary
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.datachange.UpdateDataChangeHandler
changedColumns, changedRows
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.datachange.AbstractDataChangeHandler
dataChanges, handleDataUpdate, keyHandler, layer
-
-
Constructor Summary
Constructors Constructor Description TemporaryUpdateDataChangeHandler(DataChangeLayer layer, CellKeyHandler<?> keyHandler)Creates anTemporaryUpdateDataChangeHandlerto handleDataUpdateEvents to be able to track and revert data changes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandoCommand(ILayer targetLayer, UpdateDataCommand command)Class<UpdateDataCommand>getCommandClass()ObjectgetDataValueByPosition(int columnPosition, int rowPosition)Return the temporary data value for the given position.booleantracksDataChange(int columnPosition, int rowPosition)Checks if thisTemporaryDataProvidercontains a temporary value for the given position.-
Methods inherited from class org.eclipse.nebula.widgets.nattable.datachange.UpdateDataChangeHandler
clearDataChanges, handleColumnDelete, handleColumnInsert, handleStructuralChange, isCellDirty, isColumnDirty, isRowDirty, rebuildPositionCollections, removeChangesForDeletedColumnObjects, removeChangesForDeletedRowObjects, setUpdateOnHorizontalChanges, setUpdateOnVerticalChanges
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.datachange.AbstractDataChangeHandler
disableTracking, enableTracking, getDataChanges, getKeyHandler
-
-
-
-
Constructor Detail
-
TemporaryUpdateDataChangeHandler
public TemporaryUpdateDataChangeHandler(DataChangeLayer layer, CellKeyHandler<?> keyHandler)
Creates anTemporaryUpdateDataChangeHandlerto handleDataUpdateEvents to be able to track and revert data changes.- Parameters:
layer- TheDataChangeLayerthis handler should be assigned to.keyHandler- TheCellKeyHandlerthat is used to store data changes for a specific key.
-
-
Method Detail
-
tracksDataChange
public boolean tracksDataChange(int columnPosition, int rowPosition)Description copied from interface:TemporaryDataProviderChecks if thisTemporaryDataProvidercontains a temporary value for the given position.- Specified by:
tracksDataChangein interfaceTemporaryDataProvider- Parameters:
columnPosition- The column position to check.rowPosition- The row position to check.- Returns:
trueif a temporary data value for the given position exists,falseif not.
-
getDataValueByPosition
public Object getDataValueByPosition(int columnPosition, int rowPosition)
Description copied from interface:TemporaryDataProviderReturn the temporary data value for the given position.- Specified by:
getDataValueByPositionin interfaceTemporaryDataProvider- Parameters:
columnPosition- The column position for which the data value should be returned.rowPosition- The row position for which the data value should be returned.- Returns:
- The data value for the given position.
-
doCommand
public boolean doCommand(ILayer targetLayer, UpdateDataCommand command)
- Specified by:
doCommandin interfaceILayerCommandHandler<UpdateDataCommand>- Parameters:
targetLayer- the target layercommand- the command- Returns:
- true if the command has been handled, false otherwise
-
getCommandClass
public Class<UpdateDataCommand> getCommandClass()
- Specified by:
getCommandClassin interfaceILayerCommandHandler<UpdateDataCommand>
-
-