if (oldClientFirst == null) {
oldClientFirst = clientFirst;
}
int clientRows = ((SequenceRange) table.getComponentState().getRange()).getRows();
int difference = clientFirst - oldClientFirst;
SequenceRange addRange = null;
SequenceRange removeRange = null;
if (Math.abs(difference) >= clientRows) {
difference = 0;
addRange = new SequenceRange(clientFirst, clientRows);
removeRange = new SequenceRange(oldClientFirst, clientRows);
} else if (difference < 0) {
clientFirst += table.getFirst();
addRange = new SequenceRange(clientFirst, -difference);
removeRange = new SequenceRange(clientFirst + clientRows, -difference);
} else if (difference > 0) {
oldClientFirst += table.getFirst();
removeRange = new SequenceRange(oldClientFirst, difference);
int last = oldClientFirst + clientRows;
addRange = new SequenceRange(last, difference);
}
if (addRange != null) {
Object key = table.getRowKey();
table.captureOrigValue(context);
table.setRowKey(context, null);