use of org.eclipse.nebula.widgets.nattable.layer.event.RowStructuralChangeEvent in project nebula.widgets.nattable by eclipse.
the class RowSelectionPreserver method handleLayerEvent.
/**
* On a change in the underlying data:
* <ol>
* <li>Clears the selection
* <li>Re-select the row objects selected earlier.
* </ol>
*/
@Override
public void handleLayerEvent(IVisualChangeEvent event) {
if (ObjectUtils.isEmpty(this.selectedRowObjects)) {
return;
}
if (event instanceof RowStructuralRefreshEvent || event instanceof RowStructuralChangeEvent || event instanceof SortColumnEvent) {
this.selectionLayer.clear();
this.selectionProvider.setSelection(new StructuredSelection(getValidSelections()));
}
}
Aggregations