author | bpatel |
Wed, 25 Oct 2017 12:29:00 -0700 | |
changeset 47447 | 9887d1bc3e9c |
parent 47427 | 251676148c62 |
child 47846 | 4e78aba768f0 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
43755
ae42964e27e3
8173302: Move the Description up on module and package index page
ksrini
parents:
41452
diff
changeset
|
2 |
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
10 | 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 |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 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 |
* |
|
5520 | 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. |
|
10 | 24 |
*/ |
25 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
26 |
package jdk.javadoc.internal.doclets.formats.html; |
10 | 27 |
|
28 |
import java.util.*; |
|
14258 | 29 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
30 |
import javax.lang.model.element.PackageElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
31 |
|
47447
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
32 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
33 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
34 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
35 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
45157
f5f796453339
8178043: Support grouping modules in unified javadoc
bpatel
parents:
44195
diff
changeset
|
36 |
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
37 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
40587 | 38 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
39 |
import jdk.javadoc.internal.doclets.toolkit.util.DocPath; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
40 |
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
41 |
import jdk.javadoc.internal.doclets.toolkit.util.Group; |
47447
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
42 |
import jdk.javadoc.internal.doclets.toolkit.util.GroupTypes; |
10 | 43 |
|
44 |
/** |
|
45 |
* Generate the package index page "overview-summary.html" for the right-hand |
|
46 |
* frame. A click on the package name on this page will update the same frame |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14260
diff
changeset
|
47 |
* with the "package-summary.html" file for the clicked package. |
10 | 48 |
* |
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
49 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
50 |
* If you write code that depends on this, you do so at your own risk. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
51 |
* This code and its internal interfaces are subject to change or |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
52 |
* deletion without notice.</b> |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
53 |
* |
10 | 54 |
* @author Atul M Dambalkar |
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2212
diff
changeset
|
55 |
* @author Bhavesh Patel (Modified) |
10 | 56 |
*/ |
57 |
public class PackageIndexWriter extends AbstractPackageIndexWriter { |
|
58 |
||
59 |
||
60 |
/** |
|
61 |
* Map representing the group of packages as specified on the command line. |
|
62 |
* |
|
63 |
* @see Group |
|
64 |
*/ |
|
40587 | 65 |
private final Map<String, SortedSet<PackageElement>> groupPackageMap; |
10 | 66 |
|
67 |
/** |
|
47447
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
68 |
* List to store the order groups, which has elements to be displayed, as specified on the command line. |
10 | 69 |
*/ |
47447
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
70 |
private final List<String> groupList = new ArrayList<>(); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
71 |
|
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
72 |
private final GroupTypes groupTypes; |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
73 |
|
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
74 |
private int groupTypesOr = 0; |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
75 |
|
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
76 |
protected Map<String, Integer> groupTypeMap = new LinkedHashMap<>(); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
77 |
|
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
78 |
boolean altColor = true; |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
79 |
|
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
80 |
int counter = 0; |
10 | 81 |
|
82 |
/** |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
83 |
* HTML tree for main tag. |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
84 |
*/ |
40587 | 85 |
private final HtmlTree htmlTree = HtmlTree.MAIN(); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
86 |
|
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
87 |
/** |
10 | 88 |
* Construct the PackageIndexWriter. Also constructs the grouping |
89 |
* information as provided on the command line by "-group" option. Stores |
|
90 |
* the order of groups specified by the user. |
|
91 |
* |
|
40587 | 92 |
* @param configuration the configuration for this doclet |
93 |
* @param filename the path of the page to be generated |
|
10 | 94 |
* @see Group |
95 |
*/ |
|
45417 | 96 |
public PackageIndexWriter(HtmlConfiguration configuration, DocPath filename) { |
10 | 97 |
super(configuration, filename); |
98 |
groupPackageMap = configuration.group.groupPackages(packages); |
|
47447
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
99 |
configuration.group.getGroupList().stream() |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
100 |
.filter(groupPackageMap::containsKey) |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
101 |
.forEachOrdered(groupList::add); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
102 |
groupTypes = new GroupTypes(groupList, resources.getText("doclet.All_Packages")); |
10 | 103 |
} |
104 |
||
105 |
/** |
|
106 |
* Generate the package index page for the right-hand frame. |
|
107 |
* |
|
108 |
* @param configuration the current configuration of the doclet. |
|
40587 | 109 |
* @throws DocFileIOException if there is a problem generating the package index page |
10 | 110 |
*/ |
45417 | 111 |
public static void generate(HtmlConfiguration configuration) throws DocFileIOException { |
40500
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
112 |
DocPath filename = DocPaths.overviewSummary(configuration.frames); |
40587 | 113 |
PackageIndexWriter packgen = new PackageIndexWriter(configuration, filename); |
114 |
packgen.buildPackageIndexFile("doclet.Window_Overview_Summary", true); |
|
10 | 115 |
} |
116 |
||
117 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
118 |
* Depending upon the grouping information and their titles, add |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
119 |
* separate table indices for each package group. |
10 | 120 |
* |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
121 |
* @param body the documentation tree to which the index will be added |
10 | 122 |
*/ |
40587 | 123 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
124 |
protected void addIndex(Content body) { |
47447
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
125 |
addIndexContents(body); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
126 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
127 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
128 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
129 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
130 |
*/ |
40587 | 131 |
@Override |
47447
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
132 |
protected void addPackagesList(Content body) { |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
133 |
if (!groupList.isEmpty()) { |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
134 |
Content caption; |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
135 |
TreeMap<PackageElement, String> groupMap = new TreeMap<>(utils.makePackageComparator()); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
136 |
Content tbody = new HtmlTree(HtmlTag.TBODY); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
137 |
String tableSummary = configuration.getText("doclet.Member_Table_Summary", |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
138 |
configuration.getText("doclet.Package_Summary"), configuration.getText("doclet.packages")); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
139 |
for (String groupname : groupList) { |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
140 |
for (PackageElement pkg : groupPackageMap.get(groupname)) { |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
141 |
groupMap.put(pkg, groupname); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
142 |
} |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
143 |
} |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
144 |
if (!groupMap.isEmpty()) { |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
145 |
addPackagesList(groupMap, tbody); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
146 |
} |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
147 |
if (showTabs(groupTypes)) { |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
148 |
caption = getTableCaption(groupTypes); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
149 |
generateGroupTypesScript(groupTypeMap, groupTypes.getGroupTypes()); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
150 |
} else { |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
151 |
caption = getTableCaption((groupList.size() == 1) ? new StringContent(groupList.get(0)) : contents.packagesLabel); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
152 |
} |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
153 |
Content table = getTableHeader(caption, tableSummary, HtmlStyle.overviewSummary); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
154 |
table.addContent(getPackageTableHeader().toContent()); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
155 |
table.addContent(tbody); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
156 |
Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
157 |
if (configuration.allowTag(HtmlTag.MAIN)) { |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
158 |
htmlTree.addContent(div); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
159 |
} else { |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
160 |
body.addContent(div); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
161 |
} |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
162 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
163 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
164 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
165 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
166 |
* Adds list of packages in the index table. Generate link to each package. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
167 |
* |
47447
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
168 |
* @param map map of package elements and group names |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
169 |
* @param tbody the documentation tree to which the list will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
170 |
*/ |
47447
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
171 |
protected void addPackagesList(TreeMap<PackageElement, String> map, Content tbody) { |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
172 |
String groupname; |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
173 |
for (PackageElement pkg : map.keySet()) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
174 |
if (!pkg.isUnnamed()) { |
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
175 |
if (!(configuration.nodeprecated && utils.isDeprecated(pkg))) { |
47447
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
176 |
groupname = map.get(pkg); |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
177 |
Content packageLinkContent = getPackageLink(pkg, getPackageName(pkg)); |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
178 |
Content thPackage = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, packageLinkContent); |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
179 |
HtmlTree tdSummary = new HtmlTree(HtmlTag.TD); |
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
180 |
tdSummary.addStyle(HtmlStyle.colLast); |
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
181 |
addSummaryComment(pkg, tdSummary); |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
182 |
HtmlTree tr = HtmlTree.TR(thPackage); |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
183 |
tr.addContent(tdSummary); |
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
184 |
tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor); |
47447
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
185 |
int groupType = groupTypes.getTableTab(groupname).value(); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
186 |
groupTypesOr = groupTypesOr | groupType; |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
187 |
String tableId = "i" + counter; |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
188 |
counter++; |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
189 |
groupTypeMap.put(tableId, groupType); |
9887d1bc3e9c
8183037: Overview summary page should have a table with tabs for groups
bpatel
parents:
47427
diff
changeset
|
190 |
tr.addAttr(HtmlAttr.ID, tableId); |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
191 |
tbody.addContent(tr); |
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
192 |
} |
10 | 193 |
} |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
194 |
altColor = !altColor; |
10 | 195 |
} |
196 |
} |
|
197 |
||
198 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
199 |
* Adds the overview summary comment for this documentation. Add one line |
10 | 200 |
* summary at the top of the page and generate a link to the description, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
201 |
* which is added at the end of this page. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
202 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
203 |
* @param body the documentation tree to which the overview header will be added |
10 | 204 |
*/ |
40587 | 205 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
206 |
protected void addOverviewHeader(Content body) { |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
207 |
addConfigurationTitle(body); |
41452 | 208 |
if (!utils.getFullBody(configuration.overviewElement).isEmpty()) { |
43755
ae42964e27e3
8173302: Move the Description up on module and package index page
ksrini
parents:
41452
diff
changeset
|
209 |
HtmlTree div = new HtmlTree(HtmlTag.DIV); |
ae42964e27e3
8173302: Move the Description up on module and package index page
ksrini
parents:
41452
diff
changeset
|
210 |
div.addStyle(HtmlStyle.contentContainer); |
ae42964e27e3
8173302: Move the Description up on module and package index page
ksrini
parents:
41452
diff
changeset
|
211 |
addOverviewComment(div); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
212 |
if (configuration.allowTag(HtmlTag.MAIN)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
213 |
htmlTree.addContent(div); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
214 |
} else { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
215 |
body.addContent(div); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
216 |
} |
10 | 217 |
} |
218 |
} |
|
219 |
||
220 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
221 |
* Adds the overview comment as provided in the file specified by the |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
222 |
* "-overview" option on the command line. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
223 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
224 |
* @param htmltree the documentation tree to which the overview comment will |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
225 |
* be added |
10 | 226 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
227 |
protected void addOverviewComment(Content htmltree) { |
41452 | 228 |
if (!utils.getFullBody(configuration.overviewElement).isEmpty()) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
229 |
addInlineComment(configuration.overviewElement, htmltree); |
10 | 230 |
} |
231 |
} |
|
232 |
||
233 |
/** |
|
44195
5860769fe2f4
8175799: module summary page shows duplicated output
bpatel
parents:
43755
diff
changeset
|
234 |
* For HTML 5, add the htmlTree to the body. For HTML 4, do nothing. |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
235 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
236 |
* @param body the documentation tree to which the overview will be added |
10 | 237 |
*/ |
40587 | 238 |
@Override |
44195
5860769fe2f4
8175799: module summary page shows duplicated output
bpatel
parents:
43755
diff
changeset
|
239 |
protected void addOverview(Content body) { |
5860769fe2f4
8175799: module summary page shows duplicated output
bpatel
parents:
43755
diff
changeset
|
240 |
if (configuration.allowTag(HtmlTag.MAIN)) { |
5860769fe2f4
8175799: module summary page shows duplicated output
bpatel
parents:
43755
diff
changeset
|
241 |
body.addContent(htmlTree); |
5860769fe2f4
8175799: module summary page shows duplicated output
bpatel
parents:
43755
diff
changeset
|
242 |
} |
5860769fe2f4
8175799: module summary page shows duplicated output
bpatel
parents:
43755
diff
changeset
|
243 |
} |
10 | 244 |
|
245 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
246 |
* Adds the top text (from the -top option), the upper |
10 | 247 |
* navigation bar, and then the title (from the"-title" |
248 |
* option), at the top of page. |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
249 |
* |
31751 | 250 |
* @param body the documentation tree to which the navigation bar header will be added |
10 | 251 |
*/ |
40587 | 252 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
253 |
protected void addNavigationBarHeader(Content body) { |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
254 |
Content htmlTree = (configuration.allowTag(HtmlTag.HEADER)) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
255 |
? HtmlTree.HEADER() |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
256 |
: body; |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
257 |
addTop(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
258 |
addNavLinks(true, htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
259 |
if (configuration.allowTag(HtmlTag.HEADER)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
260 |
body.addContent(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
261 |
} |
10 | 262 |
} |
263 |
||
264 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
265 |
* Adds the lower navigation bar and the bottom text |
10 | 266 |
* (from the -bottom option) at the bottom of page. |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
267 |
* |
14259 | 268 |
* @param body the documentation tree to which the navigation bar footer will be added |
10 | 269 |
*/ |
40587 | 270 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
271 |
protected void addNavigationBarFooter(Content body) { |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
272 |
Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
273 |
? HtmlTree.FOOTER() |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
274 |
: body; |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
275 |
addNavLinks(false, htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
276 |
addBottom(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
277 |
if (configuration.allowTag(HtmlTag.FOOTER)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
278 |
body.addContent(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
279 |
} |
10 | 280 |
} |
281 |
} |