use of net.sourceforge.nattable.selection.event.ISelectionEvent in project translationstudio8 by heartsome.
the class RowSelectionProvider method handleLayerEvent.
public void handleLayerEvent(ILayerEvent event) {
if (event instanceof ISelectionEvent) {
int[] rowPositions = selectionLayer.getFullySelectedRowPositions();
if (fullySelectedRowsOnly && rowPositions.length == 0) {
ActiveCellRegion.setActiveCellRegion(null);
return;
}
Arrays.sort(rowPositions);
int rowPosition = rowPositions[rowPositions.length - 1];
if (rowPosition == currentRowPosition) {
return;
}
currentRowPosition = rowPosition;
int rowIndex = selectionLayer.getRowIndexByPosition(rowPosition);
ISelection selection = new StructuredSelection(rowIndex);
SelectionChangedEvent e = new SelectionChangedEvent(this, selection);
for (ISelectionChangedListener listener : listeners) {
listener.selectionChanged(e);
}
}
}
Aggregations