75 /** |
76 /** |
76 * Get the summary table. |
77 * Get the summary table. |
77 * |
78 * |
78 * @param mw the writer for the member being documented |
79 * @param mw the writer for the member being documented |
79 * @param cd the classdoc to be documented |
80 * @param cd the classdoc to be documented |
|
81 * @param tableContents list of summary table contents |
|
82 * @param showTabs true if the table needs to show tabs |
80 * @return the content tree for the summary table |
83 * @return the content tree for the summary table |
81 */ |
84 */ |
82 public Content getSummaryTableTree(AbstractMemberWriter mw, ClassDoc cd) { |
85 public Content getSummaryTableTree(AbstractMemberWriter mw, ClassDoc cd, |
|
86 List<Content> tableContents, boolean showTabs) { |
|
87 Content caption; |
|
88 if (showTabs) { |
|
89 caption = getTableCaption(mw.methodTypes); |
|
90 generateMethodTypesScript(mw.typeMap, mw.methodTypes); |
|
91 } |
|
92 else { |
|
93 caption = getTableCaption(mw.getCaption()); |
|
94 } |
83 Content table = HtmlTree.TABLE(HtmlStyle.overviewSummary, 0, 3, 0, |
95 Content table = HtmlTree.TABLE(HtmlStyle.overviewSummary, 0, 3, 0, |
84 mw.getTableSummary(), getTableCaption(mw.getCaption())); |
96 mw.getTableSummary(), caption); |
85 table.addContent(getSummaryTableHeader(mw.getSummaryTableHeader(cd), "col")); |
97 table.addContent(getSummaryTableHeader(mw.getSummaryTableHeader(cd), "col")); |
|
98 for (int i = 0; i < tableContents.size(); i++) { |
|
99 table.addContent(tableContents.get(i)); |
|
100 } |
86 return table; |
101 return table; |
|
102 } |
|
103 |
|
104 /** |
|
105 * Get the summary table caption. |
|
106 * |
|
107 * @param methodTypes set comprising of method types to show as table caption |
|
108 * @return the caption for the summary table |
|
109 */ |
|
110 public Content getTableCaption(Set<MethodTypes> methodTypes) { |
|
111 Content tabbedCaption = new HtmlTree(HtmlTag.CAPTION); |
|
112 for (MethodTypes type : methodTypes) { |
|
113 Content captionSpan; |
|
114 Content span; |
|
115 if (type.isDefaultTab()) { |
|
116 captionSpan = HtmlTree.SPAN(new StringContent(type.text())); |
|
117 span = HtmlTree.SPAN(type.tabId(), |
|
118 HtmlStyle.activeTableTab, captionSpan); |
|
119 } else { |
|
120 captionSpan = HtmlTree.SPAN(getMethodTypeLinks(type)); |
|
121 span = HtmlTree.SPAN(type.tabId(), |
|
122 HtmlStyle.tableTab, captionSpan); |
|
123 } |
|
124 Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, getSpace()); |
|
125 span.addContent(tabSpan); |
|
126 tabbedCaption.addContent(span); |
|
127 } |
|
128 return tabbedCaption; |
|
129 } |
|
130 |
|
131 /** |
|
132 * Get the method type links for the table caption. |
|
133 * |
|
134 * @param methodType the method type to be displayed as link |
|
135 * @return the content tree for the method type link |
|
136 */ |
|
137 public Content getMethodTypeLinks(MethodTypes methodType) { |
|
138 StringBuilder jsShow = new StringBuilder("javascript:show("); |
|
139 jsShow.append(methodType.value()).append(");"); |
|
140 HtmlTree link = HtmlTree.A(jsShow.toString(), |
|
141 new StringContent(methodType.text())); |
|
142 return link; |
87 } |
143 } |
88 |
144 |
89 /** |
145 /** |
90 * Add the inherited summary header. |
146 * Add the inherited summary header. |
91 * |
147 * |