if (KeyboardSelectionPolicy.DISABLED == getKeyboardSelectionPolicy()
|| !isRowWithinBounds(index) || columns.size() == 0) {
return;
}
TableRowElement tr = getRowElement(index);
String cellStyle = style.cellTableKeyboardSelectedCell();
boolean updatedSelection = !selected || isFocused || stealFocus;
setRowStyleName(tr, style.cellTableKeyboardSelectedRow(),
style.cellTableKeyboardSelectedRowCell(), selected);
NodeList<TableCellElement> cells = tr.getCells();
for (int i = 0; i < cells.getLength(); i++) {
TableCellElement td = cells.getItem(i);
// Update the selected style.
setStyleName(td, cellStyle, updatedSelection && selected
&& i == keyboardSelectedColumn);
// Mark as focusable.
final com.google.gwt.user.client.Element cellParent = getCellParent(td).cast();
setFocusable(cellParent, selected && i == keyboardSelectedColumn);
}
// Move focus to the cell.
if (selected && stealFocus && !cellIsEditing) {
TableCellElement td = tr.getCells().getItem(keyboardSelectedColumn);
final com.google.gwt.user.client.Element cellParent = getCellParent(td).cast();
CellBasedWidgetImpl.get().resetFocus(new Scheduler.ScheduledCommand() {
public void execute() {
cellParent.focus();
}