diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java index 7573f139ad82..1a7faf7c7742 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java @@ -77,7 +77,10 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import javax.swing.table.*; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import javax.swing.table.TableColumn; +import javax.swing.table.TableModel; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreeCellRenderer; import javax.swing.tree.TreePath; @@ -206,7 +209,7 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton { return myStartingRevision; } - private static class AuthorCellRenderer extends DefaultTableCellRenderer { + private static class AuthorCellRenderer extends ColoredTableCellRenderer { private String myTooltipText; public void setTooltipText(final String text) { @@ -214,20 +217,17 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton { } @Override - public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { - final Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - if (c instanceof JComponent) { - ((JComponent)c).setToolTipText(myTooltipText); + protected void customizeCellRenderer(JTable table, @Nullable Object value, boolean selected, boolean hasFocus, int row, int column) { + setToolTipText(myTooltipText); + if (selected || hasFocus) { + setBackground(table.getSelectionBackground()); + setForeground(table.getSelectionForeground()); } - if (isSelected || hasFocus) { - c.setBackground(table.getSelectionBackground()); - c.setForeground(table.getSelectionForeground()); - } else { - c.setBackground(table.getBackground()); - c.setForeground(table.getForeground()); + else { + setBackground(table.getBackground()); + setForeground(table.getForeground()); } - - return c; + if (value != null) append(value.toString()); } }