use of org.eclipse.nebula.widgets.nattable.layer.event.IStructuralChangeEvent in project nebula.widgets.nattable by eclipse.
the class RowReorderLayer method handleLayerEvent.
@Override
public void handleLayerEvent(ILayerEvent event) {
if (event instanceof IStructuralChangeEvent) {
IStructuralChangeEvent structuralChangeEvent = (IStructuralChangeEvent) event;
if (structuralChangeEvent.isVerticalStructureChanged()) {
Collection<StructuralDiff> structuralDiffs = structuralChangeEvent.getRowDiffs();
if (structuralDiffs == null) {
// Assume everything changed
populateIndexOrder();
} else {
// only react on ADD or DELETE and not on CHANGE
StructuralChangeEventHelper.handleRowDelete(structuralDiffs, this.underlyingLayer, this.rowIndexOrder, true);
StructuralChangeEventHelper.handleRowInsert(structuralDiffs, this.underlyingLayer, this.rowIndexOrder, true);
// update index-position mapping
refreshIndexPositionMapping();
}
invalidateCache();
}
}
super.handleLayerEvent(event);
}
Aggregations