mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[log] cleanup: remove unused Kind
This commit is contained in:
@@ -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<VcsRef> refsToThisCommit) {
|
||||
public GraphCommitCell(GraphPrintCell row, String text, Collection<VcsRef> refsToThisCommit) {
|
||||
super(text, refsToThisCommit);
|
||||
this.kind = kind;
|
||||
this.row = row;
|
||||
}
|
||||
|
||||
public GraphPrintCell getPrintCell() {
|
||||
return row;
|
||||
}
|
||||
|
||||
|
||||
public Kind getKind() {
|
||||
return kind;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-31
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 "";
|
||||
|
||||
Reference in New Issue
Block a user