author | ksrini |
Tue, 28 Jun 2016 16:43:41 -0700 | |
changeset 39364 | bd6d4a7936b4 |
parent 35426 | 374342e56a56 |
child 40303 | 96a1226aca18 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
2 |
* Copyright (c) 1997, 2016, 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.io.*; |
|
29 |
import java.util.*; |
|
14258 | 30 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
31 |
import javax.lang.model.element.PackageElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
32 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
33 |
import jdk.javadoc.doclet.DocletEnvironment; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
34 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
35 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
36 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
37 |
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
38 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
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.DocletAbortException; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
42 |
import jdk.javadoc.internal.doclets.toolkit.util.Group; |
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 |
* Root of the program structure. Used for "overview" documentation. |
|
61 |
*/ |
|
39364
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
35426
diff
changeset
|
62 |
private DocletEnvironment docEnv; |
10 | 63 |
|
64 |
/** |
|
65 |
* Map representing the group of packages as specified on the command line. |
|
66 |
* |
|
67 |
* @see Group |
|
68 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
69 |
private Map<String, SortedSet<PackageElement>> groupPackageMap; |
10 | 70 |
|
71 |
/** |
|
72 |
* List to store the order groups as specified on the command line. |
|
73 |
*/ |
|
1789
7ac8c0815000
6765045: Remove rawtypes warnings from langtools
mcimadamore
parents:
1787
diff
changeset
|
74 |
private List<String> groupList; |
10 | 75 |
|
76 |
/** |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
77 |
* HTML tree for main tag. |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
78 |
*/ |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
79 |
private HtmlTree htmlTree = HtmlTree.MAIN(); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
80 |
|
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
81 |
/** |
10 | 82 |
* Construct the PackageIndexWriter. Also constructs the grouping |
83 |
* information as provided on the command line by "-group" option. Stores |
|
84 |
* the order of groups specified by the user. |
|
85 |
* |
|
86 |
* @see Group |
|
87 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
88 |
public PackageIndexWriter(ConfigurationImpl configuration, DocPath filename) throws IOException { |
10 | 89 |
super(configuration, filename); |
39364
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
35426
diff
changeset
|
90 |
this.docEnv = configuration.docEnv; |
10 | 91 |
groupPackageMap = configuration.group.groupPackages(packages); |
92 |
groupList = configuration.group.getGroupList(); |
|
93 |
} |
|
94 |
||
95 |
/** |
|
96 |
* Generate the package index page for the right-hand frame. |
|
97 |
* |
|
98 |
* @param configuration the current configuration of the doclet. |
|
99 |
*/ |
|
100 |
public static void generate(ConfigurationImpl configuration) { |
|
101 |
PackageIndexWriter packgen; |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14260
diff
changeset
|
102 |
DocPath filename = DocPaths.OVERVIEW_SUMMARY; |
10 | 103 |
try { |
104 |
packgen = new PackageIndexWriter(configuration, filename); |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
105 |
packgen.buildPackageIndexFile("doclet.Window_Overview_Summary", true); |
10 | 106 |
packgen.close(); |
107 |
} catch (IOException exc) { |
|
108 |
configuration.standardmessage.error( |
|
109 |
"doclet.exception_encountered", |
|
110 |
exc.toString(), filename); |
|
19667
fdfce85627a9
8001669: javadoc internal DocletAbortException should set cause when appropriate
jjg
parents:
19499
diff
changeset
|
111 |
throw new DocletAbortException(exc); |
10 | 112 |
} |
113 |
} |
|
114 |
||
115 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
116 |
* 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
|
117 |
* separate table indices for each package group. |
10 | 118 |
* |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
119 |
* @param body the documentation tree to which the index will be added |
10 | 120 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
121 |
protected void addIndex(Content body) { |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
21008
diff
changeset
|
122 |
for (String groupname : groupList) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
123 |
SortedSet<PackageElement> list = groupPackageMap.get(groupname); |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
124 |
if (list != null && !list.isEmpty()) { |
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
125 |
addIndexContents(list, |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
21008
diff
changeset
|
126 |
groupname, configuration.getText("doclet.Member_Table_Summary", |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
21008
diff
changeset
|
127 |
groupname, configuration.getText("doclet.packages")), body); |
7614
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 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
130 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
131 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
132 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
133 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
134 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
135 |
protected void addPackagesList(Collection<PackageElement> packages, String text, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
136 |
String tableSummary, Content body) { |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
137 |
Content table = (configuration.isOutputHtml5()) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
138 |
? HtmlTree.TABLE(HtmlStyle.overviewSummary, getTableCaption(new RawHtml(text))) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
139 |
: HtmlTree.TABLE(HtmlStyle.overviewSummary, tableSummary, getTableCaption(new RawHtml(text))); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
140 |
table.addContent(getSummaryTableHeader(packageTableHeader, "col")); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
141 |
Content tbody = new HtmlTree(HtmlTag.TBODY); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
142 |
addPackagesList(packages, tbody); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
143 |
table.addContent(tbody); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
144 |
Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
145 |
if (configuration.allowTag(HtmlTag.MAIN)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
146 |
htmlTree.addContent(div); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
147 |
} else { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
148 |
body.addContent(div); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
149 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
150 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
151 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
152 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
153 |
* 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
|
154 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
155 |
* @param packages Packages to which link is to be generated |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
156 |
* @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
|
157 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
158 |
protected void addPackagesList(Collection<PackageElement> packages, Content tbody) { |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
159 |
boolean altColor = true; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
160 |
for (PackageElement pkg : packages) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
161 |
if (!pkg.isUnnamed()) { |
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
162 |
if (!(configuration.nodeprecated && utils.isDeprecated(pkg))) { |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
163 |
Content packageLinkContent = getPackageLink(pkg, getPackageName(pkg)); |
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
164 |
Content tdPackage = HtmlTree.TD(HtmlStyle.colFirst, packageLinkContent); |
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
165 |
HtmlTree tdSummary = new HtmlTree(HtmlTag.TD); |
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
166 |
tdSummary.addStyle(HtmlStyle.colLast); |
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
167 |
addSummaryComment(pkg, tdSummary); |
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
168 |
HtmlTree tr = HtmlTree.TR(tdPackage); |
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
169 |
tr.addContent(tdSummary); |
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
170 |
tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor); |
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
171 |
tbody.addContent(tr); |
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
172 |
} |
10 | 173 |
} |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22159
diff
changeset
|
174 |
altColor = !altColor; |
10 | 175 |
} |
176 |
} |
|
177 |
||
178 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
179 |
* Adds the overview summary comment for this documentation. Add one line |
10 | 180 |
* 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
|
181 |
* 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
|
182 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
183 |
* @param body the documentation tree to which the overview header will be added |
10 | 184 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
185 |
protected void addOverviewHeader(Content body) { |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
186 |
addConfigurationTitle(body); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
187 |
if (!utils.getBody(configuration.overviewElement).isEmpty()) { |
9068
6697b4cbba1d
7010342: End tag for element P is not open for few html files generated using new javadoc
bpatel
parents:
7681
diff
changeset
|
188 |
HtmlTree subTitleDiv = new HtmlTree(HtmlTag.DIV); |
6697b4cbba1d
7010342: End tag for element P is not open for few html files generated using new javadoc
bpatel
parents:
7681
diff
changeset
|
189 |
subTitleDiv.addStyle(HtmlStyle.subTitle); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
190 |
addSummaryComment(configuration.overviewElement, subTitleDiv); |
9068
6697b4cbba1d
7010342: End tag for element P is not open for few html files generated using new javadoc
bpatel
parents:
7681
diff
changeset
|
191 |
Content div = HtmlTree.DIV(HtmlStyle.header, subTitleDiv); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
192 |
Content see = seeLabel; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
193 |
see.addContent(" "); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
194 |
Content descPara = HtmlTree.P(see); |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
19937
diff
changeset
|
195 |
Content descLink = getHyperLink(getDocLink( |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
19937
diff
changeset
|
196 |
SectionName.OVERVIEW_DESCRIPTION), |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
19937
diff
changeset
|
197 |
descriptionLabel, "", ""); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
198 |
descPara.addContent(descLink); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
199 |
div.addContent(descPara); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
200 |
if (configuration.allowTag(HtmlTag.MAIN)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
201 |
htmlTree.addContent(div); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
202 |
} else { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
203 |
body.addContent(div); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
204 |
} |
10 | 205 |
} |
206 |
} |
|
207 |
||
208 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
209 |
* 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
|
210 |
* "-overview" option on the command line. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
211 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
212 |
* @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
|
213 |
* be added |
10 | 214 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
215 |
protected void addOverviewComment(Content htmltree) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
216 |
if (!utils.getBody(configuration.overviewElement).isEmpty()) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
217 |
htmltree.addContent(getMarkerAnchor(SectionName.OVERVIEW_DESCRIPTION)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31751
diff
changeset
|
218 |
addInlineComment(configuration.overviewElement, htmltree); |
10 | 219 |
} |
220 |
} |
|
221 |
||
222 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
223 |
* Adds the tag information 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
|
224 |
* "-overview" option on the command line. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
225 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
226 |
* @param body the documentation tree to which the overview will be added |
10 | 227 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
228 |
protected void addOverview(Content body) throws IOException { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
229 |
HtmlTree div = new HtmlTree(HtmlTag.DIV); |
15559
4e397baa6e3d
8004353: Generated html is wrong for overview.html; content has incorrect css footer class
jjg
parents:
14358
diff
changeset
|
230 |
div.addStyle(HtmlStyle.contentContainer); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
231 |
addOverviewComment(div); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
232 |
if (configuration.allowTag(HtmlTag.MAIN)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
233 |
htmlTree.addContent(div); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
234 |
body.addContent(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
235 |
} else { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
236 |
body.addContent(div); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
237 |
} |
10 | 238 |
} |
239 |
||
240 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
241 |
* Adds the top text (from the -top option), the upper |
10 | 242 |
* navigation bar, and then the title (from the"-title" |
243 |
* 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
|
244 |
* |
31751 | 245 |
* @param body the documentation tree to which the navigation bar header will be added |
10 | 246 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
247 |
protected void addNavigationBarHeader(Content body) { |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
248 |
Content htmlTree = (configuration.allowTag(HtmlTag.HEADER)) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
249 |
? HtmlTree.HEADER() |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
250 |
: body; |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
251 |
addTop(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
252 |
addNavLinks(true, htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
253 |
if (configuration.allowTag(HtmlTag.HEADER)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
254 |
body.addContent(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
255 |
} |
10 | 256 |
} |
257 |
||
258 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
259 |
* Adds the lower navigation bar and the bottom text |
10 | 260 |
* (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
|
261 |
* |
14259 | 262 |
* @param body the documentation tree to which the navigation bar footer will be added |
10 | 263 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
264 |
protected void addNavigationBarFooter(Content body) { |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
265 |
Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
266 |
? HtmlTree.FOOTER() |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
267 |
: body; |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
268 |
addNavLinks(false, htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
269 |
addBottom(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
270 |
if (configuration.allowTag(HtmlTag.FOOTER)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
271 |
body.addContent(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
272 |
} |
10 | 273 |
} |
274 |
} |