author | jjg |
Wed, 25 Oct 2017 17:16:18 -0700 | |
changeset 47449 | afa66f3c34c1 |
parent 47427 | 251676148c62 |
child 47846 | 4e78aba768f0 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
44196
f88c0e9cb102
8174974: Annotation type pages generated by javadoc is missing module information
bpatel
parents:
42824
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:
29957
diff
changeset
|
26 |
package jdk.javadoc.internal.doclets.formats.html; |
10 | 27 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
28 |
import java.util.*; |
14258 | 29 |
|
36526 | 30 |
import javax.lang.model.element.ModuleElement; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
31 |
import javax.lang.model.element.PackageElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
32 |
import javax.lang.model.element.TypeElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
33 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
34 |
import com.sun.source.doctree.DocTree; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
35 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
36 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
37 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
38 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
39 |
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
40 |
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
41 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
42 |
import jdk.javadoc.internal.doclets.toolkit.PackageSummaryWriter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
43 |
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper; |
40587 | 44 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
45 |
import jdk.javadoc.internal.doclets.toolkit.util.DocPath; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
46 |
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
10 | 47 |
|
48 |
/** |
|
49 |
* Class to generate file for each package contents in the right-hand |
|
50 |
* frame. This will list all the Class Kinds in the package. A click on any |
|
51 |
* class-kind will update the frame with the clicked class-kind page. |
|
52 |
* |
|
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
53 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
54 |
* 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
|
55 |
* 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
|
56 |
* deletion without notice.</b> |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
57 |
* |
10 | 58 |
* @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:
1787
diff
changeset
|
59 |
* @author Bhavesh Patel (Modified) |
10 | 60 |
*/ |
61 |
public class PackageWriterImpl extends HtmlDocletWriter |
|
62 |
implements PackageSummaryWriter { |
|
63 |
||
64 |
/** |
|
65 |
* The prev package name in the alpha-order list. |
|
66 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
67 |
protected PackageElement prev; |
10 | 68 |
|
69 |
/** |
|
70 |
* The next package name in the alpha-order list. |
|
71 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
72 |
protected PackageElement next; |
10 | 73 |
|
74 |
/** |
|
75 |
* The package being documented. |
|
76 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
77 |
protected PackageElement packageElement; |
10 | 78 |
|
79 |
/** |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
80 |
* The HTML tree for main tag. |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
81 |
*/ |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
82 |
protected HtmlTree mainTree = HtmlTree.MAIN(); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
83 |
|
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
84 |
/** |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
85 |
* The HTML tree for section tag. |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
86 |
*/ |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
87 |
protected HtmlTree sectionTree = HtmlTree.SECTION(); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
88 |
|
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
89 |
/** |
10 | 90 |
* Constructor to construct PackageWriter object and to generate |
91 |
* "package-summary.html" file in the respective package directory. |
|
92 |
* For example for package "java.lang" this will generate file |
|
93 |
* "package-summary.html" file in the "java/lang" directory. It will also |
|
94 |
* create "java/lang" directory in the current or the destination directory |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14265
diff
changeset
|
95 |
* if it doesn't exist. |
10 | 96 |
* |
97 |
* @param configuration the configuration of the doclet. |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
98 |
* @param packageElement PackageElement under consideration. |
10 | 99 |
* @param prev Previous package in the sorted array. |
100 |
* @param next Next package in the sorted array. |
|
101 |
*/ |
|
45417 | 102 |
public PackageWriterImpl(HtmlConfiguration configuration, |
40303 | 103 |
PackageElement packageElement, PackageElement prev, PackageElement next) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
104 |
super(configuration, DocPath |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
105 |
.forPackage(packageElement) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
106 |
.resolve(DocPaths.PACKAGE_SUMMARY)); |
10 | 107 |
this.prev = prev; |
108 |
this.next = next; |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
109 |
this.packageElement = packageElement; |
10 | 110 |
} |
111 |
||
112 |
/** |
|
113 |
* {@inheritDoc} |
|
114 |
*/ |
|
40587 | 115 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
116 |
public Content getPackageHeader(String heading) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
117 |
HtmlTree bodyTree = getBody(true, getWindowTitle(utils.getPackageName(packageElement))); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
118 |
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
119 |
? HtmlTree.HEADER() |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
120 |
: bodyTree; |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
121 |
addTop(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
122 |
addNavLinks(true, htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
123 |
if (configuration.allowTag(HtmlTag.HEADER)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
124 |
bodyTree.addContent(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
125 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
126 |
HtmlTree div = new HtmlTree(HtmlTag.DIV); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
127 |
div.addStyle(HtmlStyle.header); |
40503
cb34fd6e8071
8135291: [javadoc] broken link in Package com.sun.tools.jconsole
bpatel
parents:
40303
diff
changeset
|
128 |
if (configuration.showModules) { |
42824 | 129 |
ModuleElement mdle = configuration.docEnv.getElementUtils().getModuleOf(packageElement); |
44196
f88c0e9cb102
8174974: Annotation type pages generated by javadoc is missing module information
bpatel
parents:
42824
diff
changeset
|
130 |
Content classModuleLabel = HtmlTree.SPAN(HtmlStyle.moduleLabelInPackage, contents.moduleLabel); |
36526 | 131 |
Content moduleNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classModuleLabel); |
40303 | 132 |
moduleNameDiv.addContent(Contents.SPACE); |
36526 | 133 |
moduleNameDiv.addContent(getModuleLink(mdle, |
134 |
new StringContent(mdle.getQualifiedName().toString()))); |
|
135 |
div.addContent(moduleNameDiv); |
|
136 |
} |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
137 |
Content annotationContent = new HtmlTree(HtmlTag.P); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
138 |
addAnnotationInfo(packageElement, annotationContent); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
139 |
div.addContent(annotationContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
140 |
Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, |
40303 | 141 |
HtmlStyle.title, contents.packageLabel); |
142 |
tHeading.addContent(Contents.SPACE); |
|
17569 | 143 |
Content packageHead = new StringContent(heading); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
144 |
tHeading.addContent(packageHead); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
145 |
div.addContent(tHeading); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
146 |
if (configuration.allowTag(HtmlTag.MAIN)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
147 |
mainTree.addContent(div); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
148 |
} else { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
149 |
bodyTree.addContent(div); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
150 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
151 |
return bodyTree; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
152 |
} |
10 | 153 |
|
154 |
/** |
|
155 |
* {@inheritDoc} |
|
156 |
*/ |
|
40587 | 157 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
158 |
public Content getContentHeader() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
159 |
HtmlTree div = new HtmlTree(HtmlTag.DIV); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
160 |
div.addStyle(HtmlStyle.contentContainer); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
161 |
return div; |
10 | 162 |
} |
163 |
||
164 |
/** |
|
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9068
diff
changeset
|
165 |
* Add the package deprecation information to the documentation tree. |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9068
diff
changeset
|
166 |
* |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9068
diff
changeset
|
167 |
* @param div the content tree to which the deprecation information will be added |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9068
diff
changeset
|
168 |
*/ |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9068
diff
changeset
|
169 |
public void addDeprecationInfo(Content div) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
170 |
List<? extends DocTree> deprs = utils.getBlockTags(packageElement, DocTree.Kind.DEPRECATED); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
171 |
if (utils.isDeprecated(packageElement)) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
172 |
CommentHelper ch = utils.getCommentHelper(packageElement); |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9068
diff
changeset
|
173 |
HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV); |
47272 | 174 |
deprDiv.addStyle(HtmlStyle.deprecationBlock); |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
41453
diff
changeset
|
175 |
Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(packageElement)); |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9068
diff
changeset
|
176 |
deprDiv.addContent(deprPhrase); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
177 |
if (!deprs.isEmpty()) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
178 |
List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
179 |
if (!commentTags.isEmpty()) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
180 |
addInlineDeprecatedComment(packageElement, deprs.get(0), deprDiv); |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9068
diff
changeset
|
181 |
} |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9068
diff
changeset
|
182 |
} |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9068
diff
changeset
|
183 |
div.addContent(deprDiv); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9068
diff
changeset
|
184 |
} |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9068
diff
changeset
|
185 |
} |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9068
diff
changeset
|
186 |
|
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9068
diff
changeset
|
187 |
/** |
10 | 188 |
* {@inheritDoc} |
189 |
*/ |
|
40587 | 190 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
191 |
public Content getSummaryHeader() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
192 |
HtmlTree ul = new HtmlTree(HtmlTag.UL); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
193 |
ul.addStyle(HtmlStyle.blockList); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
194 |
return ul; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
195 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
196 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
197 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
198 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
199 |
*/ |
40587 | 200 |
@Override |
47427 | 201 |
public void addInterfaceSummary(SortedSet<TypeElement> interfaces, Content summaryContentTree) { |
202 |
String label = resources.getText("doclet.Interface_Summary"); |
|
203 |
String tableSummary = resources.getText("doclet.Member_Table_Summary", |
|
204 |
resources.getText("doclet.Interface_Summary"), |
|
205 |
resources.getText("doclet.interfaces")); |
|
206 |
TableHeader tableHeader= new TableHeader(contents.interfaceLabel, contents.descriptionLabel); |
|
207 |
||
208 |
addClassesSummary(interfaces, label, tableSummary, tableHeader, summaryContentTree); |
|
209 |
} |
|
210 |
||
211 |
/** |
|
212 |
* {@inheritDoc} |
|
213 |
*/ |
|
214 |
@Override |
|
215 |
public void addClassSummary(SortedSet<TypeElement> classes, Content summaryContentTree) { |
|
216 |
String label = resources.getText("doclet.Class_Summary"); |
|
217 |
String tableSummary = resources.getText("doclet.Member_Table_Summary", |
|
218 |
resources.getText("doclet.Class_Summary"), |
|
219 |
resources.getText("doclet.classes")); |
|
220 |
TableHeader tableHeader= new TableHeader(contents.classLabel, contents.descriptionLabel); |
|
221 |
||
222 |
addClassesSummary(classes, label, tableSummary, tableHeader, summaryContentTree); |
|
223 |
} |
|
224 |
||
225 |
/** |
|
226 |
* {@inheritDoc} |
|
227 |
*/ |
|
228 |
@Override |
|
229 |
public void addEnumSummary(SortedSet<TypeElement> enums, Content summaryContentTree) { |
|
230 |
String label = resources.getText("doclet.Enum_Summary"); |
|
231 |
String tableSummary = resources.getText("doclet.Member_Table_Summary", |
|
232 |
resources.getText("doclet.Enum_Summary"), |
|
233 |
resources.getText("doclet.enums")); |
|
234 |
TableHeader tableHeader= new TableHeader(contents.enum_, contents.descriptionLabel); |
|
235 |
||
236 |
addClassesSummary(enums, label, tableSummary, tableHeader, summaryContentTree); |
|
237 |
} |
|
238 |
||
239 |
/** |
|
240 |
* {@inheritDoc} |
|
241 |
*/ |
|
242 |
@Override |
|
243 |
public void addExceptionSummary(SortedSet<TypeElement> exceptions, Content summaryContentTree) { |
|
244 |
String label = resources.getText("doclet.Exception_Summary"); |
|
245 |
String tableSummary = resources.getText("doclet.Member_Table_Summary", |
|
246 |
resources.getText("doclet.Exception_Summary"), |
|
247 |
resources.getText("doclet.exceptions")); |
|
248 |
TableHeader tableHeader= new TableHeader(contents.exception, contents.descriptionLabel); |
|
249 |
||
250 |
addClassesSummary(exceptions, label, tableSummary, tableHeader, summaryContentTree); |
|
251 |
} |
|
252 |
||
253 |
/** |
|
254 |
* {@inheritDoc} |
|
255 |
*/ |
|
256 |
@Override |
|
257 |
public void addErrorSummary(SortedSet<TypeElement> errors, Content summaryContentTree) { |
|
258 |
String label = resources.getText("doclet.Error_Summary"); |
|
259 |
String tableSummary = resources.getText("doclet.Member_Table_Summary", |
|
260 |
resources.getText("doclet.Error_Summary"), |
|
261 |
resources.getText("doclet.errors")); |
|
262 |
TableHeader tableHeader= new TableHeader(contents.error, contents.descriptionLabel); |
|
263 |
||
264 |
addClassesSummary(errors, label, tableSummary, tableHeader, summaryContentTree); |
|
265 |
} |
|
266 |
||
267 |
/** |
|
268 |
* {@inheritDoc} |
|
269 |
*/ |
|
270 |
@Override |
|
271 |
public void addAnnotationTypeSummary(SortedSet<TypeElement> annoTypes, Content summaryContentTree) { |
|
272 |
String label = resources.getText("doclet.Annotation_Types_Summary"); |
|
273 |
String tableSummary = resources.getText("doclet.Member_Table_Summary", |
|
274 |
resources.getText("doclet.Annotation_Types_Summary"), |
|
275 |
resources.getText("doclet.annotationtypes")); |
|
276 |
TableHeader tableHeader= new TableHeader(contents.annotationType, contents.descriptionLabel); |
|
277 |
||
278 |
addClassesSummary(annoTypes, label, tableSummary, tableHeader, summaryContentTree); |
|
279 |
} |
|
280 |
||
281 |
/** |
|
282 |
* {@inheritDoc} |
|
283 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
284 |
public void addClassesSummary(SortedSet<TypeElement> classes, String label, |
47427 | 285 |
String tableSummary, TableHeader tableHeader, Content summaryContentTree) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
286 |
if(!classes.isEmpty()) { |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
287 |
Content caption = getTableCaption(new RawHtml(label)); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
288 |
Content table = (configuration.isOutputHtml5()) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
289 |
? HtmlTree.TABLE(HtmlStyle.typeSummary, caption) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
290 |
: HtmlTree.TABLE(HtmlStyle.typeSummary, tableSummary, caption); |
47427 | 291 |
table.addContent(tableHeader.toContent()); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
292 |
Content tbody = new HtmlTree(HtmlTag.TBODY); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
293 |
boolean altColor = false; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
294 |
for (TypeElement klass : classes) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
295 |
if (!utils.isCoreClass(klass) || |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
296 |
!configuration.isGeneratedDoc(klass)) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
297 |
continue; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
298 |
} |
47449
afa66f3c34c1
8189841: Error in alternate row coloring in package-summary files
jjg
parents:
47427
diff
changeset
|
299 |
altColor = !altColor; |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
300 |
Content classContent = getLink(new LinkInfoImpl( |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
301 |
configuration, LinkInfoImpl.Kind.PACKAGE, klass)); |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
302 |
Content thClass = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, classContent); |
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
40587
diff
changeset
|
303 |
HtmlTree tr = HtmlTree.TR(thClass); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
304 |
tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
305 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
306 |
HtmlTree tdClassDescription = new HtmlTree(HtmlTag.TD); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
307 |
tdClassDescription.addStyle(HtmlStyle.colLast); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
308 |
if (utils.isDeprecated(klass)) { |
42816
3638773ff1b0
8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents:
41453
diff
changeset
|
309 |
tdClassDescription.addContent(getDeprecatedPhrase(klass)); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
310 |
List<? extends DocTree> tags = utils.getDeprecatedTrees(klass); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
311 |
if (!tags.isEmpty()) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
312 |
addSummaryDeprecatedComment(klass, tags.get(0), tdClassDescription); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
313 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
314 |
} else { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
315 |
addSummaryComment(klass, tdClassDescription); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
316 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
317 |
tr.addContent(tdClassDescription); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
318 |
tbody.addContent(tr); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
319 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
320 |
table.addContent(tbody); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
321 |
Content li = HtmlTree.LI(HtmlStyle.blockList, table); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
322 |
summaryContentTree.addContent(li); |
10 | 323 |
} |
324 |
} |
|
325 |
||
326 |
/** |
|
327 |
* {@inheritDoc} |
|
328 |
*/ |
|
40587 | 329 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
330 |
public void addPackageDescription(Content packageContentTree) { |
41453
5429549751ad
4649116: Add option to include full package description at top, before interface table
bpatel
parents:
41452
diff
changeset
|
331 |
if (!utils.getBody(packageElement).isEmpty()) { |
5429549751ad
4649116: Add option to include full package description at top, before interface table
bpatel
parents:
41452
diff
changeset
|
332 |
Content tree = configuration.allowTag(HtmlTag.SECTION) ? sectionTree : packageContentTree; |
46081
7c6d73d10b6b
8185194: Missing anchor for package description in package-summary.html pages
pmuthuswamy
parents:
45417
diff
changeset
|
333 |
tree.addContent(getMarkerAnchor(SectionName.PACKAGE_DESCRIPTION)); |
41453
5429549751ad
4649116: Add option to include full package description at top, before interface table
bpatel
parents:
41452
diff
changeset
|
334 |
addDeprecationInfo(tree); |
5429549751ad
4649116: Add option to include full package description at top, before interface table
bpatel
parents:
41452
diff
changeset
|
335 |
addInlineComment(packageElement, tree); |
10 | 336 |
} |
337 |
} |
|
338 |
||
339 |
/** |
|
340 |
* {@inheritDoc} |
|
341 |
*/ |
|
40587 | 342 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
343 |
public void addPackageTags(Content packageContentTree) { |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
344 |
Content htmlTree = (configuration.allowTag(HtmlTag.SECTION)) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
345 |
? sectionTree |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
346 |
: packageContentTree; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
347 |
addTagsInfo(packageElement, htmlTree); |
41453
5429549751ad
4649116: Add option to include full package description at top, before interface table
bpatel
parents:
41452
diff
changeset
|
348 |
if (configuration.allowTag(HtmlTag.SECTION)) { |
5429549751ad
4649116: Add option to include full package description at top, before interface table
bpatel
parents:
41452
diff
changeset
|
349 |
packageContentTree.addContent(sectionTree); |
5429549751ad
4649116: Add option to include full package description at top, before interface table
bpatel
parents:
41452
diff
changeset
|
350 |
} |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
351 |
} |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
352 |
|
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
353 |
/** |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
354 |
* {@inheritDoc} |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
355 |
*/ |
40587 | 356 |
@Override |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
357 |
public void addPackageContent(Content contentTree, Content packageContentTree) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
358 |
if (configuration.allowTag(HtmlTag.MAIN)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
359 |
mainTree.addContent(packageContentTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
360 |
contentTree.addContent(mainTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
361 |
} else { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
362 |
contentTree.addContent(packageContentTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
363 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
364 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
365 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
366 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
367 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
368 |
*/ |
40587 | 369 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
370 |
public void addPackageFooter(Content contentTree) { |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
371 |
Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
372 |
? HtmlTree.FOOTER() |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
373 |
: contentTree; |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
374 |
addNavLinks(false, htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
375 |
addBottom(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
376 |
if (configuration.allowTag(HtmlTag.FOOTER)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
377 |
contentTree.addContent(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26664
diff
changeset
|
378 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
379 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
380 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
381 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
382 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
383 |
*/ |
40587 | 384 |
@Override |
385 |
public void printDocument(Content contentTree) throws DocFileIOException { |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
386 |
printHtmlDocument(configuration.metakeywords.getMetaKeywords(packageElement), |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
387 |
true, contentTree); |
10 | 388 |
} |
389 |
||
390 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
391 |
* Get "Use" link for this pacakge in the navigation bar. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
392 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
393 |
* @return a content tree for the class use link |
10 | 394 |
*/ |
40587 | 395 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
396 |
protected Content getNavLinkClassUse() { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
397 |
Content useLink = getHyperLink(DocPaths.PACKAGE_USE, |
40303 | 398 |
contents.useLabel, "", ""); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
399 |
Content li = HtmlTree.LI(useLink); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
400 |
return li; |
10 | 401 |
} |
402 |
||
403 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
404 |
* Get "PREV PACKAGE" link in the navigation bar. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
405 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
406 |
* @return a content tree for the previous link |
10 | 407 |
*/ |
40587 | 408 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
409 |
public Content getNavLinkPrevious() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
410 |
Content li; |
10 | 411 |
if (prev == null) { |
40303 | 412 |
li = HtmlTree.LI(contents.prevPackageLabel); |
10 | 413 |
} else { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
414 |
DocPath path = DocPath.relativePath(packageElement, prev); |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
415 |
li = HtmlTree.LI(getHyperLink(path.resolve(DocPaths.PACKAGE_SUMMARY), |
40303 | 416 |
contents.prevPackageLabel, "", "")); |
10 | 417 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
418 |
return li; |
10 | 419 |
} |
420 |
||
421 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
422 |
* Get "NEXT PACKAGE" link in the navigation bar. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
423 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
424 |
* @return a content tree for the next link |
10 | 425 |
*/ |
40587 | 426 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
427 |
public Content getNavLinkNext() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
428 |
Content li; |
10 | 429 |
if (next == null) { |
40303 | 430 |
li = HtmlTree.LI(contents.nextPackageLabel); |
10 | 431 |
} else { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
432 |
DocPath path = DocPath.relativePath(packageElement, next); |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
433 |
li = HtmlTree.LI(getHyperLink(path.resolve(DocPaths.PACKAGE_SUMMARY), |
40303 | 434 |
contents.nextPackageLabel, "", "")); |
10 | 435 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
436 |
return li; |
10 | 437 |
} |
438 |
||
439 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
440 |
* Get "Tree" link in the navigation bar. This will be link to the package |
10 | 441 |
* tree file. |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
442 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
443 |
* @return a content tree for the tree link |
10 | 444 |
*/ |
40587 | 445 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
446 |
protected Content getNavLinkTree() { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
447 |
Content useLink = getHyperLink(DocPaths.PACKAGE_TREE, |
40303 | 448 |
contents.treeLabel, "", ""); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
449 |
Content li = HtmlTree.LI(useLink); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
450 |
return li; |
10 | 451 |
} |
452 |
||
453 |
/** |
|
37943
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
36526
diff
changeset
|
454 |
* Get the module link. |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
36526
diff
changeset
|
455 |
* |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
36526
diff
changeset
|
456 |
* @return a content tree for the module link |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
36526
diff
changeset
|
457 |
*/ |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
36526
diff
changeset
|
458 |
@Override |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
36526
diff
changeset
|
459 |
protected Content getNavLinkModule() { |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
36526
diff
changeset
|
460 |
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement), |
40303 | 461 |
contents.moduleLabel); |
37943
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
36526
diff
changeset
|
462 |
Content li = HtmlTree.LI(linkContent); |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
36526
diff
changeset
|
463 |
return li; |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
36526
diff
changeset
|
464 |
} |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
36526
diff
changeset
|
465 |
|
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
36526
diff
changeset
|
466 |
/** |
10 | 467 |
* Highlight "Package" in the navigation bar, as this is the package page. |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
468 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
469 |
* @return a content tree for the package link |
10 | 470 |
*/ |
40587 | 471 |
@Override |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
472 |
protected Content getNavLinkPackage() { |
40303 | 473 |
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.packageLabel); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
474 |
return li; |
10 | 475 |
} |
476 |
} |