Class AbstractDataChangeHandler<T extends DataChange>
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.datachange.AbstractDataChangeHandler<T>
-
- All Implemented Interfaces:
DataChangeHandler
- Direct Known Subclasses:
RowDeleteDataChangeHandler
,RowInsertDataChangeHandler
,UpdateDataChangeHandler
public abstract class AbstractDataChangeHandler<T extends DataChange> extends Object implements DataChangeHandler
Abstract implementation ofDataChangeHandler
to handle data updates.- Since:
- 1.6
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Object,T>
dataChanges
Collection of modified identifiers according to the usedCellKeyHandler
and correspondingDataChange
s that are collected in this handler.protected boolean
handleDataUpdate
Flag that is used to temporarily disable event handling.protected CellKeyHandler
keyHandler
TheCellKeyHandler
that is used to store dataChanges for a specific key.protected DataChangeLayer
layer
TheDataChangeLayer
this handler is assigned to.
-
Constructor Summary
Constructors Constructor Description AbstractDataChangeHandler(DataChangeLayer layer, CellKeyHandler<?> keyHandler, Map<Object,T> dataChanges)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearDataChanges()
Clear the locally stored changes.void
disableTracking()
Disable tracking of data changes to avoid tracking of changes that are caused by save or discard operations.void
enableTracking()
Enable tracking of data changes to keep track of all changes.Map<Object,T>
getDataChanges()
CellKeyHandler<?>
getKeyHandler()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.nebula.widgets.nattable.datachange.DataChangeHandler
handleStructuralChange, isCellDirty, isColumnDirty, isRowDirty
-
-
-
-
Field Detail
-
layer
protected final DataChangeLayer layer
TheDataChangeLayer
this handler is assigned to.
-
keyHandler
protected final CellKeyHandler keyHandler
TheCellKeyHandler
that is used to store dataChanges for a specific key.
-
dataChanges
protected final Map<Object,T extends DataChange> dataChanges
Collection of modified identifiers according to the usedCellKeyHandler
and correspondingDataChange
s that are collected in this handler.
-
handleDataUpdate
protected boolean handleDataUpdate
Flag that is used to temporarily disable event handling. Used to not handleDataUpdateEvent
s on discard.
-
-
Constructor Detail
-
AbstractDataChangeHandler
public AbstractDataChangeHandler(DataChangeLayer layer, CellKeyHandler<?> keyHandler, Map<Object,T> dataChanges)
- Parameters:
layer
- TheDataChangeLayer
this handler should be assigned to.keyHandler
- TheCellKeyHandler
that is used to store data changes for a specific key.dataChanges
- The map to track the data changes locally.
-
-
Method Detail
-
disableTracking
public void disableTracking()
Description copied from interface:DataChangeHandler
Disable tracking of data changes to avoid tracking of changes that are caused by save or discard operations.- Specified by:
disableTracking
in interfaceDataChangeHandler
-
enableTracking
public void enableTracking()
Description copied from interface:DataChangeHandler
Enable tracking of data changes to keep track of all changes.- Specified by:
enableTracking
in interfaceDataChangeHandler
-
clearDataChanges
public void clearDataChanges()
Description copied from interface:DataChangeHandler
Clear the locally stored changes.- Specified by:
clearDataChanges
in interfaceDataChangeHandler
-
getKeyHandler
public CellKeyHandler<?> getKeyHandler()
- Returns:
- The
CellKeyHandler
that is used to store dataChanges for a specific key.
-
getDataChanges
public Map<Object,T> getDataChanges()
- Returns:
- Collection of modified identifiers according to the used
CellKeyHandler
and correspondingDataChange
s that are collected in this handler.
-
-