// element.
Element trElem = tableCell.getParentElement();
if (trElem == null) {
return;
}
TableRowElement tr = TableRowElement.as(trElem);
Element sectionElem = tr.getParentElement();
if (sectionElem == null) {
return;
}
TableSectionElement section = TableSectionElement.as(sectionElem);
// Forward the event to the associated header, footer, or column.
int col = tableCell.getCellIndex();
if (section == thead) {
Header<?> header = headers.get(col);
if (header != null && cellConsumesEventType(header.getCell(), eventType)) {
Context context = new Context(0, col, header.getKey());
header.onBrowserEvent(context, tableCell, event);
}
} else if (section == tfoot) {
Header<?> footer = footers.get(col);
if (footer != null && cellConsumesEventType(footer.getCell(), eventType)) {
Context context = new Context(0, col, footer.getKey());
footer.onBrowserEvent(context, tableCell, event);
}
} else if (section == tbody) {
// Update the hover state.
boolean isClick = "click".equals(eventType);
int row = tr.getSectionRowIndex();
if ("mouseover".equals(eventType)) {
// Unstyle the old row if it is still part of the table.
if (hoveringRow != null && tbody.isOrHasChild(hoveringRow)) {
setRowStyleName(hoveringRow, style.cellTableHoveredRow(),
style.cellTableHoveredRowCell(), false);