1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.sys.document.web.renderers;
17
18 import java.io.IOException;
19
20 import javax.servlet.jsp.JspException;
21 import javax.servlet.jsp.JspWriter;
22 import javax.servlet.jsp.PageContext;
23 import javax.servlet.jsp.tagext.Tag;
24
25 import org.kuali.ole.sys.document.web.AccountingLineTableRow;
26
27
28
29
30 public class TableRowRenderer implements Renderer {
31 private AccountingLineTableRow row;
32
33
34
35
36
37 public void clear() {
38 row = null;
39 }
40
41
42
43
44
45 public void render(PageContext pageContext, Tag parentTag) throws JspException {
46 JspWriter out = pageContext.getOut();
47 try {
48 if (row.getChildCellCount() > 0) {
49 out.write(buildBeginningRowTag());
50 row.renderChildrenCells(pageContext, parentTag);
51 out.write(buildEndingRowTag());
52 }
53 }
54 catch (IOException ioe) {
55 throw new JspException("Could not render table row", ioe);
56 }
57 }
58
59
60
61
62
63 protected String buildBeginningRowTag() {
64 return "<tr>";
65 }
66
67
68
69
70
71 protected String buildEndingRowTag() {
72 return "</tr>";
73 }
74
75
76
77
78
79 public AccountingLineTableRow getRow() {
80 return row;
81 }
82
83
84
85
86
87 public void setRow(AccountingLineTableRow row) {
88 this.row = row;
89 }
90 }