author | jjg |
Thu, 21 Feb 2019 14:03:57 -0800 | |
changeset 53879 | e7cb0348fa1c |
parent 53863 | d001808c57e8 |
child 53880 | 3f1e9372557f |
permissions | -rw-r--r-- |
36526 | 1 |
/* |
53863
d001808c57e8
8218998: Add metadata to generated API documentation files
jjg
parents:
53562
diff
changeset
|
2 |
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. |
36526 | 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 |
||
47846 | 28 |
import jdk.javadoc.internal.doclets.formats.html.markup.Table; |
29 |
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader; |
|
30 |
||
31 |
import java.util.ArrayList; |
|
44293
2f47b2c16612
8176778: javadoc does not produce summary pages for aggregated modules
ksrini
parents:
42831
diff
changeset
|
32 |
import java.util.Collections; |
36526 | 33 |
import java.util.List; |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
34 |
import java.util.Map; |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
35 |
import java.util.Set; |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
36 |
import java.util.SortedSet; |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
37 |
import java.util.TreeMap; |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
38 |
import java.util.TreeSet; |
36526 | 39 |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
40 |
import javax.lang.model.element.Element; |
36526 | 41 |
import javax.lang.model.element.ModuleElement; |
42 |
import javax.lang.model.element.PackageElement; |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
43 |
import javax.lang.model.element.TypeElement; |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
44 |
import javax.lang.model.util.ElementFilter; |
36526 | 45 |
|
46 |
import com.sun.source.doctree.DocTree; |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
47 |
import jdk.javadoc.doclet.DocletEnvironment.ModuleMode; |
47846 | 48 |
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; |
36526 | 49 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
50 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
|
51 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
|
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
52 |
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation; |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
53 |
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode; |
36526 | 54 |
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
|
55 |
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
36526 | 56 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
57 |
import jdk.javadoc.internal.doclets.toolkit.ModuleSummaryWriter; |
|
58 |
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper; |
|
40587 | 59 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; |
36526 | 60 |
|
61 |
/** |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
62 |
* Class to generate file for each module contents in the right-hand frame. This will list all the |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
63 |
* required modules, packages and service types for the module. A click on any of the links will update |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
64 |
* the frame with the clicked element page. |
36526 | 65 |
* |
66 |
* <p><b>This is NOT part of any supported API. |
|
67 |
* If you write code that depends on this, you do so at your own risk. |
|
68 |
* This code and its internal interfaces are subject to change or |
|
69 |
* deletion without notice.</b> |
|
70 |
* |
|
71 |
* @author Bhavesh Patel |
|
72 |
*/ |
|
73 |
public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryWriter { |
|
74 |
||
75 |
/** |
|
76 |
* The module being documented. |
|
77 |
*/ |
|
78 |
protected ModuleElement mdle; |
|
79 |
||
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
80 |
/** |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
81 |
* The module mode for this javadoc run. It can be set to "api" or "all". |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
82 |
*/ |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
83 |
private final ModuleMode moduleMode; |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
84 |
|
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
85 |
/** |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
86 |
* Map of module elements and modifiers required by this module. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
87 |
*/ |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
88 |
private final Map<ModuleElement, Content> requires |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
89 |
= new TreeMap<>(utils.makeModuleComparator()); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
90 |
|
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
91 |
/** |
44564 | 92 |
* Map of indirect modules and modifiers, transitive closure, required by this module. |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
93 |
*/ |
44564 | 94 |
private final Map<ModuleElement, Content> indirectModules |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
95 |
= new TreeMap<>(utils.makeModuleComparator()); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
96 |
|
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
97 |
/** |
48325 | 98 |
* Details about a package in a module. |
99 |
* A package may be not exported, or exported to some modules, or exported to all modules. |
|
100 |
* A package may be not opened, or opened to some modules, or opened to all modules. |
|
101 |
* A package that is neither exported or opened to any modules is a concealed package. |
|
102 |
* An open module opens all its packages to all modules. |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
103 |
*/ |
48325 | 104 |
class PackageEntry { |
105 |
/** |
|
106 |
* Summary of package exports: |
|
107 |
* If null, the package is not exported to any modules; |
|
108 |
* if empty, the package is exported to all modules; |
|
109 |
* otherwise, the package is exported to these modules. |
|
110 |
*/ |
|
111 |
Set<ModuleElement> exportedTo; |
|
112 |
||
113 |
/** |
|
114 |
* Summary of package opens: |
|
115 |
* If null, the package is not opened to any modules; |
|
116 |
* if empty, the package is opened to all modules; |
|
117 |
* otherwise, the package is opened to these modules. |
|
118 |
*/ |
|
119 |
Set<ModuleElement> openedTo; |
|
120 |
} |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
121 |
|
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
122 |
/** |
48325 | 123 |
* Map of packages of this module, and details of whether they are exported or opened. |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
124 |
*/ |
48325 | 125 |
private final Map<PackageElement, PackageEntry> packages = new TreeMap<>(utils.makePackageComparator()); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
126 |
|
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
127 |
/** |
44564 | 128 |
* Map of indirect modules (transitive closure) and their exported packages. |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
129 |
*/ |
44564 | 130 |
private final Map<ModuleElement, SortedSet<PackageElement>> indirectPackages |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
131 |
= new TreeMap<>(utils.makeModuleComparator()); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
132 |
|
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
133 |
/** |
44564 | 134 |
* Map of indirect modules (transitive closure) and their open packages. |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
135 |
*/ |
44564 | 136 |
private final Map<ModuleElement, SortedSet<PackageElement>> indirectOpenPackages |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
137 |
= new TreeMap<>(utils.makeModuleComparator()); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
138 |
|
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
139 |
/** |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
140 |
* Set of services used by the module. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
141 |
*/ |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
142 |
private final SortedSet<TypeElement> uses |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
143 |
= new TreeSet<>(utils.makeAllClassesComparator()); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
144 |
|
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
145 |
/** |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
146 |
* Map of services used by the module and specified using @uses javadoc tag, and description. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
147 |
*/ |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
148 |
private final Map<TypeElement, Content> usesTrees |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
149 |
= new TreeMap<>(utils.makeAllClassesComparator()); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
150 |
|
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
151 |
/** |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
152 |
* Map of services provided by this module, and set of its implementations. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
153 |
*/ |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
154 |
private final Map<TypeElement, SortedSet<TypeElement>> provides |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
155 |
= new TreeMap<>(utils.makeAllClassesComparator()); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
156 |
|
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
157 |
/** |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
158 |
* Map of services provided by the module and specified using @provides javadoc tag, and |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
159 |
* description. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
160 |
*/ |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
161 |
private final Map<TypeElement, Content> providesTrees |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
162 |
= new TreeMap<>(utils.makeAllClassesComparator()); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
163 |
|
36526 | 164 |
/** |
165 |
* The HTML tree for main tag. |
|
166 |
*/ |
|
167 |
protected HtmlTree mainTree = HtmlTree.MAIN(); |
|
168 |
||
169 |
/** |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
170 |
* The HTML tree for section tag. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
171 |
*/ |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
172 |
protected HtmlTree sectionTree = HtmlTree.SECTION(); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
173 |
|
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
174 |
private final Navigation navBar; |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
175 |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
176 |
/** |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
177 |
* Constructor to construct ModuleWriter object and to generate "moduleName-summary.html" file. |
36526 | 178 |
* |
179 |
* @param configuration the configuration of the doclet. |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
180 |
* @param mdle Module under consideration. |
36526 | 181 |
*/ |
48756
ce608a09a666
8196027: Remove "Prev" and "Next" links from the javadoc navigation
bpatel
parents:
48654
diff
changeset
|
182 |
public ModuleWriterImpl(HtmlConfiguration configuration, ModuleElement mdle) { |
48759
ffa68af7da87
8195795: Organize output files by module/package, not just package
jjg
parents:
48756
diff
changeset
|
183 |
super(configuration, configuration.docPaths.moduleSummary(mdle)); |
36526 | 184 |
this.mdle = mdle; |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
185 |
this.moduleMode = configuration.docEnv.getModuleMode(); |
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
186 |
this.navBar = new Navigation(mdle, configuration, fixedNavDiv, PageMode.MODULE, path); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
187 |
computeModulesData(); |
36526 | 188 |
} |
189 |
||
190 |
/** |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
191 |
* Get the module header. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
192 |
* |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
193 |
* @param heading the heading for the section |
36526 | 194 |
*/ |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
195 |
@Override |
36526 | 196 |
public Content getModuleHeader(String heading) { |
197 |
HtmlTree bodyTree = getBody(true, getWindowTitle(mdle.getQualifiedName().toString())); |
|
53562 | 198 |
HtmlTree htmlTree = HtmlTree.HEADER(); |
36526 | 199 |
addTop(htmlTree); |
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
200 |
navBar.setDisplaySummaryModuleDescLink(!utils.getFullBody(mdle).isEmpty() && !configuration.nocomment); |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
201 |
navBar.setDisplaySummaryModulesLink(display(requires) || display(indirectModules)); |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
202 |
navBar.setDisplaySummaryPackagesLink(display(packages) || display(indirectPackages) |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
203 |
|| display(indirectOpenPackages)); |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
204 |
navBar.setDisplaySummaryServicesLink(displayServices(uses, usesTrees) || displayServices(provides.keySet(), providesTrees)); |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
205 |
navBar.setUserHeader(getUserHeaderFooter(true)); |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
206 |
htmlTree.addContent(navBar.getContent(true)); |
53562 | 207 |
bodyTree.addContent(htmlTree); |
36526 | 208 |
HtmlTree div = new HtmlTree(HtmlTag.DIV); |
47846 | 209 |
div.setStyle(HtmlStyle.header); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
210 |
Content annotationContent = new HtmlTree(HtmlTag.P); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
211 |
addAnnotationInfo(mdle, annotationContent); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
212 |
div.addContent(annotationContent); |
44564 | 213 |
Content label = mdle.isOpen() && (configuration.docEnv.getModuleMode() == ModuleMode.ALL) |
214 |
? contents.openModuleLabel : contents.moduleLabel; |
|
53879 | 215 |
Content tHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, |
44564 | 216 |
HtmlStyle.title, label); |
40303 | 217 |
tHeading.addContent(Contents.SPACE); |
36526 | 218 |
Content moduleHead = new RawHtml(heading); |
219 |
tHeading.addContent(moduleHead); |
|
220 |
div.addContent(tHeading); |
|
53562 | 221 |
mainTree.addContent(div); |
36526 | 222 |
return bodyTree; |
223 |
} |
|
224 |
||
225 |
/** |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
226 |
* Get the content header. |
36526 | 227 |
*/ |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
228 |
@Override |
36526 | 229 |
public Content getContentHeader() { |
230 |
HtmlTree div = new HtmlTree(HtmlTag.DIV); |
|
47846 | 231 |
div.setStyle(HtmlStyle.contentContainer); |
36526 | 232 |
return div; |
233 |
} |
|
234 |
||
235 |
/** |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
236 |
* Get the summary section header. |
36526 | 237 |
*/ |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
238 |
@Override |
36526 | 239 |
public Content getSummaryHeader() { |
240 |
HtmlTree li = new HtmlTree(HtmlTag.LI); |
|
47846 | 241 |
li.setStyle(HtmlStyle.blockList); |
36526 | 242 |
return li; |
243 |
} |
|
244 |
||
245 |
/** |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
246 |
* Get the summary tree. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
247 |
* |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
248 |
* @param summaryContentTree the content tree to be added to the summary tree. |
36526 | 249 |
*/ |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
250 |
@Override |
36526 | 251 |
public Content getSummaryTree(Content summaryContentTree) { |
252 |
HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, summaryContentTree); |
|
253 |
return ul; |
|
254 |
} |
|
255 |
||
256 |
/** |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
257 |
* Compute the modules data that will be displayed in various tables on the module summary page. |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
258 |
*/ |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
259 |
public void computeModulesData() { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
260 |
CommentHelper ch = utils.getCommentHelper(mdle); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
261 |
// Get module dependencies using the module's transitive closure. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
262 |
Map<ModuleElement, String> dependentModules = utils.getDependentModules(mdle); |
44564 | 263 |
// Add all dependent modules to indirect modules set. We will remove the modules, |
264 |
// listed using the requires directive, from this set to come up with the table of indirect |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
265 |
// required modules. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
266 |
dependentModules.forEach((module, mod) -> { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
267 |
if (shouldDocument(module)) { |
44564 | 268 |
indirectModules.put(module, new StringContent(mod)); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
269 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
270 |
}); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
271 |
(ElementFilter.requiresIn(mdle.getDirectives())).forEach((directive) -> { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
272 |
ModuleElement m = directive.getDependency(); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
273 |
if (shouldDocument(m)) { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
274 |
if (moduleMode == ModuleMode.ALL || directive.isTransitive()) { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
275 |
requires.put(m, new StringContent(utils.getModifiers(directive))); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
276 |
} else { |
44564 | 277 |
// For api mode, just keep the public requires in dependentModules for display of |
278 |
// indirect packages in the "Packages" section. |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
279 |
dependentModules.remove(m); |
44564 | 280 |
} |
281 |
indirectModules.remove(m); |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
282 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
283 |
}); |
44293
2f47b2c16612
8176778: javadoc does not produce summary pages for aggregated modules
ksrini
parents:
42831
diff
changeset
|
284 |
|
48325 | 285 |
// Get all packages if module is open or if displaying concealed modules |
286 |
for (PackageElement pkg : utils.getModulePackageMap().getOrDefault(mdle, Collections.emptySet())) { |
|
287 |
if (shouldDocument(pkg) && (mdle.isOpen() || moduleMode == ModuleMode.ALL)) { |
|
288 |
PackageEntry e = new PackageEntry(); |
|
289 |
if (mdle.isOpen()) { |
|
290 |
e.openedTo = Collections.emptySet(); |
|
291 |
} |
|
292 |
packages.put(pkg, e); |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
293 |
} |
48325 | 294 |
}; |
44293
2f47b2c16612
8176778: javadoc does not produce summary pages for aggregated modules
ksrini
parents:
42831
diff
changeset
|
295 |
|
48325 | 296 |
// Get all exported packages for the module, using the exports directive for the module. |
297 |
for (ModuleElement.ExportsDirective directive : ElementFilter.exportsIn(mdle.getDirectives())) { |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
298 |
PackageElement p = directive.getPackage(); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
299 |
if (shouldDocument(p)) { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
300 |
List<? extends ModuleElement> targetMdles = directive.getTargetModules(); |
48325 | 301 |
// Include package if in details mode, or exported to all (i.e. targetModules == null) |
302 |
if (moduleMode == ModuleMode.ALL || targetMdles == null) { |
|
303 |
PackageEntry packageEntry = packages.computeIfAbsent(p, pkg -> new PackageEntry()); |
|
304 |
SortedSet<ModuleElement> mdleList = new TreeSet<>(utils.makeModuleComparator()); |
|
305 |
if (targetMdles != null) { |
|
306 |
mdleList.addAll(targetMdles); |
|
307 |
} |
|
308 |
packageEntry.exportedTo = mdleList; |
|
44689
53c703004306
8175823: doclet crashes when documenting a single class in a module.
bpatel
parents:
44684
diff
changeset
|
309 |
} |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
310 |
} |
48325 | 311 |
} |
312 |
||
313 |
// Get all opened packages for the module, using the opens directive for the module. |
|
314 |
// If it is an open module, there will be no separate opens directives. |
|
315 |
for (ModuleElement.OpensDirective directive : ElementFilter.opensIn(mdle.getDirectives())) { |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
316 |
PackageElement p = directive.getPackage(); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
317 |
if (shouldDocument(p)) { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
318 |
List<? extends ModuleElement> targetMdles = directive.getTargetModules(); |
48325 | 319 |
// Include package if in details mode, or opened to all (i.e. targetModules == null) |
320 |
if (moduleMode == ModuleMode.ALL || targetMdles == null) { |
|
321 |
PackageEntry packageEntry = packages.computeIfAbsent(p, pkg -> new PackageEntry()); |
|
322 |
SortedSet<ModuleElement> mdleList = new TreeSet<>(utils.makeModuleComparator()); |
|
323 |
if (targetMdles != null) { |
|
324 |
mdleList.addAll(targetMdles); |
|
325 |
} |
|
326 |
packageEntry.openedTo = mdleList; |
|
44689
53c703004306
8175823: doclet crashes when documenting a single class in a module.
bpatel
parents:
44684
diff
changeset
|
327 |
} |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
328 |
} |
48325 | 329 |
} |
330 |
||
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
331 |
// Get all the exported and opened packages, for the transitive closure of the module, to be displayed in |
44564 | 332 |
// the indirect packages tables. |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
333 |
dependentModules.forEach((module, mod) -> { |
44807
47e09e3f1829
8178339: javadoc includes qualified opens in "Additional Opened Packages" section
ksrini
parents:
44689
diff
changeset
|
334 |
SortedSet<PackageElement> exportPkgList = new TreeSet<>(utils.makePackageComparator()); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
335 |
(ElementFilter.exportsIn(module.getDirectives())).forEach((directive) -> { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
336 |
PackageElement pkg = directive.getPackage(); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
337 |
if (shouldDocument(pkg)) { |
44807
47e09e3f1829
8178339: javadoc includes qualified opens in "Additional Opened Packages" section
ksrini
parents:
44689
diff
changeset
|
338 |
// Qualified exports are not displayed in API mode |
47e09e3f1829
8178339: javadoc includes qualified opens in "Additional Opened Packages" section
ksrini
parents:
44689
diff
changeset
|
339 |
if (moduleMode == ModuleMode.ALL || directive.getTargetModules() == null) { |
47e09e3f1829
8178339: javadoc includes qualified opens in "Additional Opened Packages" section
ksrini
parents:
44689
diff
changeset
|
340 |
exportPkgList.add(pkg); |
47e09e3f1829
8178339: javadoc includes qualified opens in "Additional Opened Packages" section
ksrini
parents:
44689
diff
changeset
|
341 |
} |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
342 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
343 |
}); |
44807
47e09e3f1829
8178339: javadoc includes qualified opens in "Additional Opened Packages" section
ksrini
parents:
44689
diff
changeset
|
344 |
// If none of the indirect modules have exported packages to be displayed, we should not be |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
345 |
// displaying the table and so it should not be added to the map. |
44807
47e09e3f1829
8178339: javadoc includes qualified opens in "Additional Opened Packages" section
ksrini
parents:
44689
diff
changeset
|
346 |
if (!exportPkgList.isEmpty()) { |
47e09e3f1829
8178339: javadoc includes qualified opens in "Additional Opened Packages" section
ksrini
parents:
44689
diff
changeset
|
347 |
indirectPackages.put(module, exportPkgList); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
348 |
} |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
349 |
SortedSet<PackageElement> openPkgList = new TreeSet<>(utils.makePackageComparator()); |
48325 | 350 |
if (module.isOpen()) { |
351 |
openPkgList.addAll(utils.getModulePackageMap().getOrDefault(module, Collections.emptySet())); |
|
352 |
} else { |
|
353 |
(ElementFilter.opensIn(module.getDirectives())).forEach((directive) -> { |
|
354 |
PackageElement pkg = directive.getPackage(); |
|
355 |
if (shouldDocument(pkg)) { |
|
356 |
// Qualified opens are not displayed in API mode |
|
357 |
if (moduleMode == ModuleMode.ALL || directive.getTargetModules() == null) { |
|
358 |
openPkgList.add(pkg); |
|
359 |
} |
|
44807
47e09e3f1829
8178339: javadoc includes qualified opens in "Additional Opened Packages" section
ksrini
parents:
44689
diff
changeset
|
360 |
} |
48325 | 361 |
}); |
362 |
} |
|
44807
47e09e3f1829
8178339: javadoc includes qualified opens in "Additional Opened Packages" section
ksrini
parents:
44689
diff
changeset
|
363 |
// If none of the indirect modules have opened packages to be displayed, we should not be |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
364 |
// displaying the table and so it should not be added to the map. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
365 |
if (!openPkgList.isEmpty()) { |
44564 | 366 |
indirectOpenPackages.put(module, openPkgList); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
367 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
368 |
}); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
369 |
// Get all the services listed as uses directive. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
370 |
(ElementFilter.usesIn(mdle.getDirectives())).forEach((directive) -> { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
371 |
TypeElement u = directive.getService(); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
372 |
if (shouldDocument(u)) { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
373 |
uses.add(u); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
374 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
375 |
}); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
376 |
// Get all the services and implementations listed as provides directive. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
377 |
(ElementFilter.providesIn(mdle.getDirectives())).forEach((directive) -> { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
378 |
TypeElement u = directive.getService(); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
379 |
if (shouldDocument(u)) { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
380 |
List<? extends TypeElement> implList = directive.getImplementations(); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
381 |
SortedSet<TypeElement> implSet = new TreeSet<>(utils.makeAllClassesComparator()); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
382 |
implSet.addAll(implList); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
383 |
provides.put(u, implSet); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
384 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
385 |
}); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
386 |
// Generate the map of all services listed using @provides, and the description. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
387 |
(utils.getBlockTags(mdle, DocTree.Kind.PROVIDES)).forEach((tree) -> { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
388 |
TypeElement t = ch.getServiceType(configuration, tree); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
389 |
if (t != null) { |
51862 | 390 |
providesTrees.put(t, commentTagsToContent(tree, mdle, ch.getDescription(configuration, tree), false, true)); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
391 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
392 |
}); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
393 |
// Generate the map of all services listed using @uses, and the description. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
394 |
(utils.getBlockTags(mdle, DocTree.Kind.USES)).forEach((tree) -> { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
395 |
TypeElement t = ch.getServiceType(configuration, tree); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
396 |
if (t != null) { |
51862 | 397 |
usesTrees.put(t, commentTagsToContent(tree, mdle, ch.getDescription(configuration, tree), false, true)); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
398 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
399 |
}); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
400 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
401 |
|
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
402 |
/** |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
403 |
* Returns true if the element should be documented on the module summary page. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
404 |
* |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
405 |
* @param element the element to be checked |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
406 |
* @return true if the element should be documented |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
407 |
*/ |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
408 |
public boolean shouldDocument(Element element) { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
409 |
return (moduleMode == ModuleMode.ALL || utils.isIncluded(element)); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
410 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
411 |
|
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
412 |
/** |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
413 |
* Returns true if there are elements to be displayed. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
414 |
* |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
415 |
* @param section set of elements |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
416 |
* @return true if there are elements to be displayed |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
417 |
*/ |
44684
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
418 |
public boolean display(Set<? extends Element> section) { |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
419 |
return section != null && !section.isEmpty(); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
420 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
421 |
|
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
422 |
/** |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
423 |
* Returns true if there are elements to be displayed. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
424 |
* |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
425 |
* @param section map of elements. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
426 |
* @return true if there are elements to be displayed |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
427 |
*/ |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
428 |
public boolean display(Map<? extends Element, ?> section) { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
429 |
return section != null && !section.isEmpty(); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
430 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
431 |
|
44684
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
432 |
/* |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
433 |
* Returns true, in API mode, if at least one type element in |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
434 |
* the typeElements set is referenced by a javadoc tag in tagsMap. |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
435 |
*/ |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
436 |
private boolean displayServices(Set<TypeElement> typeElements, |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
437 |
Map<TypeElement, Content> tagsMap) { |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
438 |
return typeElements != null && |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
439 |
typeElements.stream().anyMatch((v) -> displayServiceDirective(v, tagsMap)); |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
440 |
} |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
441 |
|
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
442 |
/* |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
443 |
* Returns true, in API mode, if the type element is referenced |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
444 |
* from a javadoc tag in tagsMap. |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
445 |
*/ |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
446 |
private boolean displayServiceDirective(TypeElement typeElement, |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
447 |
Map<TypeElement, Content> tagsMap) { |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
448 |
return moduleMode == ModuleMode.ALL || tagsMap.containsKey(typeElement); |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
449 |
} |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
450 |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
451 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
452 |
* Add the summary header. |
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 |
* @param startMarker the marker comment |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
455 |
* @param markerAnchor the marker anchor for the section |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
456 |
* @param heading the heading for the section |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
457 |
* @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
|
458 |
*/ |
47427 | 459 |
public void addSummaryHeader(Content startMarker, SectionName markerAnchor, Content heading, |
460 |
Content htmltree) { |
|
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
461 |
htmltree.addContent(startMarker); |
47850 | 462 |
htmltree.addContent(links.createAnchor(markerAnchor)); |
53879 | 463 |
htmltree.addContent(HtmlTree.HEADING(Headings.ModuleDeclaration.SUMMARY_HEADING, heading)); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
464 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
465 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
466 |
/** |
47846 | 467 |
* Get a table, with two columns. |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
468 |
* |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
469 |
* @param caption the table caption |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
470 |
* @param tableStyle the table style |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
471 |
* @param tableHeader the table header |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
472 |
* @return a content object |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
473 |
*/ |
53562 | 474 |
private Table getTable2(Content caption, HtmlStyle tableStyle, |
47427 | 475 |
TableHeader tableHeader) { |
53562 | 476 |
return new Table(tableStyle) |
47846 | 477 |
.setCaption(caption) |
478 |
.setHeader(tableHeader) |
|
479 |
.setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); |
|
480 |
} |
|
481 |
||
482 |
/** |
|
483 |
* Get a table, with three columns, with the second column being the defining column. |
|
484 |
* |
|
485 |
* @param caption the table caption |
|
486 |
* @param tableSummary the summary for the table |
|
487 |
* @param tableStyle the table style |
|
488 |
* @param tableHeader the table header |
|
489 |
* @return a content object |
|
490 |
*/ |
|
491 |
private Table getTable3(Content caption, String tableSummary, HtmlStyle tableStyle, |
|
492 |
TableHeader tableHeader) { |
|
53562 | 493 |
return new Table(tableStyle) |
47846 | 494 |
.setCaption(caption) |
495 |
.setHeader(tableHeader) |
|
496 |
.setRowScopeColumn(1) |
|
497 |
.setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast); |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
498 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
499 |
|
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
500 |
/** |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
501 |
* {@inheritDoc} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
502 |
*/ |
47427 | 503 |
@Override |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
504 |
public void addModulesSummary(Content summaryContentTree) { |
44564 | 505 |
if (display(requires) || display(indirectModules)) { |
47427 | 506 |
TableHeader requiresTableHeader = |
507 |
new TableHeader(contents.modifierLabel, contents.moduleLabel, |
|
508 |
contents.descriptionLabel); |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
509 |
HtmlTree li = new HtmlTree(HtmlTag.LI); |
47846 | 510 |
li.setStyle(HtmlStyle.blockList); |
53879 | 511 |
addSummaryHeader(MarkerComments.START_OF_MODULES_SUMMARY, SectionName.MODULES, |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
512 |
contents.navModules, li); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
513 |
if (display(requires)) { |
47846 | 514 |
String text = resources.getText("doclet.Requires_Summary"); |
515 |
String tableSummary = resources.getText("doclet.Member_Table_Summary", |
|
47427 | 516 |
text, |
47846 | 517 |
resources.getText("doclet.modules")); |
518 |
Content caption = getTableCaption(new StringContent(text)); |
|
519 |
Table table = getTable3(caption, tableSummary, HtmlStyle.requiresSummary, |
|
520 |
requiresTableHeader); |
|
521 |
addModulesList(requires, table); |
|
522 |
li.addContent(table.toContent()); |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
523 |
} |
44564 | 524 |
// Display indirect modules table in both "api" and "all" mode. |
525 |
if (display(indirectModules)) { |
|
47846 | 526 |
String amrText = resources.getText("doclet.Indirect_Requires_Summary"); |
527 |
String amrTableSummary = resources.getText("doclet.Member_Table_Summary", |
|
47427 | 528 |
amrText, |
52644
43efb4ca6d6c
8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents:
51862
diff
changeset
|
529 |
resources.getText("doclet.modules")); |
47846 | 530 |
Content amrCaption = getTableCaption(new StringContent(amrText)); |
531 |
Table amrTable = getTable3(amrCaption, amrTableSummary, HtmlStyle.requiresSummary, |
|
532 |
requiresTableHeader); |
|
533 |
addModulesList(indirectModules, amrTable); |
|
534 |
li.addContent(amrTable.toContent()); |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
535 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
536 |
HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
537 |
summaryContentTree.addContent(ul); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
538 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
539 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
540 |
|
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
541 |
/** |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
542 |
* Add the list of modules. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
543 |
* |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
544 |
* @param mdleMap map of modules and modifiers |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
545 |
* @param tbody the content tree to which the list will be added |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
546 |
*/ |
47846 | 547 |
private void addModulesList(Map<ModuleElement, Content> mdleMap, Table table) { |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
548 |
for (ModuleElement m : mdleMap.keySet()) { |
47846 | 549 |
Content modifiers = mdleMap.get(m); |
550 |
Content moduleLink = getModuleLink(m, new StringContent(m.getQualifiedName())); |
|
551 |
Content moduleSummary = new ContentBuilder(); |
|
552 |
addSummaryComment(m, moduleSummary); |
|
553 |
table.addRow(modifiers, moduleLink, moduleSummary); |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
554 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
555 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
556 |
|
47427 | 557 |
@Override |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
558 |
public void addPackagesSummary(Content summaryContentTree) { |
48325 | 559 |
if (display(packages) |
44564 | 560 |
|| display(indirectPackages) || display(indirectOpenPackages)) { |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
561 |
HtmlTree li = new HtmlTree(HtmlTag.LI); |
47846 | 562 |
li.setStyle(HtmlStyle.blockList); |
53879 | 563 |
addSummaryHeader(MarkerComments.START_OF_PACKAGES_SUMMARY, SectionName.PACKAGES, |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
564 |
contents.navPackages, li); |
48325 | 565 |
if (display(packages)) { |
53562 | 566 |
addPackageSummary(li); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
567 |
} |
47427 | 568 |
TableHeader indirectPackagesHeader = |
569 |
new TableHeader(contents.fromLabel, contents.packagesLabel); |
|
44564 | 570 |
if (display(indirectPackages)) { |
47846 | 571 |
String aepText = resources.getText("doclet.Indirect_Exports_Summary"); |
53562 | 572 |
Table aepTable = getTable2(new StringContent(aepText), |
47846 | 573 |
HtmlStyle.packagesSummary, indirectPackagesHeader); |
574 |
addIndirectPackages(aepTable, indirectPackages); |
|
575 |
li.addContent(aepTable.toContent()); |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
576 |
} |
44564 | 577 |
if (display(indirectOpenPackages)) { |
47846 | 578 |
String aopText = resources.getText("doclet.Indirect_Opens_Summary"); |
53562 | 579 |
Table aopTable = getTable2(new StringContent(aopText), HtmlStyle.packagesSummary, |
580 |
indirectPackagesHeader); |
|
47846 | 581 |
addIndirectPackages(aopTable, indirectOpenPackages); |
582 |
li.addContent(aopTable.toContent()); |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
583 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
584 |
HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
585 |
summaryContentTree.addContent(ul); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
586 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
587 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
588 |
|
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
589 |
/** |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
590 |
* Add the package summary for the module. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
591 |
* |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
592 |
* @param li |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
593 |
*/ |
53562 | 594 |
public void addPackageSummary(HtmlTree li) { |
595 |
Table table = new Table(HtmlStyle.packagesSummary) |
|
47846 | 596 |
.setDefaultTab(resources.getText("doclet.All_Packages")) |
48325 | 597 |
.addTab(resources.getText("doclet.Exported_Packages_Summary"), this::isExported) |
598 |
.addTab(resources.getText("doclet.Opened_Packages_Summary"), this::isOpened) |
|
599 |
.addTab(resources.getText("doclet.Concealed_Packages_Summary"), this::isConcealed) |
|
50167
cc705c956798
8196201: Generate pages to list all classes and all packages in javadoc output
bpatel
parents:
49551
diff
changeset
|
600 |
.setTabScript(i -> String.format("show(%d);", i)); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
601 |
|
48325 | 602 |
// Determine whether to show the "Exported To" and "Opened To" columns, |
603 |
// based on whether such columns would provide "useful" info. |
|
604 |
int numExports = 0; |
|
605 |
int numUnqualifiedExports = 0; |
|
606 |
int numOpens = 0; |
|
607 |
int numUnqualifiedOpens = 0; |
|
608 |
||
609 |
for (PackageEntry e : packages.values()) { |
|
610 |
if (e.exportedTo != null) { |
|
611 |
numExports++; |
|
612 |
if (e.exportedTo.isEmpty()) { |
|
613 |
numUnqualifiedExports++; |
|
614 |
} |
|
615 |
} |
|
616 |
if (e.openedTo != null) { |
|
617 |
numOpens++; |
|
618 |
if (e.openedTo.isEmpty()) { |
|
619 |
numUnqualifiedOpens++; |
|
620 |
} |
|
621 |
} |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
622 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
623 |
|
48325 | 624 |
boolean showExportedTo = numExports > 0 && (numOpens > 0 || numUnqualifiedExports < packages.size()); |
625 |
boolean showOpenedTo = numOpens > 0 && (numExports > 0 || numUnqualifiedOpens < packages.size()); |
|
626 |
||
627 |
// Create the table header and column styles. |
|
628 |
List<Content> colHeaders = new ArrayList<>(); |
|
629 |
List<HtmlStyle> colStyles = new ArrayList<>(); |
|
630 |
colHeaders.add(contents.packageLabel); |
|
631 |
colStyles.add(HtmlStyle.colFirst); |
|
632 |
||
633 |
if (showExportedTo) { |
|
634 |
colHeaders.add(contents.exportedTo); |
|
635 |
colStyles.add(HtmlStyle.colSecond); |
|
636 |
} |
|
637 |
||
638 |
if (showOpenedTo) { |
|
639 |
colHeaders.add(contents.openedTo); |
|
640 |
colStyles.add(HtmlStyle.colSecond); |
|
641 |
} |
|
642 |
||
643 |
colHeaders.add(contents.descriptionLabel); |
|
644 |
colStyles.add(HtmlStyle.colLast); |
|
645 |
||
646 |
table.setHeader(new TableHeader(colHeaders).styles(colStyles)) |
|
647 |
.setColumnStyles(colStyles); |
|
648 |
||
649 |
// Add the table rows, based on the "packages" map. |
|
650 |
for (Map.Entry<PackageElement, PackageEntry> e : packages.entrySet()) { |
|
651 |
PackageElement pkg = e.getKey(); |
|
652 |
PackageEntry entry = e.getValue(); |
|
653 |
List<Content> row = new ArrayList<>(); |
|
654 |
Content pkgLinkContent = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg))); |
|
655 |
row.add(pkgLinkContent); |
|
656 |
||
657 |
if (showExportedTo) { |
|
658 |
row.add(getPackageExportOpensTo(entry.exportedTo)); |
|
659 |
} |
|
660 |
if (showOpenedTo) { |
|
661 |
row.add(getPackageExportOpensTo(entry.openedTo)); |
|
662 |
} |
|
663 |
Content summary = new ContentBuilder(); |
|
664 |
addSummaryComment(pkg, summary); |
|
665 |
row.add(summary); |
|
666 |
||
667 |
table.addRow(pkg, row); |
|
668 |
} |
|
669 |
||
47846 | 670 |
li.addContent(table.toContent()); |
671 |
if (table.needsScript()) { |
|
47847 | 672 |
mainBodyScript.append(table.getScript()); |
47846 | 673 |
} |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
674 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
675 |
|
48325 | 676 |
private boolean isExported(Element e) { |
677 |
PackageEntry entry = packages.get((PackageElement) e); |
|
678 |
return (entry != null) && (entry.exportedTo != null); |
|
679 |
} |
|
680 |
||
681 |
private boolean isOpened(Element e) { |
|
682 |
PackageEntry entry = packages.get((PackageElement) e); |
|
683 |
return (entry != null) && (entry.openedTo != null); |
|
684 |
} |
|
685 |
||
686 |
private boolean isConcealed(Element e) { |
|
687 |
PackageEntry entry = packages.get((PackageElement) e); |
|
688 |
return (entry != null) && (entry.exportedTo == null) && (entry.openedTo == null); |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
689 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
690 |
|
48325 | 691 |
private Content getPackageExportOpensTo(Set<ModuleElement> modules) { |
692 |
if (modules == null) { |
|
693 |
return new StringContent(resources.getText("doclet.None")); |
|
694 |
} else if (modules.isEmpty()) { |
|
695 |
return new StringContent(resources.getText("doclet.All_Modules")); |
|
696 |
} else { |
|
697 |
Content list = new ContentBuilder(); |
|
698 |
for (ModuleElement m : modules) { |
|
699 |
if (!list.isEmpty()) { |
|
700 |
list.addContent(new StringContent(", ")); |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
701 |
} |
48325 | 702 |
list.addContent(getModuleLink(m, new StringContent(m.getQualifiedName()))); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
703 |
} |
48325 | 704 |
return list; |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
705 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
706 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
707 |
|
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
708 |
/** |
44564 | 709 |
* Add the indirect packages for the module being documented. |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
710 |
* |
47846 | 711 |
* @param table the table to which the content rows will be added |
44564 | 712 |
* @param ip indirect packages to be added |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
713 |
*/ |
47846 | 714 |
public void addIndirectPackages(Table table, Map<ModuleElement, SortedSet<PackageElement>> ip) { |
44564 | 715 |
for (Map.Entry<ModuleElement, SortedSet<PackageElement>> entry : ip.entrySet()) { |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
716 |
ModuleElement m = entry.getKey(); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
717 |
SortedSet<PackageElement> pkgList = entry.getValue(); |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
718 |
Content moduleLinkContent = getModuleLink(m, new StringContent(m.getQualifiedName())); |
48325 | 719 |
Content list = new ContentBuilder(); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
720 |
String sep = ""; |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
721 |
for (PackageElement pkg : pkgList) { |
48325 | 722 |
list.addContent(sep); |
723 |
list.addContent(getPackageLink(pkg, new StringContent(utils.getPackageName(pkg)))); |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
724 |
sep = " "; |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
725 |
} |
48325 | 726 |
table.addRow(moduleLinkContent, list); |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
727 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
728 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
729 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
730 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
731 |
* {@inheritDoc} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
732 |
*/ |
47427 | 733 |
@Override |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
734 |
public void addServicesSummary(Content summaryContentTree) { |
44684
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
735 |
|
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
736 |
boolean haveUses = displayServices(uses, usesTrees); |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
737 |
boolean haveProvides = displayServices(provides.keySet(), providesTrees); |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
738 |
|
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
739 |
if (haveProvides || haveUses) { |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
740 |
HtmlTree li = new HtmlTree(HtmlTag.LI); |
47846 | 741 |
li.setStyle(HtmlStyle.blockList); |
53879 | 742 |
addSummaryHeader(MarkerComments.START_OF_SERVICES_SUMMARY, SectionName.SERVICES, |
40303 | 743 |
contents.navServices, li); |
47427 | 744 |
TableHeader usesProvidesTableHeader = |
745 |
new TableHeader(contents.typeLabel, contents.descriptionLabel); |
|
44684
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
746 |
if (haveProvides) { |
47427 | 747 |
String label = resources.getText("doclet.Provides_Summary"); |
53562 | 748 |
Table table = getTable2(new StringContent(label), HtmlStyle.providesSummary, |
47427 | 749 |
usesProvidesTableHeader); |
47846 | 750 |
addProvidesList(table); |
751 |
if (!table.isEmpty()) { |
|
752 |
li.addContent(table.toContent()); |
|
44564 | 753 |
} |
754 |
} |
|
44684
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
755 |
if (haveUses){ |
47427 | 756 |
String label = resources.getText("doclet.Uses_Summary"); |
53562 | 757 |
Table table = getTable2(new StringContent(label), HtmlStyle.usesSummary, |
47427 | 758 |
usesProvidesTableHeader); |
47846 | 759 |
addUsesList(table); |
760 |
if (!table.isEmpty()) { |
|
761 |
li.addContent(table.toContent()); |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
762 |
} |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
763 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
764 |
HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
765 |
summaryContentTree.addContent(ul); |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
766 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
767 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
768 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
769 |
/** |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
770 |
* Add the uses list for the module. |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
771 |
* |
47846 | 772 |
* @param table the table to which the services used will be added |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
773 |
*/ |
47846 | 774 |
public void addUsesList(Table table) { |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
775 |
Content typeLinkContent; |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
776 |
Content description; |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
777 |
for (TypeElement t : uses) { |
44684
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
778 |
if (!displayServiceDirective(t, usesTrees)) { |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
779 |
continue; |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
780 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
781 |
typeLinkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE, t)); |
47846 | 782 |
Content summary = new ContentBuilder(); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
783 |
if (display(usesTrees)) { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
784 |
description = usesTrees.get(t); |
48437
dd3b97564ed7
8192007: javadoc @uses and @provides tags in the modules documentation appears before the first-sentence summary of the service type.
bpatel
parents:
48325
diff
changeset
|
785 |
if (description != null && !description.isEmpty()) { |
dd3b97564ed7
8192007: javadoc @uses and @provides tags in the modules documentation appears before the first-sentence summary of the service type.
bpatel
parents:
48325
diff
changeset
|
786 |
summary.addContent(HtmlTree.DIV(HtmlStyle.block, description)); |
dd3b97564ed7
8192007: javadoc @uses and @provides tags in the modules documentation appears before the first-sentence summary of the service type.
bpatel
parents:
48325
diff
changeset
|
787 |
} else { |
dd3b97564ed7
8192007: javadoc @uses and @provides tags in the modules documentation appears before the first-sentence summary of the service type.
bpatel
parents:
48325
diff
changeset
|
788 |
addSummaryComment(t, summary); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
789 |
} |
48437
dd3b97564ed7
8192007: javadoc @uses and @provides tags in the modules documentation appears before the first-sentence summary of the service type.
bpatel
parents:
48325
diff
changeset
|
790 |
} else { |
dd3b97564ed7
8192007: javadoc @uses and @provides tags in the modules documentation appears before the first-sentence summary of the service type.
bpatel
parents:
48325
diff
changeset
|
791 |
summary.addContent(Contents.SPACE); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
792 |
} |
47846 | 793 |
table.addRow(typeLinkContent, summary); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
794 |
} |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
795 |
} |
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
796 |
|
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
797 |
/** |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
798 |
* Add the provides list for the module. |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
799 |
* |
47846 | 800 |
* @param table the table to which the services provided will be added |
39670
9d1eafbf29c6
8154261: Module summary page should display directives for the module
bpatel
parents:
38911
diff
changeset
|
801 |
*/ |
47846 | 802 |
public void addProvidesList(Table table) { |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
803 |
SortedSet<TypeElement> implSet; |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
804 |
Content description; |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
805 |
for (Map.Entry<TypeElement, SortedSet<TypeElement>> entry : provides.entrySet()) { |
44684
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
806 |
TypeElement srv = entry.getKey(); |
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
807 |
if (!displayServiceDirective(srv, providesTrees)) { |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
808 |
continue; |
44684
6ce4d52084e8
8178067: support for @uses/@provides tags is broken
ksrini
parents:
44564
diff
changeset
|
809 |
} |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
810 |
implSet = entry.getValue(); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
811 |
Content srvLinkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE, srv)); |
47846 | 812 |
Content desc = new ContentBuilder(); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
813 |
if (display(providesTrees)) { |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
814 |
description = providesTrees.get(srv); |
48437
dd3b97564ed7
8192007: javadoc @uses and @provides tags in the modules documentation appears before the first-sentence summary of the service type.
bpatel
parents:
48325
diff
changeset
|
815 |
desc.addContent((description != null && !description.isEmpty()) |
dd3b97564ed7
8192007: javadoc @uses and @provides tags in the modules documentation appears before the first-sentence summary of the service type.
bpatel
parents:
48325
diff
changeset
|
816 |
? HtmlTree.DIV(HtmlStyle.block, description) |
dd3b97564ed7
8192007: javadoc @uses and @provides tags in the modules documentation appears before the first-sentence summary of the service type.
bpatel
parents:
48325
diff
changeset
|
817 |
: Contents.SPACE); |
dd3b97564ed7
8192007: javadoc @uses and @provides tags in the modules documentation appears before the first-sentence summary of the service type.
bpatel
parents:
48325
diff
changeset
|
818 |
} else { |
dd3b97564ed7
8192007: javadoc @uses and @provides tags in the modules documentation appears before the first-sentence summary of the service type.
bpatel
parents:
48325
diff
changeset
|
819 |
desc.addContent(Contents.SPACE); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
820 |
} |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
821 |
// Only display the implementation details in the "all" mode. |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
822 |
if (moduleMode == ModuleMode.ALL && !implSet.isEmpty()) { |
47846 | 823 |
desc.addContent(new HtmlTree(HtmlTag.BR)); |
824 |
desc.addContent("("); |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
825 |
HtmlTree implSpan = HtmlTree.SPAN(HtmlStyle.implementationLabel, contents.implementation); |
47846 | 826 |
desc.addContent(implSpan); |
827 |
desc.addContent(Contents.SPACE); |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
828 |
String sep = ""; |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
829 |
for (TypeElement impl : implSet) { |
47846 | 830 |
desc.addContent(sep); |
831 |
desc.addContent(getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE, impl))); |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
832 |
sep = ", "; |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
833 |
} |
47846 | 834 |
desc.addContent(")"); |
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
835 |
} |
47846 | 836 |
table.addRow(srvLinkContent, desc); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
837 |
} |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
838 |
} |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
839 |
|
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
840 |
/** |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
841 |
* Add the module deprecation information to the documentation tree. |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
842 |
* |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
843 |
* @param div the content tree to which the deprecation information will be added |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
844 |
*/ |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
845 |
public void addDeprecationInfo(Content div) { |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
846 |
List<? extends DocTree> deprs = utils.getBlockTags(mdle, DocTree.Kind.DEPRECATED); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
847 |
if (utils.isDeprecated(mdle)) { |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
848 |
CommentHelper ch = utils.getCommentHelper(mdle); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
849 |
HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV); |
47846 | 850 |
deprDiv.setStyle(HtmlStyle.deprecationBlock); |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
851 |
Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(mdle)); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
852 |
deprDiv.addContent(deprPhrase); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
853 |
if (!deprs.isEmpty()) { |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
854 |
List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0)); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
855 |
if (!commentTags.isEmpty()) { |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
856 |
addInlineDeprecatedComment(mdle, deprs.get(0), deprDiv); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
857 |
} |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
858 |
} |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
859 |
div.addContent(deprDiv); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
860 |
} |
36526 | 861 |
} |
862 |
||
863 |
/** |
|
37747
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
864 |
* {@inheritDoc} |
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
865 |
*/ |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
866 |
@Override |
37747
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
867 |
public void addModuleDescription(Content moduleContentTree) { |
41452 | 868 |
if (!utils.getFullBody(mdle).isEmpty()) { |
53562 | 869 |
Content tree = HtmlTree.SECTION(); |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
870 |
addDeprecationInfo(tree); |
53879 | 871 |
tree.addContent(MarkerComments.START_OF_MODULE_DESCRIPTION); |
47850 | 872 |
tree.addContent(links.createAnchor(SectionName.MODULE_DESCRIPTION)); |
37747
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
873 |
addInlineComment(mdle, tree); |
53562 | 874 |
moduleContentTree.addContent(tree); |
37747
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
875 |
} |
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
876 |
} |
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
877 |
|
878801512393
8154119: Module summary page should display module description
bpatel
parents:
36526
diff
changeset
|
878 |
/** |
38911
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
879 |
* {@inheritDoc} |
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
880 |
*/ |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
881 |
@Override |
38911
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
882 |
public void addModuleTags(Content moduleContentTree) { |
53562 | 883 |
Content tree = HtmlTree.SECTION(); |
38911
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
884 |
addTagsInfo(mdle, tree); |
53562 | 885 |
moduleContentTree.addContent(tree); |
38911
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
886 |
} |
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
887 |
|
48a00b5ee366
8156077: Support javadoc tags in module documentation
bpatel
parents:
37943
diff
changeset
|
888 |
/** |
36526 | 889 |
* {@inheritDoc} |
890 |
*/ |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
891 |
@Override |
36526 | 892 |
public void addModuleContent(Content contentTree, Content moduleContentTree) { |
53562 | 893 |
mainTree.addContent(moduleContentTree); |
894 |
contentTree.addContent(mainTree); |
|
36526 | 895 |
} |
896 |
||
897 |
/** |
|
898 |
* {@inheritDoc} |
|
899 |
*/ |
|
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
41452
diff
changeset
|
900 |
@Override |
36526 | 901 |
public void addModuleFooter(Content contentTree) { |
53562 | 902 |
Content htmlTree = HtmlTree.FOOTER(); |
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
903 |
navBar.setUserFooter(getUserHeaderFooter(false)); |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48759
diff
changeset
|
904 |
htmlTree.addContent(navBar.getContent(false)); |
36526 | 905 |
addBottom(htmlTree); |
53562 | 906 |
contentTree.addContent(htmlTree); |
36526 | 907 |
} |
908 |
||
909 |
/** |
|
910 |
* {@inheritDoc} |
|
42831
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
911 |
* |
feff6f296019
8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents:
42816
diff
changeset
|
912 |
* @throws jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException |
36526 | 913 |
*/ |
40587 | 914 |
@Override |
915 |
public void printDocument(Content contentTree) throws DocFileIOException { |
|
36526 | 916 |
printHtmlDocument(configuration.metakeywords.getMetaKeywordsForModule(mdle), |
53863
d001808c57e8
8218998: Add metadata to generated API documentation files
jjg
parents:
53562
diff
changeset
|
917 |
getDescription("declaration", mdle), |
36526 | 918 |
true, contentTree); |
919 |
} |
|
920 |
||
921 |
/** |
|
922 |
* Add the module package deprecation information to the documentation tree. |
|
923 |
* |
|
924 |
* @param li the content tree to which the deprecation information will be added |
|
925 |
* @param pkg the PackageDoc that is added |
|
926 |
*/ |
|
927 |
public void addPackageDeprecationInfo(Content li, PackageElement pkg) { |
|
928 |
List<? extends DocTree> deprs; |
|
929 |
if (utils.isDeprecated(pkg)) { |
|
930 |
deprs = utils.getDeprecatedTrees(pkg); |
|
931 |
HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV); |
|
47846 | 932 |
deprDiv.setStyle(HtmlStyle.deprecationBlock); |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
42407
diff
changeset
|
933 |
Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(pkg)); |
36526 | 934 |
deprDiv.addContent(deprPhrase); |
935 |
if (!deprs.isEmpty()) { |
|
936 |
CommentHelper ch = utils.getCommentHelper(pkg); |
|
937 |
List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0)); |
|
938 |
if (!commentTags.isEmpty()) { |
|
939 |
addInlineDeprecatedComment(pkg, deprs.get(0), deprDiv); |
|
940 |
} |
|
941 |
} |
|
942 |
li.addContent(deprDiv); |
|
943 |
} |
|
944 |
} |
|
945 |
} |