From 4fa54fe5f12c2be354a2e4413ee7e3f35d5a99b7 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Thu, 10 Oct 2013 18:43:28 +0400 Subject: [PATCH] [log] cleanup: remove unused Kind --- .../vcs/log/graph/render/GraphCommitCell.java | 17 +--------- .../log/ui/render/GraphCommitCellRender.java | 32 +------------------ .../vcs/log/ui/tables/GraphTableModel.java | 2 +- 3 files changed, 3 insertions(+), 48 deletions(-) diff --git a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/render/GraphCommitCell.java b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/render/GraphCommitCell.java index eaf8c35a7780..70bf238da683 100644 --- a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/render/GraphCommitCell.java +++ b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/render/GraphCommitCell.java @@ -11,29 +11,14 @@ import java.util.Collection; */ public class GraphCommitCell extends CommitCell { - public enum Kind { - NORMAL, - PICK, - FIXUP, - REWORD, - APPLIED - } - private final GraphPrintCell row; - private final Kind kind; - public GraphCommitCell(GraphPrintCell row, Kind kind, String text, Collection refsToThisCommit) { + public GraphCommitCell(GraphPrintCell row, String text, Collection refsToThisCommit) { super(text, refsToThisCommit); - this.kind = kind; this.row = row; } public GraphPrintCell getPrintCell() { return row; } - - - public Kind getKind() { - return kind; - } } diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/GraphCommitCellRender.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/GraphCommitCellRender.java index 0c4014f060e7..943e24cb414d 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/GraphCommitCellRender.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/GraphCommitCellRender.java @@ -108,15 +108,6 @@ public class GraphCommitCellRender implements TableCellRenderer { return false; } - protected GraphCommitCell.Kind getKind(@Nullable Object value) { - GraphCommitCell cell = (GraphCommitCell)value; - if (cell == null) { - return GraphCommitCell.Kind.NORMAL; - } - - return cell.getKind(); - } - @Override public Component getTableCellRendererComponent(JTable table, @Nullable Object value, boolean isSelected, boolean hasFocus, int row, int column) { return cellRender.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); @@ -137,29 +128,8 @@ public class GraphCommitCellRender implements TableCellRenderer { Border paddingBorder = BorderFactory.createEmptyBorder(0, getLeftPadding(table, value), 0, 0); this.setBorder(BorderFactory.createCompoundBorder(this.getBorder(), paddingBorder)); - GraphCommitCell.Kind kind = getKind(value); Color textColor = isSelected ? table.getSelectionForeground() : JBColor.BLACK; - switch (kind) { - case APPLIED: - setBackground(APPLIED_BACKGROUND); - break; - case NORMAL: - setForeground(textColor); - break; - case PICK: - setFont(getFont().deriveFont(Font.BOLD)); - setForeground(textColor); - break; - case FIXUP: - setFont(getFont().deriveFont(Font.BOLD)); - setForeground(JBColor.GRAY); - break; - case REWORD: - setFont(getFont().deriveFont(Font.BOLD)); - setForeground(JBColor.BLUE); - break; - } - + setForeground(textColor); return this; } diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/tables/GraphTableModel.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/tables/GraphTableModel.java index 288c6cfa4795..1378e964563d 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/tables/GraphTableModel.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/tables/GraphTableModel.java @@ -77,7 +77,7 @@ public class GraphTableModel extends AbstractTableModel { message = data.getSubject(); refs = myDataPack.getRefsModel().refsToCommit(data.getHash()); } - return new GraphCommitCell(graphPrintCell, GraphCommitCell.Kind.NORMAL, message, refs); + return new GraphCommitCell(graphPrintCell, message, refs); case AUTHOR_COLUMN: if (data == null) { return "";