author | pmuthuswamy |
Wed, 30 Jan 2019 16:39:26 +0530 | |
changeset 53562 | 0d9dee001667 |
parent 52644 | 43efb4ca6d6c |
child 53863 | d001808c57e8 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
48654
36f58bd6269f
8195796: Reduce the size of relative URLs in generated docs
jjg
parents:
47850
diff
changeset
|
2 |
* Copyright (c) 1998, 2018, 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:
29957
diff
changeset
|
26 |
package jdk.javadoc.internal.doclets.formats.html; |
10 | 27 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
28 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
29 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
30 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
31 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48747
diff
changeset
|
32 |
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation; |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48747
diff
changeset
|
33 |
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
34 |
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
35 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
40587 | 36 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
37 |
import jdk.javadoc.internal.doclets.toolkit.util.DocPath; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
38 |
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
39 |
|
10 | 40 |
|
41 |
/** |
|
42 |
* Generate the Help File for the generated API documentation. The help file |
|
43 |
* contents are helpful for browsing the generated documentation. |
|
44 |
* |
|
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
45 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
46 |
* 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:
14258
diff
changeset
|
47 |
* This code and its internal interfaces are subject to change or |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
48 |
* deletion without notice.</b> |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
49 |
* |
10 | 50 |
* @author Atul M Dambalkar |
51 |
*/ |
|
52 |
public class HelpWriter extends HtmlDocletWriter { |
|
53 |
||
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
54 |
HtmlTree mainTree = HtmlTree.MAIN(); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
55 |
|
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48747
diff
changeset
|
56 |
private final Navigation navBar; |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48747
diff
changeset
|
57 |
|
10 | 58 |
/** |
59 |
* Constructor to construct HelpWriter object. |
|
48654
36f58bd6269f
8195796: Reduce the size of relative URLs in generated docs
jjg
parents:
47850
diff
changeset
|
60 |
* @param configuration the configuration |
10 | 61 |
* @param filename File to be generated. |
62 |
*/ |
|
45417 | 63 |
public HelpWriter(HtmlConfiguration configuration, |
40303 | 64 |
DocPath filename) { |
10 | 65 |
super(configuration, filename); |
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48747
diff
changeset
|
66 |
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.HELP, path); |
10 | 67 |
} |
68 |
||
69 |
/** |
|
70 |
* Construct the HelpWriter object and then use it to generate the help |
|
71 |
* file. The name of the generated file is "help-doc.html". The help file |
|
72 |
* will get generated if and only if "-helpfile" and "-nohelp" is not used |
|
73 |
* on the command line. |
|
40587 | 74 |
* |
48654
36f58bd6269f
8195796: Reduce the size of relative URLs in generated docs
jjg
parents:
47850
diff
changeset
|
75 |
* @param configuration the configuration |
40587 | 76 |
* @throws DocFileIOException if there is a problem while generating the documentation |
10 | 77 |
*/ |
45417 | 78 |
public static void generate(HtmlConfiguration configuration) throws DocFileIOException { |
40587 | 79 |
DocPath filename = DocPaths.HELP_DOC; |
80 |
HelpWriter helpgen = new HelpWriter(configuration, filename); |
|
81 |
helpgen.generateHelpFile(); |
|
10 | 82 |
} |
83 |
||
84 |
/** |
|
85 |
* Generate the help file contents. |
|
40587 | 86 |
* |
87 |
* @throws DocFileIOException if there is a problem while generating the documentation |
|
10 | 88 |
*/ |
40587 | 89 |
protected void generateHelpFile() throws DocFileIOException { |
52644
43efb4ca6d6c
8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents:
51092
diff
changeset
|
90 |
String title = resources.getText("doclet.Window_Help_title"); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
91 |
HtmlTree body = getBody(true, getWindowTitle(title)); |
53562 | 92 |
HtmlTree htmlTree = HtmlTree.HEADER(); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
93 |
addTop(htmlTree); |
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48747
diff
changeset
|
94 |
navBar.setUserHeader(getUserHeaderFooter(true)); |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48747
diff
changeset
|
95 |
htmlTree.addContent(navBar.getContent(true)); |
53562 | 96 |
body.addContent(htmlTree); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
97 |
addHelpFileContents(body); |
53562 | 98 |
htmlTree = HtmlTree.FOOTER(); |
49551
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48747
diff
changeset
|
99 |
navBar.setUserFooter(getUserHeaderFooter(false)); |
0d4786e42471
8196200: Implement a navigation builder in javadoc
bpatel
parents:
48747
diff
changeset
|
100 |
htmlTree.addContent(navBar.getContent(false)); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
101 |
addBottom(htmlTree); |
53562 | 102 |
body.addContent(htmlTree); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
103 |
printHtmlDocument(null, true, body); |
10 | 104 |
} |
105 |
||
106 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
107 |
* Add the help file contents from the resource file to the content tree. While adding the |
10 | 108 |
* help file contents it also keeps track of user options. If "-notree" |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
109 |
* is used, then the "overview-tree.html" will not get added and hence |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
110 |
* help information also will not get added. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
111 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
112 |
* @param contentTree the content tree to which the help file contents will be added |
10 | 113 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
114 |
protected void addHelpFileContents(Content contentTree) { |
48747 | 115 |
// Heading |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
116 |
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, HtmlStyle.title, |
48747 | 117 |
contents.getContent("doclet.help.main_heading")); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
118 |
Content div = HtmlTree.DIV(HtmlStyle.header, heading); |
48747 | 119 |
Content intro = HtmlTree.DIV(HtmlStyle.subTitle, |
120 |
contents.getContent("doclet.help.intro")); |
|
121 |
div.addContent(intro); |
|
53562 | 122 |
mainTree.addContent(div); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
123 |
HtmlTree htmlTree; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
124 |
HtmlTree ul = new HtmlTree(HtmlTag.UL); |
47846 | 125 |
ul.setStyle(HtmlStyle.blockList); |
48747 | 126 |
|
127 |
// Overview |
|
10 | 128 |
if (configuration.createoverview) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
129 |
Content overviewHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, |
40303 | 130 |
contents.overviewLabel); |
53562 | 131 |
htmlTree = HtmlTree.SECTION(overviewHeading); |
51018
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
132 |
String overviewKey = configuration.showModules |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
133 |
? "doclet.help.overview.modules.body" |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
134 |
: "doclet.help.overview.packages.body"; |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
135 |
Content overviewLink = links.createLink( |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
136 |
DocPaths.overviewSummary(configuration.frames), |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
137 |
resources.getText("doclet.Overview")); |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
138 |
Content overviewBody = contents.getContent(overviewKey, overviewLink); |
48747 | 139 |
Content overviewPara = HtmlTree.P(overviewBody); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
140 |
htmlTree.addContent(overviewPara); |
53562 | 141 |
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); |
10 | 142 |
} |
48747 | 143 |
|
51018
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
144 |
// Module |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
145 |
if (configuration.showModules) { |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
146 |
Content moduleHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
147 |
contents.moduleLabel); |
53562 | 148 |
htmlTree = HtmlTree.SECTION(moduleHead); |
51018
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
149 |
Content moduleIntro = contents.getContent("doclet.help.module.intro"); |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
150 |
Content modulePara = HtmlTree.P(moduleIntro); |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
151 |
htmlTree.addContent(modulePara); |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
152 |
HtmlTree ulModule = new HtmlTree(HtmlTag.UL); |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
153 |
ulModule.addContent(HtmlTree.LI(contents.packagesLabel)); |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
154 |
ulModule.addContent(HtmlTree.LI(contents.modulesLabel)); |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
155 |
ulModule.addContent(HtmlTree.LI(contents.servicesLabel)); |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
156 |
htmlTree.addContent(ulModule); |
53562 | 157 |
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); |
51018
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
158 |
} |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
159 |
|
48747 | 160 |
// Package |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
161 |
Content packageHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, |
40303 | 162 |
contents.packageLabel); |
53562 | 163 |
htmlTree = HtmlTree.SECTION(packageHead); |
48747 | 164 |
Content packageIntro = contents.getContent("doclet.help.package.intro"); |
165 |
Content packagePara = HtmlTree.P(packageIntro); |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
166 |
htmlTree.addContent(packagePara); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
167 |
HtmlTree ulPackage = new HtmlTree(HtmlTag.UL); |
51018
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
168 |
ulPackage.addContent(HtmlTree.LI(contents.interfaces)); |
48747 | 169 |
ulPackage.addContent(HtmlTree.LI(contents.classes)); |
170 |
ulPackage.addContent(HtmlTree.LI(contents.enums)); |
|
171 |
ulPackage.addContent(HtmlTree.LI(contents.exceptions)); |
|
172 |
ulPackage.addContent(HtmlTree.LI(contents.errors)); |
|
173 |
ulPackage.addContent(HtmlTree.LI(contents.annotationTypes)); |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
174 |
htmlTree.addContent(ulPackage); |
53562 | 175 |
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); |
48747 | 176 |
|
177 |
// Class/interface |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
178 |
Content classHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, |
48747 | 179 |
contents.getContent("doclet.help.class_interface.head")); |
53562 | 180 |
htmlTree = HtmlTree.SECTION(classHead); |
48747 | 181 |
Content classIntro = contents.getContent("doclet.help.class_interface.intro"); |
182 |
Content classPara = HtmlTree.P(classIntro); |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
183 |
htmlTree.addContent(classPara); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
184 |
HtmlTree ul1 = new HtmlTree(HtmlTag.UL); |
48747 | 185 |
ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.inheritance_diagram"))); |
186 |
ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.subclasses"))); |
|
187 |
ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.subinterfaces"))); |
|
188 |
ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.implementations"))); |
|
189 |
ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.declaration"))); |
|
190 |
ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.description"))); |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
191 |
htmlTree.addContent(ul1); |
51018
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
192 |
htmlTree.addContent(new HtmlTree(HtmlTag.BR)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
193 |
HtmlTree ul2 = new HtmlTree(HtmlTag.UL); |
40303 | 194 |
ul2.addContent(HtmlTree.LI(contents.nestedClassSummary)); |
195 |
ul2.addContent(HtmlTree.LI(contents.fieldSummaryLabel)); |
|
51018
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
196 |
ul2.addContent(HtmlTree.LI(contents.propertySummaryLabel)); |
40303 | 197 |
ul2.addContent(HtmlTree.LI(contents.constructorSummaryLabel)); |
198 |
ul2.addContent(HtmlTree.LI(contents.methodSummary)); |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
199 |
htmlTree.addContent(ul2); |
51018
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
200 |
htmlTree.addContent(new HtmlTree(HtmlTag.BR)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
201 |
HtmlTree ul3 = new HtmlTree(HtmlTag.UL); |
40303 | 202 |
ul3.addContent(HtmlTree.LI(contents.fieldDetailsLabel)); |
51018
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
203 |
ul3.addContent(HtmlTree.LI(contents.propertyDetailsLabel)); |
40303 | 204 |
ul3.addContent(HtmlTree.LI(contents.constructorDetailsLabel)); |
205 |
ul3.addContent(HtmlTree.LI(contents.methodDetailLabel)); |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
206 |
htmlTree.addContent(ul3); |
48747 | 207 |
Content classSummary = contents.getContent("doclet.help.class_interface.summary"); |
208 |
Content para = HtmlTree.P(classSummary); |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
209 |
htmlTree.addContent(para); |
53562 | 210 |
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); |
48747 | 211 |
|
212 |
// Annotation Types |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
213 |
Content aHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, |
40303 | 214 |
contents.annotationType); |
53562 | 215 |
htmlTree = HtmlTree.SECTION(aHead); |
48747 | 216 |
Content aIntro = contents.getContent("doclet.help.annotation_type.intro"); |
217 |
Content aPara = HtmlTree.P(aIntro); |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
218 |
htmlTree.addContent(aPara); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
219 |
HtmlTree aul = new HtmlTree(HtmlTag.UL); |
48747 | 220 |
aul.addContent(HtmlTree.LI(contents.getContent("doclet.help.annotation_type.declaration"))); |
221 |
aul.addContent(HtmlTree.LI(contents.getContent("doclet.help.annotation_type.description"))); |
|
222 |
aul.addContent(HtmlTree.LI(contents.annotateTypeRequiredMemberSummaryLabel)); |
|
223 |
aul.addContent(HtmlTree.LI(contents.annotateTypeOptionalMemberSummaryLabel)); |
|
224 |
aul.addContent(HtmlTree.LI(contents.annotationTypeMemberDetail)); |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
225 |
htmlTree.addContent(aul); |
53562 | 226 |
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); |
48747 | 227 |
|
228 |
// Enums |
|
229 |
Content enumHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.enum_); |
|
53562 | 230 |
htmlTree = HtmlTree.SECTION(enumHead); |
48747 | 231 |
Content eIntro = contents.getContent("doclet.help.enum.intro"); |
232 |
Content enumPara = HtmlTree.P(eIntro); |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
233 |
htmlTree.addContent(enumPara); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
234 |
HtmlTree eul = new HtmlTree(HtmlTag.UL); |
48747 | 235 |
eul.addContent(HtmlTree.LI(contents.getContent("doclet.help.enum.declaration"))); |
236 |
eul.addContent(HtmlTree.LI(contents.getContent("doclet.help.enum.definition"))); |
|
237 |
eul.addContent(HtmlTree.LI(contents.enumConstantSummary)); |
|
238 |
eul.addContent(HtmlTree.LI(contents.enumConstantDetailLabel)); |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
239 |
htmlTree.addContent(eul); |
53562 | 240 |
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); |
48747 | 241 |
|
242 |
// Class Use |
|
10 | 243 |
if (configuration.classuse) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
244 |
Content useHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, |
48747 | 245 |
contents.getContent("doclet.help.use.head")); |
53562 | 246 |
htmlTree = HtmlTree.SECTION(useHead); |
48747 | 247 |
Content useBody = contents.getContent("doclet.help.use.body"); |
248 |
Content usePara = HtmlTree.P(useBody); |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
249 |
htmlTree.addContent(usePara); |
53562 | 250 |
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); |
10 | 251 |
} |
48747 | 252 |
|
253 |
// Tree |
|
10 | 254 |
if (configuration.createtree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
255 |
Content treeHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, |
48747 | 256 |
contents.getContent("doclet.help.tree.head")); |
53562 | 257 |
htmlTree = HtmlTree.SECTION(treeHead); |
48747 | 258 |
Content treeIntro = contents.getContent("doclet.help.tree.intro", |
48654
36f58bd6269f
8195796: Reduce the size of relative URLs in generated docs
jjg
parents:
47850
diff
changeset
|
259 |
links.createLink(DocPaths.OVERVIEW_TREE, |
52644
43efb4ca6d6c
8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents:
51092
diff
changeset
|
260 |
resources.getText("doclet.Class_Hierarchy")), |
17563
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
14357
diff
changeset
|
261 |
HtmlTree.CODE(new StringContent("java.lang.Object"))); |
48747 | 262 |
Content treePara = HtmlTree.P(treeIntro); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
263 |
htmlTree.addContent(treePara); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
264 |
HtmlTree tul = new HtmlTree(HtmlTag.UL); |
48747 | 265 |
tul.addContent(HtmlTree.LI(contents.getContent("doclet.help.tree.overview"))); |
266 |
tul.addContent(HtmlTree.LI(contents.getContent("doclet.help.tree.package"))); |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
267 |
htmlTree.addContent(tul); |
53562 | 268 |
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); |
10 | 269 |
} |
48747 | 270 |
|
271 |
// Deprecated |
|
272 |
if (!(configuration.nodeprecatedlist || configuration.nodeprecated)) { |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
273 |
Content dHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, |
40303 | 274 |
contents.deprecatedAPI); |
53562 | 275 |
htmlTree = HtmlTree.SECTION(dHead); |
48747 | 276 |
Content deprBody = contents.getContent("doclet.help.deprecated.body", |
48654
36f58bd6269f
8195796: Reduce the size of relative URLs in generated docs
jjg
parents:
47850
diff
changeset
|
277 |
links.createLink(DocPaths.DEPRECATED_LIST, |
52644
43efb4ca6d6c
8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents:
51092
diff
changeset
|
278 |
resources.getText("doclet.Deprecated_API"))); |
48747 | 279 |
Content dPara = HtmlTree.P(deprBody); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
280 |
htmlTree.addContent(dPara); |
53562 | 281 |
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); |
10 | 282 |
} |
48747 | 283 |
|
284 |
// Index |
|
10 | 285 |
if (configuration.createindex) { |
17563
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
14357
diff
changeset
|
286 |
Content indexlink; |
10 | 287 |
if (configuration.splitindex) { |
48654
36f58bd6269f
8195796: Reduce the size of relative URLs in generated docs
jjg
parents:
47850
diff
changeset
|
288 |
indexlink = links.createLink(DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)), |
52644
43efb4ca6d6c
8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents:
51092
diff
changeset
|
289 |
resources.getText("doclet.Index")); |
10 | 290 |
} else { |
48654
36f58bd6269f
8195796: Reduce the size of relative URLs in generated docs
jjg
parents:
47850
diff
changeset
|
291 |
indexlink = links.createLink(DocPaths.INDEX_ALL, |
52644
43efb4ca6d6c
8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents:
51092
diff
changeset
|
292 |
resources.getText("doclet.Index")); |
10 | 293 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
294 |
Content indexHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, |
48747 | 295 |
contents.getContent("doclet.help.index.head")); |
53562 | 296 |
htmlTree = HtmlTree.SECTION(indexHead); |
48747 | 297 |
Content indexBody = contents.getContent("doclet.help.index.body", indexlink); |
298 |
Content indexPara = HtmlTree.P(indexBody); |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
299 |
htmlTree.addContent(indexPara); |
53562 | 300 |
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); |
10 | 301 |
} |
48747 | 302 |
|
303 |
// Frames |
|
40500
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
304 |
if (configuration.frames) { |
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
305 |
Content frameHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, |
48747 | 306 |
contents.getContent("doclet.help.frames.head")); |
53562 | 307 |
htmlTree = HtmlTree.SECTION(frameHead); |
48747 | 308 |
Content framesBody = contents.getContent("doclet.help.frames.body"); |
309 |
Content framePara = HtmlTree.P(framesBody); |
|
40500
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
310 |
htmlTree.addContent(framePara); |
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
311 |
|
53562 | 312 |
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
313 |
} |
40500
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
314 |
|
48747 | 315 |
// Serialized Form |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
316 |
Content sHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, |
40303 | 317 |
contents.serializedForm); |
53562 | 318 |
htmlTree = HtmlTree.SECTION(sHead); |
48747 | 319 |
Content serialBody = contents.getContent("doclet.help.serial_form.body"); |
320 |
Content serialPara = HtmlTree.P(serialBody); |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
321 |
htmlTree.addContent(serialPara); |
53562 | 322 |
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); |
48747 | 323 |
|
324 |
// Constant Field Values |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
325 |
Content constHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, |
40303 | 326 |
contents.constantsSummaryTitle); |
53562 | 327 |
htmlTree = HtmlTree.SECTION(constHead); |
48747 | 328 |
Content constantsBody = contents.getContent("doclet.help.constants.body", |
48654
36f58bd6269f
8195796: Reduce the size of relative URLs in generated docs
jjg
parents:
47850
diff
changeset
|
329 |
links.createLink(DocPaths.CONSTANT_VALUES, |
40303 | 330 |
resources.getText("doclet.Constants_Summary"))); |
48747 | 331 |
Content constPara = HtmlTree.P(constantsBody); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
332 |
htmlTree.addContent(constPara); |
53562 | 333 |
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); |
48747 | 334 |
|
51091
a602706ccaaa
8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents:
51018
diff
changeset
|
335 |
// Search |
a602706ccaaa
8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents:
51018
diff
changeset
|
336 |
Content searchHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, |
a602706ccaaa
8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents:
51018
diff
changeset
|
337 |
contents.getContent("doclet.help.search.head")); |
53562 | 338 |
htmlTree = HtmlTree.SECTION(searchHead); |
51091
a602706ccaaa
8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents:
51018
diff
changeset
|
339 |
Content searchBody = contents.getContent("doclet.help.search.body"); |
a602706ccaaa
8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents:
51018
diff
changeset
|
340 |
Content searchPara = HtmlTree.P(searchBody); |
a602706ccaaa
8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents:
51018
diff
changeset
|
341 |
htmlTree.addContent(searchPara); |
53562 | 342 |
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); |
51091
a602706ccaaa
8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents:
51018
diff
changeset
|
343 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
344 |
Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul); |
51018
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
345 |
divContent.addContent(new HtmlTree(HtmlTag.HR)); |
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
346 |
Content footnote = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase, |
48747 | 347 |
contents.getContent("doclet.help.footnote")); |
51018
591c34a66d41
8185740: The help-doc.html generated by the doclet is outdated
jjg
parents:
49551
diff
changeset
|
348 |
divContent.addContent(footnote); |
53562 | 349 |
mainTree.addContent(divContent); |
350 |
contentTree.addContent(mainTree); |
|
10 | 351 |
} |
352 |
} |