while (iterator.hasNext()) {
/*
* Make the focus reflect to the server side state unless we
* are currently selecting multiple rows with keyboard.
*/
VScrollTableRow row = (VScrollTableRow) iterator.next();
boolean selected = selectedKeys.contains(row.getKey());
if (!selected
&& unSyncedselectionsBeforeRowFetch != null
&& unSyncedselectionsBeforeRowFetch.contains(row
.getKey())) {
selected = true;
keyboardSelectionOverRowFetchInProgress = true;
}
if (selected && selectedKeys.size() == 1) {
/*
* If a single item is selected, move focus to the
* selected row. (#10522)
*/
setRowFocus(row);
}
if (selected != row.isSelected()) {
row.toggleSelection();
if (!isSingleSelectMode() && !selected) {
// Update selection range in case a row is
// unselected from the middle of a range - #8076
removeRowFromUnsentSelectionRanges(row);