1 package org.apache.maven.continuum.web.view;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.continuum.project.ContinuumProjectState;
23 import org.apache.maven.continuum.web.model.GroupSummary;
24 import org.apache.maven.continuum.web.util.StateGenerator;
25 import org.extremecomponents.table.bean.Column;
26 import org.extremecomponents.table.cell.DisplayCell;
27 import org.extremecomponents.table.core.TableModel;
28
29
30
31
32
33
34
35 public class BuildStatusCell
36 extends DisplayCell
37 {
38 protected String getCellValue( TableModel tableModel, Column column )
39 {
40 GroupSummary group = (GroupSummary) tableModel.getCurrentRowBean();
41
42 String success = StateGenerator.generate( ContinuumProjectState.OK, tableModel.getContext().getContextPath() );
43
44 String failed = StateGenerator.generate( ContinuumProjectState.FAILED,
45 tableModel.getContext().getContextPath() );
46
47 String error = StateGenerator.generate( ContinuumProjectState.ERROR, tableModel.getContext().getContextPath() );
48
49 StringBuffer cellContent = new StringBuffer();
50 cellContent.append( success );
51 cellContent.append( " " );
52 cellContent.append( group.getNumSuccesses() );
53 cellContent.append( " " );
54 cellContent.append( failed );
55 cellContent.append( " " );
56 cellContent.append( group.getNumFailures() );
57 cellContent.append( " " );
58 cellContent.append( error );
59 cellContent.append( " " );
60 cellContent.append( group.getNumErrors() );
61
62 return cellContent.toString();
63 }
64 }