use of net.sourceforge.nattable.layer.event.IStructuralChangeEvent in project translationstudio8 by heartsome.
the class ColumnReorderLayer method handleLayerEvent.
@Override
public void handleLayerEvent(ILayerEvent event) {
if (event instanceof IStructuralChangeEvent) {
IStructuralChangeEvent structuralChangeEvent = (IStructuralChangeEvent) event;
if (structuralChangeEvent.isHorizontalStructureChanged()) {
Collection<StructuralDiff> structuralDiffs = structuralChangeEvent.getColumnDiffs();
if (structuralDiffs == null) {
// Assume everything changed
columnIndexOrder.clear();
populateIndexOrder();
} else {
for (StructuralDiff structuralDiff : structuralDiffs) {
switch(structuralDiff.getDiffType()) {
case ADD:
columnIndexOrder.clear();
populateIndexOrder();
break;
case DELETE:
columnIndexOrder.clear();
populateIndexOrder();
break;
}
}
}
invalidateCache();
}
}
super.handleLayerEvent(event);
}
Aggregations