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 handle UpdateDataCommands for data
changes that that should be stored temporarily and not directly performed on
the backing data. Creates UpdateDataChanges to track the
UpdateDataCommands 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, changedRowsFields inherited from class org.eclipse.nebula.widgets.nattable.datachange.AbstractDataChangeHandler
dataChanges, handleDataUpdate, keyHandler, layer -
Constructor Summary
ConstructorsConstructorDescriptionTemporaryUpdateDataChangeHandler(DataChangeLayer layer, CellKeyHandler<?> keyHandler) Creates anTemporaryUpdateDataChangeHandlerto handleDataUpdateEvents to be able to track and revert data changes. -
Method Summary
Modifier and TypeMethodDescriptionbooleandoCommand(ILayer targetLayer, UpdateDataCommand command) getDataValueByPosition(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, isDirty, isRowDirty, rebuildPositionCollections, removeChangesForDeletedColumnObjects, removeChangesForDeletedRowObjects, setUpdateOnHorizontalChanges, setUpdateOnVerticalChangesMethods inherited from class org.eclipse.nebula.widgets.nattable.datachange.AbstractDataChangeHandler
disableTracking, enableTracking, getDataChanges, getKeyHandler
-
Constructor Details
-
TemporaryUpdateDataChangeHandler
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 Details
-
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
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
- Specified by:
doCommandin interfaceILayerCommandHandler<UpdateDataCommand>- Parameters:
targetLayer- the target layercommand- the command- Returns:
- true if the command has been handled, false otherwise
-
getCommandClass
- Specified by:
getCommandClassin interfaceILayerCommandHandler<UpdateDataCommand>
-