1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.atlassian.theplugin.idea.crucible.table.column;
18
19 import com.atlassian.theplugin.idea.TableColumnInfo;
20 import com.atlassian.theplugin.idea.crucible.ReviewDataInfoAdapter;
21
22 import java.util.Comparator;
23
24
25 public class ReviewStateColumn extends TableColumnInfo {
26 private static final int COL_WIDTH = 200;
27
28 public String getColumnName() {
29 return "State";
30 }
31
32 public Object valueOf(Object o) {
33 return ((ReviewDataInfoAdapter) o).getState().value();
34 }
35
36 public Class getColumnClass() {
37 return String.class;
38 }
39
40 public Comparator getComparator() {
41 return new Comparator() {
42 public int compare(Object o, Object o1) {
43 return ((ReviewDataInfoAdapter) o).getState().value()
44 .compareTo(((ReviewDataInfoAdapter) o1).getState().value());
45 }
46 };
47 }
48
49 public int getPrefferedWidth() {
50 return COL_WIDTH;
51 }
52
53
54 }