@Override @Nullable public Object getTagAt(@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 DualView.TableCellRendererWrapper) { cellRenderer = ((DualView.TableCellRendererWrapper) cellRenderer).getRenderer(); } if (cellRenderer instanceof TreeTableView.CellRendererWrapper) { cellRenderer = ((TreeTableView.CellRendererWrapper) cellRenderer).getBaseRenderer(); } if (cellRenderer instanceof ColoredTableCellRenderer) { final ColoredTableCellRenderer renderer = (ColoredTableCellRenderer)cellRenderer; tag = forColoredRenderer(e, table, row, column, renderer); } else { tag = tryGetTag(e, table, row, column); } return tag; }
@Nullable protected Object getTagAt(final MouseEvent e) { // TODO[yole]: don't update renderer on every event, like it's done in TreeLinkMouseListener Object tag = null; 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 DualView.TableCellRendererWrapper) { cellRenderer = ((DualView.TableCellRendererWrapper) cellRenderer).getRenderer(); } if (cellRenderer instanceof TreeTableView.CellRendererWrapper) { cellRenderer = ((TreeTableView.CellRendererWrapper) cellRenderer).getBaseRenderer(); } if (cellRenderer instanceof ColoredTableCellRenderer) { final ColoredTableCellRenderer renderer = (ColoredTableCellRenderer)cellRenderer; tag = forColoredRenderer(e, table, row, column, renderer); } else { tag = tryGetTag(e, table, row, column); } return tag; }
@Nullable public Object getTagAt(final MouseEvent e) { // TODO[yole]: don't update renderer on every event, like it's done in TreeLinkMouseListener Object tag = null; 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 DualView.TableCellRendererWrapper) { cellRenderer = ((DualView.TableCellRendererWrapper) cellRenderer).getRenderer(); } if (cellRenderer instanceof TreeTableView.CellRendererWrapper) { cellRenderer = ((TreeTableView.CellRendererWrapper) cellRenderer).getBaseRenderer(); } if (cellRenderer instanceof ColoredTableCellRenderer) { final ColoredTableCellRenderer renderer = (ColoredTableCellRenderer)cellRenderer; tag = forColoredRenderer(e, table, row, column, renderer); } else { tag = tryGetTag(e, table, row, column); } return tag; }
@Nonnull private DualViewColumnInfo[] createColumnList(@Nonnull Project project, @Nonnull VcsHistoryProvider provider, @Nullable ColumnInfo[] additionalColumns) { ArrayList<DualViewColumnInfo> columns = new ArrayList<>(); columns.add(new RevisionColumnInfo(myRevisionsInOrderComparator)); if (!provider.isDateOmittable()) columns.add(new DateColumnInfo()); columns.add(new AuthorColumnInfo()); ArrayList<DualViewColumnInfo> additionalColumnInfo = new ArrayList<>(); if (additionalColumns != null) { for (ColumnInfo additionalColumn : additionalColumns) { additionalColumnInfo.add(new FileHistoryColumnWrapper(additionalColumn) { @Override protected DualView getDualView() { return myDualView; } }); } } columns.addAll(additionalColumnInfo); columns.add(new MessageColumnInfo(project)); return columns.toArray(new DualViewColumnInfo[columns.size()]); }
protected abstract DualView getDualView();