1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.atlassian.theplugin.idea.bamboo.table.columns;
18
19 import com.atlassian.theplugin.idea.bamboo.BambooBuildAdapterIdea;
20 import com.atlassian.theplugin.idea.TableColumnInfo;
21
22 import java.util.Comparator;
23
24
25
26
27
28
29
30
31 public class BuildNumberColumn extends TableColumnInfo {
32 private static final int COL_WIDTH = 100;
33
34 public String getColumnName() {
35 return "Build number";
36 }
37
38 public Object valueOf(Object o) {
39 return Integer.valueOf(((BambooBuildAdapterIdea) o).getBuildNumber());
40 }
41
42 public Class getColumnClass() {
43 return Integer.class;
44 }
45
46 public Comparator getComparator() {
47 return new Comparator() {
48 public int compare(Object o, Object o1) {
49 return Integer.parseInt(((BambooBuildAdapterIdea) o).getBuildNumber())
50 - Integer.parseInt(((BambooBuildAdapterIdea) o1).getBuildNumber());
51 }
52 };
53 }
54
55 public int getPrefferedWidth() {
56 return COL_WIDTH;
57 }
58 }