author | bpatel |
Wed, 21 Sep 2016 18:18:50 -0700 | |
changeset 41157 | b235a429089a |
parent 40587 | 1c355ea550ed |
child 41452 | ddaef4bba083 |
permissions | -rw-r--r-- |
36526 | 1 |
/* |
2 |
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
package jdk.javadoc.internal.doclets.formats.html; |
|
27 |
||
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
28 |
import java.util.ArrayList; |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
29 |
import java.util.EnumMap; |
36526 | 30 |
import java.util.List; |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
31 |
import java.util.Map; |
36526 | 32 |
|
33 |
import javax.lang.model.element.ModuleElement; |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
34 |
import javax.lang.model.element.ModuleElement.DirectiveKind; |
36526 | 35 |
import javax.lang.model.element.PackageElement; |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
36 |
import javax.lang.model.element.TypeElement; |
36526 | 37 |
|
38 |
import com.sun.source.doctree.DocTree; |
|
39 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants; |
|
40 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
|
41 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
|
42 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
|
43 |
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml; |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
44 |
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
36526 | 45 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
46 |
import jdk.javadoc.internal.doclets.toolkit.ModuleSummaryWriter; |
|
47 |
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper; |
|
40587 | 48 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; |
36526 | 49 |
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
50 |
||
51 |
/** |
|
52 |
* Class to generate file for each module contents in the right-hand |
|
53 |
* frame. This will list all the packages and Class Kinds in the module. A click on any |
|
54 |
* class-kind will update the frame with the clicked class-kind page. A click on any |
|
55 |
* package will update the frame with the clicked module package page. |
|
56 |
* |
|
57 |
* <p><b>This is NOT part of any supported API. |
|
58 |
* If you write code that depends on this, you do so at your own risk. |
|
59 |
* This code and its internal interfaces are subject to change or |
|
60 |
* deletion without notice.</b> |
|
61 |
* |
|
62 |
* @author Bhavesh Patel |
|
63 |
*/ |
|
64 |
public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryWriter { |
|
65 |
||
66 |
/** |
|
67 |
* The prev module name in the alpha-order list. |
|
68 |
*/ |
|
69 |
protected ModuleElement prevModule; |
|
70 |
||
71 |
/** |
|
72 |
* The next module name in the alpha-order list. |
|
73 |
*/ |
|
74 |
protected ModuleElement nextModule; |
|
75 |
||
76 |
/** |
|
77 |
* The module being documented. |
|
78 |
*/ |
|
79 |
protected ModuleElement mdle; |
|
80 |
||
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
81 |
private final Map<ModuleElement.DirectiveKind, List<ModuleElement.Directive>> directiveMap |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
82 |
= new EnumMap<>(ModuleElement.DirectiveKind.class); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
83 |
|
36526 | 84 |
/** |
85 |
* The HTML tree for main tag. |
|
86 |
*/ |
|
87 |
protected HtmlTree mainTree = HtmlTree.MAIN(); |
|
88 |
||
89 |
/** |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
90 |
* The HTML tree for section tag. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
91 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
92 |
protected HtmlTree sectionTree = HtmlTree.SECTION(); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
93 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
94 |
/** |
36526 | 95 |
* Constructor to construct ModuleWriter object and to generate |
96 |
* "moduleName-summary.html" file. |
|
97 |
* |
|
98 |
* @param configuration the configuration of the doclet. |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
99 |
* @param mdle Module under consideration. |
36526 | 100 |
* @param prevModule Previous module in the sorted array. |
101 |
* @param nextModule Next module in the sorted array. |
|
102 |
*/ |
|
103 |
public ModuleWriterImpl(ConfigurationImpl configuration, |
|
40303 | 104 |
ModuleElement mdle, ModuleElement prevModule, ModuleElement nextModule) { |
36526 | 105 |
super(configuration, DocPaths.moduleSummary(mdle)); |
106 |
this.prevModule = prevModule; |
|
107 |
this.nextModule = nextModule; |
|
108 |
this.mdle = mdle; |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
109 |
generateDirectiveMap(); |
36526 | 110 |
} |
111 |
||
112 |
/** |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
113 |
* Get the module header. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
114 |
* |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
115 |
* @param heading the heading for the section |
36526 | 116 |
*/ |
117 |
public Content getModuleHeader(String heading) { |
|
118 |
HtmlTree bodyTree = getBody(true, getWindowTitle(mdle.getQualifiedName().toString())); |
|
119 |
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) |
|
120 |
? HtmlTree.HEADER() |
|
121 |
: bodyTree; |
|
122 |
addTop(htmlTree); |
|
123 |
addNavLinks(true, htmlTree); |
|
124 |
if (configuration.allowTag(HtmlTag.HEADER)) { |
|
125 |
bodyTree.addContent(htmlTree); |
|
126 |
} |
|
127 |
HtmlTree div = new HtmlTree(HtmlTag.DIV); |
|
128 |
div.addStyle(HtmlStyle.header); |
|
129 |
Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, |
|
40303 | 130 |
HtmlStyle.title, contents.moduleLabel); |
131 |
tHeading.addContent(Contents.SPACE); |
|
36526 | 132 |
Content moduleHead = new RawHtml(heading); |
133 |
tHeading.addContent(moduleHead); |
|
134 |
div.addContent(tHeading); |
|
135 |
if (configuration.allowTag(HtmlTag.MAIN)) { |
|
136 |
mainTree.addContent(div); |
|
137 |
} else { |
|
138 |
bodyTree.addContent(div); |
|
139 |
} |
|
140 |
return bodyTree; |
|
141 |
} |
|
142 |
||
143 |
/** |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
144 |
* Get the content header. |
36526 | 145 |
*/ |
146 |
public Content getContentHeader() { |
|
147 |
HtmlTree div = new HtmlTree(HtmlTag.DIV); |
|
148 |
div.addStyle(HtmlStyle.contentContainer); |
|
149 |
return div; |
|
150 |
} |
|
151 |
||
152 |
/** |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
153 |
* Get the summary section header. |
36526 | 154 |
*/ |
155 |
public Content getSummaryHeader() { |
|
156 |
HtmlTree li = new HtmlTree(HtmlTag.LI); |
|
157 |
li.addStyle(HtmlStyle.blockList); |
|
158 |
return li; |
|
159 |
} |
|
160 |
||
161 |
/** |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
162 |
* Get the summary tree. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
163 |
* |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
164 |
* @param summaryContentTree the content tree to be added to the summary tree. |
36526 | 165 |
*/ |
166 |
public Content getSummaryTree(Content summaryContentTree) { |
|
167 |
HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, summaryContentTree); |
|
168 |
return ul; |
|
169 |
} |
|
170 |
||
171 |
/** |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
172 |
* Generate the directive map for the directives on the module. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
173 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
174 |
public void generateDirectiveMap() { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
175 |
for (ModuleElement.Directive d : mdle.getDirectives()) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
176 |
if (directiveMap.containsKey(d.getKind())) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
177 |
List<ModuleElement.Directive> dir = directiveMap.get(d.getKind()); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
178 |
dir.add(d); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
179 |
directiveMap.put(d.getKind(), dir); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
180 |
} else { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
181 |
List<ModuleElement.Directive> dir = new ArrayList<>(); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
182 |
dir.add(d); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
183 |
directiveMap.put(d.getKind(), dir); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
184 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
185 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
186 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
187 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
188 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
189 |
* Add the summary header. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
190 |
* |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
191 |
* @param startMarker the marker comment |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
192 |
* @param markerAnchor the marker anchor for the section |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
193 |
* @param heading the heading for the section |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
194 |
* @param htmltree the content tree to which the information is added |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
195 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
196 |
public void addSummaryHeader(Content startMarker, SectionName markerAnchor, Content heading, Content htmltree) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
197 |
htmltree.addContent(startMarker); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
198 |
htmltree.addContent(getMarkerAnchor(markerAnchor)); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
199 |
htmltree.addContent(HtmlTree.HEADING(HtmlTag.H3, heading)); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
200 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
201 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
202 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
203 |
* Add the summary for the module. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
204 |
* |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
205 |
* @param text the table caption |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
206 |
* @param tableSummary the summary for the table |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
207 |
* @param htmltree the content tree to which the table will be added |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
208 |
* @param tableStyle the table style |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
209 |
* @param tableHeader the table header |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
210 |
* @param dirs the list of module directives |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
211 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
212 |
public void addSummary(String text, String tableSummary, Content htmltree, HtmlStyle tableStyle, |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
213 |
List<String> tableHeader, List<ModuleElement.Directive> dirs) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
214 |
Content table = (configuration.isOutputHtml5()) |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
215 |
? HtmlTree.TABLE(tableStyle, getTableCaption(new RawHtml(text))) |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
216 |
: HtmlTree.TABLE(tableStyle, tableSummary, getTableCaption(new RawHtml(text))); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
217 |
table.addContent(getSummaryTableHeader(tableHeader, "col")); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
218 |
Content tbody = new HtmlTree(HtmlTag.TBODY); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
219 |
addList(dirs, tbody); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
220 |
table.addContent(tbody); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
221 |
htmltree.addContent(table); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
222 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
223 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
224 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
225 |
* Add the list of directives for the module. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
226 |
* |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
227 |
* @param dirs the list of module directives |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
228 |
* @params tbody the content tree to which the list is added |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
229 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
230 |
public void addList(List<ModuleElement.Directive> dirs, Content tbody) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
231 |
boolean altColor = true; |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
232 |
for (ModuleElement.Directive direct : dirs) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
233 |
DirectiveKind kind = direct.getKind(); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
234 |
switch (kind) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
235 |
case REQUIRES: |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
236 |
addRequiresList((ModuleElement.RequiresDirective) direct, tbody, altColor); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
237 |
break; |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
238 |
case EXPORTS: |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
239 |
addExportedPackagesList((ModuleElement.ExportsDirective) direct, tbody, altColor); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
240 |
break; |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
241 |
case USES: |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
242 |
addUsesList((ModuleElement.UsesDirective) direct, tbody, altColor); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
243 |
break; |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
244 |
case PROVIDES: |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
245 |
addProvidesList((ModuleElement.ProvidesDirective) direct, tbody, altColor); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
246 |
break; |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
247 |
default: |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
248 |
throw new AssertionError("unknown directive kind: " + kind); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
249 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
250 |
altColor = !altColor; |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
251 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
252 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
253 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
254 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
255 |
* {@inheritDoc} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
256 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
257 |
public void addModulesSummary(Content summaryContentTree) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
258 |
List<ModuleElement.Directive> dirs = directiveMap.get(DirectiveKind.REQUIRES); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
259 |
if (dirs != null && !dirs.isEmpty()) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
260 |
HtmlTree li = new HtmlTree(HtmlTag.LI); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
261 |
li.addStyle(HtmlStyle.blockList); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
262 |
addSummaryHeader(HtmlConstants.START_OF_MODULES_SUMMARY, SectionName.MODULES, |
40303 | 263 |
contents.navModules, li); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
264 |
String text = configuration.getText("doclet.Requires_Summary"); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
265 |
String tableSummary = configuration.getText("doclet.Member_Table_Summary", |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
266 |
configuration.getText("doclet.Requires_Summary"), |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
267 |
configuration.getText("doclet.modules")); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
268 |
addRequiresSummary(text, tableSummary, dirs, li); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
269 |
HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
270 |
summaryContentTree.addContent(ul); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
271 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
272 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
273 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
274 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
275 |
* Add the requires summary for the module. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
276 |
* |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
277 |
* @param text the table caption |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
278 |
* @param tableSummary the summary for the table |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
279 |
* @param dirs the list of module directives |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
280 |
* @param htmltree the content tree to which the table will be added |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
281 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
282 |
public void addRequiresSummary(String text, String tableSummary, List<ModuleElement.Directive> dirs, |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
283 |
Content htmltree) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
284 |
addSummary(text, tableSummary, htmltree, HtmlStyle.requiresSummary, requiresTableHeader, dirs); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
285 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
286 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
287 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
288 |
* Add the requires directive list for the module. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
289 |
* |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
290 |
* @param direct the requires directive |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
291 |
* @param tbody the content tree to which the directive will be added |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
292 |
* @param altColor true if altColor style should be used or false if rowColor style should be used |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
293 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
294 |
public void addRequiresList(ModuleElement.RequiresDirective direct, Content tbody, boolean altColor) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
295 |
ModuleElement m = direct.getDependency(); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
296 |
Content moduleLinkContent = getModuleLink(m, new StringContent(m.getQualifiedName().toString())); |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
297 |
Content thPackage = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, moduleLinkContent); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
298 |
HtmlTree tdSummary = new HtmlTree(HtmlTag.TD); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
299 |
tdSummary.addStyle(HtmlStyle.colLast); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
300 |
addSummaryComment(m, tdSummary); |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
301 |
HtmlTree tr = HtmlTree.TR(thPackage); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
302 |
tr.addContent(tdSummary); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
303 |
tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
304 |
tbody.addContent(tr); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
305 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
306 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
307 |
/** |
36526 | 308 |
* {@inheritDoc} |
309 |
*/ |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
310 |
public void addPackagesSummary(Content summaryContentTree) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
311 |
List<ModuleElement.Directive> dirs = directiveMap.get(DirectiveKind.EXPORTS); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
312 |
if (dirs != null && !dirs.isEmpty()) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
313 |
HtmlTree li = new HtmlTree(HtmlTag.LI); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
314 |
li.addStyle(HtmlStyle.blockList); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
315 |
addSummaryHeader(HtmlConstants.START_OF_PACKAGES_SUMMARY, SectionName.PACKAGES, |
40303 | 316 |
contents.navPackages, li); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
317 |
String text = configuration.getText("doclet.Exported_Packages_Summary"); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
318 |
String tableSummary = configuration.getText("doclet.Member_Table_Summary", |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
319 |
configuration.getText("doclet.Exported_Packages_Summary"), |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
320 |
configuration.getText("doclet.packages")); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
321 |
addExportedPackagesSummary(text, tableSummary, dirs, li); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
322 |
HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
323 |
summaryContentTree.addContent(ul); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
324 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
325 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
326 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
327 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
328 |
* Add the exported packages summary for the module. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
329 |
* |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
330 |
* @param text the table caption |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
331 |
* @param tableSummary the summary for the table |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
332 |
* @param dirs the list of module directives |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
333 |
* @param htmltree the content tree to which the table will be added |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
334 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
335 |
public void addExportedPackagesSummary(String text, String tableSummary, List<ModuleElement.Directive> dirs, |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
336 |
Content htmltree) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
337 |
addSummary(text, tableSummary, htmltree, HtmlStyle.packagesSummary, exportedPackagesTableHeader, dirs); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
338 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
339 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
340 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
341 |
* Add the exported packages list for the module. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
342 |
* |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
343 |
* @param direct the requires directive |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
344 |
* @param tbody the content tree to which the directive will be added |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
345 |
* @param altColor true if altColor style should be used or false if rowColor style should be used |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
346 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
347 |
public void addExportedPackagesList(ModuleElement.ExportsDirective direct, Content tbody, boolean altColor) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
348 |
PackageElement pkg = direct.getPackage(); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
349 |
Content pkgLinkContent = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg))); |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
350 |
Content tdPackage = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, pkgLinkContent); |
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
351 |
HtmlTree thModules = new HtmlTree(HtmlTag.TD); |
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
352 |
thModules.addStyle(HtmlStyle.colSecond); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
353 |
List<? extends ModuleElement> targetModules = direct.getTargetModules(); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
354 |
if (targetModules != null) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
355 |
List<? extends ModuleElement> mElements = direct.getTargetModules(); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
356 |
for (int i = 0; i < mElements.size(); i++) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
357 |
if (i > 0) { |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
358 |
thModules.addContent(new HtmlTree(HtmlTag.BR)); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
359 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
360 |
ModuleElement m = mElements.get(i); |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
361 |
thModules.addContent(new StringContent(m.getQualifiedName().toString())); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
362 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
363 |
} else { |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
364 |
thModules.addContent(configuration.getText("doclet.All_Modules")); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
365 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
366 |
HtmlTree tdSummary = new HtmlTree(HtmlTag.TD); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
367 |
tdSummary.addStyle(HtmlStyle.colLast); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
368 |
addSummaryComment(pkg, tdSummary); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
369 |
HtmlTree tr = HtmlTree.TR(tdPackage); |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
370 |
tr.addContent(thModules); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
371 |
tr.addContent(tdSummary); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
372 |
tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
373 |
tbody.addContent(tr); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
374 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
375 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
376 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
377 |
* {@inheritDoc} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
378 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
379 |
public void addServicesSummary(Content summaryContentTree) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
380 |
List<ModuleElement.Directive> usesDirs = directiveMap.get(DirectiveKind.USES); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
381 |
List<ModuleElement.Directive> providesDirs = directiveMap.get(DirectiveKind.PROVIDES); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
382 |
if ((usesDirs != null && !usesDirs.isEmpty()) || (providesDirs != null && !providesDirs.isEmpty())) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
383 |
HtmlTree li = new HtmlTree(HtmlTag.LI); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
384 |
li.addStyle(HtmlStyle.blockList); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
385 |
addSummaryHeader(HtmlConstants.START_OF_SERVICES_SUMMARY, SectionName.SERVICES, |
40303 | 386 |
contents.navServices, li); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
387 |
String text; |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
388 |
String tableSummary; |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
389 |
if (usesDirs != null && !usesDirs.isEmpty()) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
390 |
text = configuration.getText("doclet.Uses_Summary"); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
391 |
tableSummary = configuration.getText("doclet.Member_Table_Summary", |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
392 |
configuration.getText("doclet.Uses_Summary"), |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
393 |
configuration.getText("doclet.types")); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
394 |
addUsesSummary(text, tableSummary, usesDirs, li); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
395 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
396 |
if (providesDirs != null && !providesDirs.isEmpty()) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
397 |
text = configuration.getText("doclet.Provides_Summary"); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
398 |
tableSummary = configuration.getText("doclet.Member_Table_Summary", |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
399 |
configuration.getText("doclet.Provides_Summary"), |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
400 |
configuration.getText("doclet.types")); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
401 |
addProvidesSummary(text, tableSummary, providesDirs, li); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
402 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
403 |
HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
404 |
summaryContentTree.addContent(ul); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
405 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
406 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
407 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
408 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
409 |
* Add the uses summary for the module. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
410 |
* |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
411 |
* @param text the table caption |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
412 |
* @param tableSummary the summary for the table |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
413 |
* @param dirs the list of module directives |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
414 |
* @param htmltree the content tree to which the table will be added |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
415 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
416 |
public void addUsesSummary(String text, String tableSummary, List<ModuleElement.Directive> dirs, |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
417 |
Content htmltree) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
418 |
addSummary(text, tableSummary, htmltree, HtmlStyle.usesSummary, usesTableHeader, dirs); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
419 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
420 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
421 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
422 |
* Add the uses list for the module. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
423 |
* |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
424 |
* @param direct the requires directive |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
425 |
* @param tbody the content tree to which the directive will be added |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
426 |
* @param altColor true if altColor style should be used or false if rowColor style should be used |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
427 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
428 |
public void addUsesList(ModuleElement.UsesDirective direct, Content tbody, boolean altColor) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
429 |
TypeElement type = direct.getService(); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
430 |
Content typeLinkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE, type)); |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
431 |
Content thPackage = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, typeLinkContent); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
432 |
HtmlTree tdSummary = new HtmlTree(HtmlTag.TD); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
433 |
tdSummary.addStyle(HtmlStyle.colLast); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
434 |
addSummaryComment(type, tdSummary); |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
435 |
HtmlTree tr = HtmlTree.TR(thPackage); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
436 |
tr.addContent(tdSummary); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
437 |
tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
438 |
tbody.addContent(tr); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
439 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
440 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
441 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
442 |
* Add the provides summary for the module. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
443 |
* |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
444 |
* @param text the table caption |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
445 |
* @param tableSummary the summary for the table |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
446 |
* @param dirs the list of module directives |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
447 |
* @param htmltree the content tree to which the table will be added |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
448 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
449 |
public void addProvidesSummary(String text, String tableSummary, List<ModuleElement.Directive> dirs, |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
450 |
Content htmltree) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
451 |
addSummary(text, tableSummary, htmltree, HtmlStyle.providesSummary, providesTableHeader, dirs); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
452 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
453 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
454 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
455 |
* Add the exported packages list for the module. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
456 |
* |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
457 |
* @param direct the requires directive |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
458 |
* @param tbody the content tree to which the directive will be added |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
459 |
* @param altColor true if altColor style should be used or false if rowColor style should be used |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
460 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
461 |
public void addProvidesList(ModuleElement.ProvidesDirective direct, Content tbody, boolean altColor) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
462 |
TypeElement impl = direct.getImplementation(); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
463 |
TypeElement srv = direct.getService(); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
464 |
Content implLinkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE, impl)); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
465 |
Content srvLinkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE, srv)); |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
466 |
HtmlTree thType = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, srvLinkContent); |
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
467 |
thType.addContent(new HtmlTree(HtmlTag.BR)); |
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
468 |
thType.addContent("("); |
40303 | 469 |
HtmlTree implSpan = HtmlTree.SPAN(HtmlStyle.implementationLabel, contents.implementation); |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
470 |
thType.addContent(implSpan); |
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
471 |
thType.addContent(Contents.SPACE); |
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
472 |
thType.addContent(implLinkContent); |
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
473 |
thType.addContent(")"); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
474 |
HtmlTree tdDesc = new HtmlTree(HtmlTag.TD); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
475 |
tdDesc.addStyle(HtmlStyle.colLast); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
476 |
addSummaryComment(srv, tdDesc); |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
477 |
HtmlTree tr = HtmlTree.TR(thType); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
478 |
tr.addContent(tdDesc); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
479 |
tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
480 |
tbody.addContent(tr); |
36526 | 481 |
} |
482 |
||
483 |
/** |
|
37747
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
484 |
* {@inheritDoc} |
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
485 |
*/ |
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
486 |
public void addModuleDescription(Content moduleContentTree) { |
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
487 |
if (!utils.getBody(mdle).isEmpty()) { |
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
488 |
Content tree = configuration.allowTag(HtmlTag.SECTION) ? HtmlTree.SECTION() : moduleContentTree; |
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
489 |
tree.addContent(HtmlConstants.START_OF_MODULE_DESCRIPTION); |
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
490 |
tree.addContent(getMarkerAnchor(SectionName.MODULE_DESCRIPTION)); |
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
491 |
addInlineComment(mdle, tree); |
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
492 |
if (configuration.allowTag(HtmlTag.SECTION)) { |
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
493 |
moduleContentTree.addContent(tree); |
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
494 |
} |
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
495 |
} |
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
496 |
} |
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
497 |
|
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
498 |
/** |
38911
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
499 |
* {@inheritDoc} |
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
500 |
*/ |
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
501 |
public void addModuleTags(Content moduleContentTree) { |
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
502 |
Content tree = (configuration.allowTag(HtmlTag.SECTION)) |
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
503 |
? HtmlTree.SECTION() |
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
504 |
: moduleContentTree; |
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
505 |
addTagsInfo(mdle, tree); |
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
506 |
if (configuration.allowTag(HtmlTag.SECTION)) { |
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
507 |
moduleContentTree.addContent(tree); |
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
508 |
} |
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
509 |
} |
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
510 |
|
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
511 |
/** |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
512 |
* Add summary details to the navigation bar. |
36526 | 513 |
* |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
514 |
* @param subDiv the content tree to which the summary detail links will be added |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
515 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
516 |
protected void addSummaryDetailLinks(Content subDiv) { |
40587 | 517 |
Content div = HtmlTree.DIV(getNavSummaryLinks()); |
518 |
subDiv.addContent(div); |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
519 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
520 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
521 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
522 |
* Get summary links for navigation bar. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
523 |
* |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
524 |
* @return the content tree for the navigation summary links |
36526 | 525 |
*/ |
40587 | 526 |
protected Content getNavSummaryLinks() { |
40303 | 527 |
Content li = HtmlTree.LI(contents.moduleSubNavLabel); |
528 |
li.addContent(Contents.SPACE); |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
529 |
Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
530 |
Content liNav = new HtmlTree(HtmlTag.LI); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
531 |
liNav.addContent(!utils.getBody(mdle).isEmpty() && !configuration.nocomment |
40303 | 532 |
? getHyperLink(SectionName.MODULE_DESCRIPTION, contents.navModuleDescription) |
533 |
: contents.navModuleDescription); |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
534 |
addNavGap(liNav); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
535 |
liNav.addContent(showDirectives(DirectiveKind.REQUIRES) |
40303 | 536 |
? getHyperLink(SectionName.MODULES, contents.navModules) |
537 |
: contents.navModules); |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
538 |
addNavGap(liNav); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
539 |
liNav.addContent(showDirectives(DirectiveKind.EXPORTS) |
40303 | 540 |
? getHyperLink(SectionName.PACKAGES, contents.navPackages) |
541 |
: contents.navPackages); |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
542 |
addNavGap(liNav); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
543 |
liNav.addContent((showDirectives(DirectiveKind.USES) || showDirectives(DirectiveKind.PROVIDES)) |
40303 | 544 |
? getHyperLink(SectionName.SERVICES, contents.navServices) |
545 |
: contents.navServices); |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
546 |
ulNav.addContent(liNav); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
547 |
return ulNav; |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
548 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
549 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
550 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
551 |
* Return true if the directive should be displayed. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
552 |
* |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
553 |
* @param dirKind the kind of directive for the module |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
554 |
* @return true if the directive should be displayed |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
555 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
556 |
private boolean showDirectives(DirectiveKind dirKind) { |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
557 |
return directiveMap.get(dirKind) != null && !directiveMap.get(dirKind).isEmpty(); |
36526 | 558 |
} |
559 |
||
560 |
/** |
|
561 |
* {@inheritDoc} |
|
562 |
*/ |
|
563 |
public void addModuleContent(Content contentTree, Content moduleContentTree) { |
|
564 |
if (configuration.allowTag(HtmlTag.MAIN)) { |
|
565 |
mainTree.addContent(moduleContentTree); |
|
566 |
contentTree.addContent(mainTree); |
|
567 |
} else { |
|
568 |
contentTree.addContent(moduleContentTree); |
|
569 |
} |
|
570 |
} |
|
571 |
||
572 |
/** |
|
573 |
* {@inheritDoc} |
|
574 |
*/ |
|
575 |
public void addModuleFooter(Content contentTree) { |
|
576 |
Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) |
|
577 |
? HtmlTree.FOOTER() |
|
578 |
: contentTree; |
|
579 |
addNavLinks(false, htmlTree); |
|
580 |
addBottom(htmlTree); |
|
581 |
if (configuration.allowTag(HtmlTag.FOOTER)) { |
|
582 |
contentTree.addContent(htmlTree); |
|
583 |
} |
|
584 |
} |
|
585 |
||
586 |
/** |
|
587 |
* {@inheritDoc} |
|
588 |
*/ |
|
40587 | 589 |
@Override |
590 |
public void printDocument(Content contentTree) throws DocFileIOException { |
|
36526 | 591 |
printHtmlDocument(configuration.metakeywords.getMetaKeywordsForModule(mdle), |
592 |
true, contentTree); |
|
593 |
} |
|
594 |
||
595 |
/** |
|
596 |
* Add the module package deprecation information to the documentation tree. |
|
597 |
* |
|
598 |
* @param li the content tree to which the deprecation information will be added |
|
599 |
* @param pkg the PackageDoc that is added |
|
600 |
*/ |
|
601 |
public void addPackageDeprecationInfo(Content li, PackageElement pkg) { |
|
602 |
List<? extends DocTree> deprs; |
|
603 |
if (utils.isDeprecated(pkg)) { |
|
604 |
deprs = utils.getDeprecatedTrees(pkg); |
|
605 |
HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV); |
|
606 |
deprDiv.addStyle(HtmlStyle.deprecatedContent); |
|
40303 | 607 |
Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, contents.deprecatedPhrase); |
36526 | 608 |
deprDiv.addContent(deprPhrase); |
609 |
if (!deprs.isEmpty()) { |
|
610 |
CommentHelper ch = utils.getCommentHelper(pkg); |
|
611 |
List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0)); |
|
612 |
if (!commentTags.isEmpty()) { |
|
613 |
addInlineDeprecatedComment(pkg, deprs.get(0), deprDiv); |
|
614 |
} |
|
615 |
} |
|
616 |
li.addContent(deprDiv); |
|
617 |
} |
|
618 |
} |
|
619 |
||
620 |
/** |
|
37943
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
37747
diff
changeset
|
621 |
* Get this module link. |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
37747
diff
changeset
|
622 |
* |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
37747
diff
changeset
|
623 |
* @return a content tree for the module link |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
37747
diff
changeset
|
624 |
*/ |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
37747
diff
changeset
|
625 |
@Override |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
37747
diff
changeset
|
626 |
protected Content getNavLinkModule() { |
40303 | 627 |
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.moduleLabel); |
37943
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
37747
diff
changeset
|
628 |
return li; |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
37747
diff
changeset
|
629 |
} |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
37747
diff
changeset
|
630 |
|
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
37747
diff
changeset
|
631 |
/** |
36526 | 632 |
* Get "PREV MODULE" link in the navigation bar. |
633 |
* |
|
634 |
* @return a content tree for the previous link |
|
635 |
*/ |
|
636 |
public Content getNavLinkPrevious() { |
|
637 |
Content li; |
|
638 |
if (prevModule == null) { |
|
40303 | 639 |
li = HtmlTree.LI(contents.prevModuleLabel); |
36526 | 640 |
} else { |
641 |
li = HtmlTree.LI(getHyperLink(pathToRoot.resolve(DocPaths.moduleSummary( |
|
40303 | 642 |
prevModule)), contents.prevModuleLabel, "", "")); |
36526 | 643 |
} |
644 |
return li; |
|
645 |
} |
|
646 |
||
647 |
/** |
|
648 |
* Get "NEXT MODULE" link in the navigation bar. |
|
649 |
* |
|
650 |
* @return a content tree for the next link |
|
651 |
*/ |
|
652 |
public Content getNavLinkNext() { |
|
653 |
Content li; |
|
654 |
if (nextModule == null) { |
|
40303 | 655 |
li = HtmlTree.LI(contents.nextModuleLabel); |
36526 | 656 |
} else { |
657 |
li = HtmlTree.LI(getHyperLink(pathToRoot.resolve(DocPaths.moduleSummary( |
|
40303 | 658 |
nextModule)), contents.nextModuleLabel, "", "")); |
36526 | 659 |
} |
660 |
return li; |
|
661 |
} |
|
662 |
} |