Search in sources :

Example 1 with RowSelectionEvent

use of net.sourceforge.nattable.selection.event.RowSelectionEvent in project translationstudio8 by heartsome.

the class SplitSegmentOperation method refreshNatTable.

private void refreshNatTable() {
    SelectionLayer selectionLayer = LayerUtil.getLayer(xliffEditor.getTable(), SelectionLayer.class);
    int rowPosition = selectionLayer.getRowPositionByIndex(rowIndex);
    selectionLayer.fireLayerEvent(new RowSelectionEvent(selectionLayer, Arrays.asList(new Integer[] { rowPosition, rowPosition + 1 })));
    xliffEditor.autoResizeNotColumn();
    ActiveCellRegion.setActiveCellRegion(null);
}
Also used : SelectionLayer(net.sourceforge.nattable.selection.SelectionLayer) RowSelectionEvent(net.sourceforge.nattable.selection.event.RowSelectionEvent)

Example 2 with RowSelectionEvent

use of net.sourceforge.nattable.selection.event.RowSelectionEvent in project translationstudio8 by heartsome.

the class SelectRowCommandHandler method selectRows.

protected void selectRows(int columnPosition, Collection<Integer> rowPositions, boolean withShiftMask, boolean withControlMask) {
    Set<Range> changedRowRanges = new HashSet<Range>();
    for (int rowPosition : rowPositions) {
        changedRowRanges.addAll(internalSelectRow(columnPosition, rowPosition, withShiftMask, withControlMask));
    }
    Set<Integer> changedRows = new HashSet<Integer>();
    for (Range range : changedRowRanges) {
        for (int i = range.start; i < range.end; i++) {
            changedRows.add(Integer.valueOf(i));
        }
    }
    selectionLayer.fireLayerEvent(new RowSelectionEvent(selectionLayer, changedRows));
}
Also used : RowSelectionEvent(net.sourceforge.nattable.selection.event.RowSelectionEvent) Range(net.sourceforge.nattable.coordinate.Range) HashSet(java.util.HashSet)

Aggregations

RowSelectionEvent (net.sourceforge.nattable.selection.event.RowSelectionEvent)2 HashSet (java.util.HashSet)1 Range (net.sourceforge.nattable.coordinate.Range)1 SelectionLayer (net.sourceforge.nattable.selection.SelectionLayer)1