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.AccountingLineTable;
26
27
28
29
30 public class TableRenderer implements Renderer {
31 AccountingLineTable table;
32
33
34
35
36
37 public void clear() {
38 table = 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 out.write(buildBeginningTableTag());
49 table.renderChildrenRows(pageContext, parentTag);
50 out.write(buildEndingTableTag());
51 }
52 catch (IOException ioe) {
53 throw new JspException("Difficulty with rendering inner table", ioe);
54 }
55 }
56
57
58
59
60
61 protected String buildBeginningTableTag() {
62 return "<table class=\"datatable\">";
63 }
64
65
66
67
68
69 protected String buildEndingTableTag() {
70 return "</table>";
71 }
72
73
74
75
76
77 public AccountingLineTable getTable() {
78 return table;
79 }
80
81
82
83
84
85 public void setTable(AccountingLineTable table) {
86 this.table = table;
87 }
88 }