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>
DataChangeHandler
to handleUpdateDataCommand
s for data changes that that should be stored temporarily and not directly performed on the backing data. CreatesUpdateDataChange
s to track theUpdateDataCommand
s 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 anTemporaryUpdateDataChangeHandler
to handleDataUpdateEvent
s to be able to track and revert data changes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
doCommand(ILayer targetLayer, UpdateDataCommand command)
Class<UpdateDataCommand>
getCommandClass()
Object
getDataValueByPosition(int columnPosition, int rowPosition)
Return the temporary data value for the given position.boolean
tracksDataChange(int columnPosition, int rowPosition)
Checks if thisTemporaryDataProvider
contains 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 anTemporaryUpdateDataChangeHandler
to handleDataUpdateEvent
s to be able to track and revert data changes.- Parameters:
layer
- TheDataChangeLayer
this handler should be assigned to.keyHandler
- TheCellKeyHandler
that is used to store data changes for a specific key.
-
-
Method Detail
-
tracksDataChange
public boolean tracksDataChange(int columnPosition, int rowPosition)
Description copied from interface:TemporaryDataProvider
Checks if thisTemporaryDataProvider
contains a temporary value for the given position.- Specified by:
tracksDataChange
in interfaceTemporaryDataProvider
- Parameters:
columnPosition
- The column position to check.rowPosition
- The row position to check.- Returns:
true
if a temporary data value for the given position exists,false
if not.
-
getDataValueByPosition
public Object getDataValueByPosition(int columnPosition, int rowPosition)
Description copied from interface:TemporaryDataProvider
Return the temporary data value for the given position.- Specified by:
getDataValueByPosition
in 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:
doCommand
in 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:
getCommandClass
in interfaceILayerCommandHandler<UpdateDataCommand>
-
-