Object (@NotNull final MouseEvent e) { // TODO[yole]: don't update renderer on every event, like it's done in TreeLinkMouseListener Object tag; JTable table = (JTable)e.getSource(); int row = table.rowAtPoint(e.getPoint()); int column = table.columnAtPoint(e.getPoint()); if (row == -1 || column == -1) return null; TableCellRenderer cellRenderer = table.getCellRenderer(row, column); if (cellRenderer instanceof TableCellRendererWrapper) { cellRenderer = ((TableCellRendererWrapper)cellRenderer).getBaseRenderer(); } if (cellRenderer instanceof ColoredTableCellRenderer renderer) { tag = forColoredRenderer(e, table, row, column, renderer); } else { tag = tryGetTag(e, table, row, column, cellRenderer); } return tag; }