From 96f9676a3a1c8db67a21cdc12afee55923300e6f Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Fri, 13 Jan 2017 16:28:34 +0300 Subject: [PATCH] [file-history] highlight matches in hash and date --- .../vcs/history/FileHistoryPanelImpl.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 91152072f867..766ed4d19cd1 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 @@ -960,8 +960,18 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton impleme abstract static class VcsColumnInfo> extends DualViewColumnInfo implements Comparator { + @NotNull private final ColoredTableCellRenderer myRenderer; + public VcsColumnInfo(String name) { super(name); + + myRenderer = new ColoredTableCellRenderer() { + protected void customizeCellRenderer(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) { + setOpaque(selected); + append(value.toString()); + SpeedSearchUtil.applySpeedSearchHighlighting(table, this, false, selected); + } + }; } protected abstract T getDataOf(VcsFileRevision o); @@ -986,6 +996,12 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton impleme public boolean shouldBeShownIsTheTable() { return true; } + + @Nullable + @Override + public TableCellRenderer getRenderer(VcsFileRevision revision) { + return myRenderer; + } } private static class MyTreeCellRenderer implements TreeCellRenderer {