[git] IDEA-137632 speed search highlighting in interactive rebase

This commit is contained in:
Kirill Likhodedov
2015-04-16 13:22:37 +03:00
parent 51ac666d43
commit 043e5d22d4
@@ -22,7 +22,9 @@ import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.Cell;
import com.intellij.ui.ColoredTableCellRenderer;
import com.intellij.ui.TableSpeedSearch;
import com.intellij.ui.speedSearch.SpeedSearchUtil;
import com.intellij.ui.table.JBTable;
import com.intellij.util.ArrayUtil;
import com.intellij.util.ListWithSelection;
@@ -132,6 +134,14 @@ public class GitRebaseEditor extends DialogWrapper {
actionColumn.setCellEditor(new DefaultCellEditor(editorComboBox));
actionColumn.setCellRenderer(ComboBoxTableCellRenderer.INSTANCE);
myCommitsTable.setDefaultRenderer(String.class, new ColoredTableCellRenderer() {
@Override
protected void customizeCellRenderer(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
append(value.toString());
SpeedSearchUtil.applySpeedSearchHighlighting(myCommitsTable, this, true, selected);
}
});
myCommitsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(final ListSelectionEvent e) {
myViewButton.setEnabled(myCommitsTable.getSelectedRowCount() == 1);