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