1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package net.sf.statcvs.renderer;
24
25 import net.sf.statcvs.model.Author;
26 import net.sf.statcvs.model.Directory;
27 import net.sf.statcvs.model.VersionedFile;
28 import net.sf.statcvs.output.WebRepositoryIntegration;
29
30 /**
31 * Interface for a class that turns {@link net.sf.statcvs.reportmodel.Column}s
32 * into their representation for some output format, for example a HTML
33 * <td> or an XML element.
34 *
35 * @author Richard Cyganiak <rcyg@gmx.de>
36 * @version $Id: TableCellRenderer.java,v 1.11 2008/04/02 11:22:15 benoitx Exp $
37 */
38 public interface TableCellRenderer {
39
40 /**
41 * Render a generic table cell
42 * @param content the cell's content
43 */
44 void renderCell(String content);
45
46 /**
47 * Render an empty cell
48 */
49 void renderEmptyCell();
50
51 /**
52 * Render an integer cell
53 * @param value the cell's content
54 */
55 void renderIntegerCell(int value);
56
57 /**
58 * Render an integer cell, showing both the integer value and
59 * a percentage of a total
60 * @param value the cell's content
61 * @param total the total, worth 100%
62 */
63 void renderIntegerCell(int value, int total);
64
65 /**
66 * Render a percentage cell
67 * @param ratio the cell's content
68 */
69 void renderPercentageCell(double ratio);
70
71 /**
72 * Render a cell containing an author
73 * @param author the author
74 */
75
76 void renderAuthorCell(Author author);
77
78 /**
79 * Render a cell containing an author Id
80 * @param author the author
81 */
82
83 void renderAuthorIdCell(Author author);
84
85 /**
86 * Render a cell containing a directory
87 * @param directory the directory
88 */
89 void renderDirectoryCell(Directory directory);
90
91 /**
92 * Render a cell containing a file
93 * @param file the file
94 * @param withIcon display an icon in front of the filename?
95 * @param webRepository for creating links; might be <tt>null</tt>
96 */
97 void renderFileCell(VersionedFile file, boolean withIcon, WebRepositoryIntegration webRepository);
98
99 /**
100 * Render a cell containing a link.
101 */
102 void renderLinkCell(String url, String label);
103 }