[file-history] highlight matches in hash and date

This commit is contained in:
Julia Beliaeva
2017-01-13 16:32:10 +03:00
parent e8b661afba
commit 96f9676a3a
@@ -960,8 +960,18 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton impleme
abstract static class VcsColumnInfo<T extends Comparable<T>> extends DualViewColumnInfo<VcsFileRevision, String>
implements Comparator<VcsFileRevision> {
@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 {