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 ofDataChangeHandlerto handle data updates.- Since:
- 1.6
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Object,T>dataChangesCollection of modified identifiers according to the usedCellKeyHandlerand correspondingDataChanges that are collected in this handler.protected booleanhandleDataUpdateFlag that is used to temporarily disable event handling.protected CellKeyHandlerkeyHandlerTheCellKeyHandlerthat is used to store dataChanges for a specific key.protected DataChangeLayerlayerTheDataChangeLayerthis 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 voidclearDataChanges()Clear the locally stored changes.voiddisableTracking()Disable tracking of data changes to avoid tracking of changes that are caused by save or discard operations.voidenableTracking()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
TheDataChangeLayerthis handler is assigned to.
-
keyHandler
protected final CellKeyHandler keyHandler
TheCellKeyHandlerthat 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 usedCellKeyHandlerand correspondingDataChanges that are collected in this handler.
-
handleDataUpdate
protected boolean handleDataUpdate
Flag that is used to temporarily disable event handling. Used to not handleDataUpdateEvents on discard.
-
-
Constructor Detail
-
AbstractDataChangeHandler
public AbstractDataChangeHandler(DataChangeLayer layer, CellKeyHandler<?> keyHandler, Map<Object,T> dataChanges)
- Parameters:
layer- TheDataChangeLayerthis handler should be assigned to.keyHandler- TheCellKeyHandlerthat 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:DataChangeHandlerDisable tracking of data changes to avoid tracking of changes that are caused by save or discard operations.- Specified by:
disableTrackingin interfaceDataChangeHandler
-
enableTracking
public void enableTracking()
Description copied from interface:DataChangeHandlerEnable tracking of data changes to keep track of all changes.- Specified by:
enableTrackingin interfaceDataChangeHandler
-
clearDataChanges
public void clearDataChanges()
Description copied from interface:DataChangeHandlerClear the locally stored changes.- Specified by:
clearDataChangesin interfaceDataChangeHandler
-
getKeyHandler
public CellKeyHandler<?> getKeyHandler()
- Returns:
- The
CellKeyHandlerthat is used to store dataChanges for a specific key.
-
getDataChanges
public Map<Object,T> getDataChanges()
- Returns:
- Collection of modified identifiers according to the used
CellKeyHandlerand correspondingDataChanges that are collected in this handler.
-
-