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.reportmodel;
24
25 import net.sf.statcvs.Messages;
26 import net.sf.statcvs.model.VersionedFile;
27 import net.sf.statcvs.output.WebRepositoryIntegration;
28 import net.sf.statcvs.renderer.TableCellRenderer;
29
30 /**
31 * A table column containing files
32 *
33 * @author Richard Cyganiak <rcyg@gmx.de>
34 * @version $Id: FileColumn.java,v 1.5 2008/04/02 11:22:14 benoitx Exp $
35 */
36 public class FileColumn extends GenericColumn {
37 private WebRepositoryIntegration webRepository;
38 private boolean withIcon = false;
39
40 /**
41 * Creates a new directory column
42 */
43 public FileColumn() {
44 super(Messages.getString("COLUMN_FILE"));
45 }
46
47 /**
48 * @see net.sf.statcvs.reportmodel.Column#renderCell
49 */
50 public void renderCell(final int rowIndex, final TableCellRenderer renderer) {
51 renderer.renderFileCell((VersionedFile) getValue(rowIndex), this.withIcon, this.webRepository);
52 }
53
54 /**
55 * Specifies if each cell should be rendered with an icon representing
56 * the file
57 * @param withIcon render with icon?
58 */
59 public void setWithIcon(final boolean withIcon) {
60 this.withIcon = withIcon;
61 }
62
63 /**
64 * Setting a WebRepository turns filenames into links to that file.
65 */
66 public void setWebRepository(final WebRepositoryIntegration webRepository) {
67 this.webRepository = webRepository;
68 }
69 }