if (tableCell == null)
return;
Element trElem = tableCell.getParentElement();
if (trElem == null)
return;
TableRowElement tr = TableRowElement.as(trElem);
// get the section of the row and confirm it is a tbody (as opposed
// to a thead or tfoot)
Element sectionElem = tr.getParentElement();
if (sectionElem == null)
return;
TableSectionElement section = TableSectionElement.as(sectionElem);
if (section != getTableBodyElement())
return;
// determine the row/item target
int row = tr.getSectionRowIndex();
T item = getVisibleItem(row);
// if this row isn't already selected then clear the existing selection
if (!getSelectionModel().isSelected(item))
clearSelection();