author | jjg |
Mon, 22 Jan 2018 11:15:51 -0800 | |
changeset 48654 | 36f58bd6269f |
parent 47850 | 4a28dc8a86c2 |
child 48759 | ffa68af7da87 |
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 |
|
47846 | 28 |
import jdk.javadoc.internal.doclets.formats.html.markup.Table; |
29 |
||
47427 | 30 |
import java.text.MessageFormat; |
19512
07dcf1232608
8013887: In class use, some tables are randomly unsorted
jjg
parents:
17570
diff
changeset
|
31 |
import java.util.ArrayList; |
07dcf1232608
8013887: In class use, some tables are randomly unsorted
jjg
parents:
17570
diff
changeset
|
32 |
import java.util.Collections; |
07dcf1232608
8013887: In class use, some tables are randomly unsorted
jjg
parents:
17570
diff
changeset
|
33 |
import java.util.HashMap; |
07dcf1232608
8013887: In class use, some tables are randomly unsorted
jjg
parents:
17570
diff
changeset
|
34 |
import java.util.List; |
07dcf1232608
8013887: In class use, some tables are randomly unsorted
jjg
parents:
17570
diff
changeset
|
35 |
import java.util.Map; |
07dcf1232608
8013887: In class use, some tables are randomly unsorted
jjg
parents:
17570
diff
changeset
|
36 |
import java.util.Set; |
07dcf1232608
8013887: In class use, some tables are randomly unsorted
jjg
parents:
17570
diff
changeset
|
37 |
import java.util.SortedSet; |
07dcf1232608
8013887: In class use, some tables are randomly unsorted
jjg
parents:
17570
diff
changeset
|
38 |
import java.util.TreeSet; |
14258 | 39 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
40 |
import javax.lang.model.element.Element; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
41 |
import javax.lang.model.element.PackageElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
42 |
import javax.lang.model.element.TypeElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
43 |
import javax.tools.Diagnostic; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
44 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
45 |
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
46 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
47 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
48 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
49 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
47850 | 50 |
import jdk.javadoc.internal.doclets.formats.html.markup.Links; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
51 |
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
52 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
53 |
import jdk.javadoc.internal.doclets.toolkit.util.ClassTree; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
54 |
import jdk.javadoc.internal.doclets.toolkit.util.ClassUseMapper; |
40587 | 55 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
56 |
import jdk.javadoc.internal.doclets.toolkit.util.DocPath; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
57 |
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
10 | 58 |
|
42277 | 59 |
|
10 | 60 |
/** |
61 |
* Generate class usage information. |
|
62 |
* |
|
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
63 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
64 |
* 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
|
65 |
* 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
|
66 |
* deletion without notice.</b> |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
67 |
* |
10 | 68 |
* @author Robert G. Field |
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1789
diff
changeset
|
69 |
* @author Bhavesh Patel (Modified) |
10 | 70 |
*/ |
71 |
public class ClassUseWriter extends SubWriterHolderWriter { |
|
72 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
73 |
final TypeElement typeElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
74 |
Set<PackageElement> pkgToPackageAnnotations = null; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
75 |
final Map<PackageElement, List<Element>> pkgToClassTypeParameter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
76 |
final Map<PackageElement, List<Element>> pkgToClassAnnotations; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
77 |
final Map<PackageElement, List<Element>> pkgToMethodTypeParameter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
78 |
final Map<PackageElement, List<Element>> pkgToMethodArgTypeParameter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
79 |
final Map<PackageElement, List<Element>> pkgToMethodReturnTypeParameter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
80 |
final Map<PackageElement, List<Element>> pkgToMethodAnnotations; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
81 |
final Map<PackageElement, List<Element>> pkgToMethodParameterAnnotations; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
82 |
final Map<PackageElement, List<Element>> pkgToFieldTypeParameter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
83 |
final Map<PackageElement, List<Element>> pkgToFieldAnnotations; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
84 |
final Map<PackageElement, List<Element>> pkgToSubclass; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
85 |
final Map<PackageElement, List<Element>> pkgToSubinterface; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
86 |
final Map<PackageElement, List<Element>> pkgToImplementingClass; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
87 |
final Map<PackageElement, List<Element>> pkgToField; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
88 |
final Map<PackageElement, List<Element>> pkgToMethodReturn; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
89 |
final Map<PackageElement, List<Element>> pkgToMethodArgs; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
90 |
final Map<PackageElement, List<Element>> pkgToMethodThrows; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
91 |
final Map<PackageElement, List<Element>> pkgToConstructorAnnotations; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
92 |
final Map<PackageElement, List<Element>> pkgToConstructorParameterAnnotations; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
93 |
final Map<PackageElement, List<Element>> pkgToConstructorArgs; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
94 |
final Map<PackageElement, List<Element>> pkgToConstructorArgTypeParameter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
95 |
final Map<PackageElement, List<Element>> pkgToConstructorThrows; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
96 |
final SortedSet<PackageElement> pkgSet; |
10 | 97 |
final MethodWriterImpl methodSubWriter; |
98 |
final ConstructorWriterImpl constrSubWriter; |
|
99 |
final FieldWriterImpl fieldSubWriter; |
|
100 |
final NestedClassWriterImpl classSubWriter; |
|
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1789
diff
changeset
|
101 |
// Summary for various use tables. |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1789
diff
changeset
|
102 |
final String classUseTableSummary; |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1789
diff
changeset
|
103 |
final String subclassUseTableSummary; |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1789
diff
changeset
|
104 |
final String subinterfaceUseTableSummary; |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1789
diff
changeset
|
105 |
final String fieldUseTableSummary; |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1789
diff
changeset
|
106 |
final String methodUseTableSummary; |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1789
diff
changeset
|
107 |
final String constructorUseTableSummary; |
47427 | 108 |
final String packageUseTableSummary; |
10 | 109 |
|
110 |
/** |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
111 |
* The HTML tree for main tag. |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
112 |
*/ |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
113 |
protected HtmlTree mainTree = HtmlTree.MAIN(); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
114 |
|
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
115 |
/** |
10 | 116 |
* Constructor. |
117 |
* |
|
118 |
* @param filename the file to be generated. |
|
119 |
*/ |
|
45417 | 120 |
public ClassUseWriter(HtmlConfiguration configuration, |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14260
diff
changeset
|
121 |
ClassUseMapper mapper, DocPath filename, |
40587 | 122 |
TypeElement typeElement) { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14260
diff
changeset
|
123 |
super(configuration, filename); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
124 |
this.typeElement = typeElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
125 |
if (mapper.classToPackageAnnotations.containsKey(typeElement)) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
126 |
pkgToPackageAnnotations = new TreeSet<>(utils.makeClassUseComparator()); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
127 |
pkgToPackageAnnotations.addAll(mapper.classToPackageAnnotations.get(typeElement)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
128 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
129 |
configuration.currentTypeElement = typeElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
130 |
this.pkgSet = new TreeSet<>(utils.makePackageComparator()); |
10 | 131 |
this.pkgToClassTypeParameter = pkgDivide(mapper.classToClassTypeParam); |
132 |
this.pkgToClassAnnotations = pkgDivide(mapper.classToClassAnnotations); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
133 |
this.pkgToMethodTypeParameter = pkgDivide(mapper.classToMethodTypeParam); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
134 |
this.pkgToMethodArgTypeParameter = pkgDivide(mapper.classToMethodArgTypeParam); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
135 |
this.pkgToFieldTypeParameter = pkgDivide(mapper.classToFieldTypeParam); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
136 |
this.pkgToFieldAnnotations = pkgDivide(mapper.annotationToField); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
137 |
this.pkgToMethodReturnTypeParameter = pkgDivide(mapper.classToMethodReturnTypeParam); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
138 |
this.pkgToMethodAnnotations = pkgDivide(mapper.classToMethodAnnotations); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
139 |
this.pkgToMethodParameterAnnotations = pkgDivide(mapper.classToMethodParamAnnotation); |
10 | 140 |
this.pkgToSubclass = pkgDivide(mapper.classToSubclass); |
141 |
this.pkgToSubinterface = pkgDivide(mapper.classToSubinterface); |
|
142 |
this.pkgToImplementingClass = pkgDivide(mapper.classToImplementingClass); |
|
143 |
this.pkgToField = pkgDivide(mapper.classToField); |
|
144 |
this.pkgToMethodReturn = pkgDivide(mapper.classToMethodReturn); |
|
145 |
this.pkgToMethodArgs = pkgDivide(mapper.classToMethodArgs); |
|
146 |
this.pkgToMethodThrows = pkgDivide(mapper.classToMethodThrows); |
|
147 |
this.pkgToConstructorAnnotations = pkgDivide(mapper.classToConstructorAnnotations); |
|
148 |
this.pkgToConstructorParameterAnnotations = pkgDivide(mapper.classToConstructorParamAnnotation); |
|
149 |
this.pkgToConstructorArgs = pkgDivide(mapper.classToConstructorArgs); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
150 |
this.pkgToConstructorArgTypeParameter = pkgDivide(mapper.classToConstructorArgTypeParam); |
10 | 151 |
this.pkgToConstructorThrows = pkgDivide(mapper.classToConstructorThrows); |
152 |
//tmp test |
|
153 |
if (pkgSet.size() > 0 && |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
154 |
mapper.classToPackage.containsKey(this.typeElement) && |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
155 |
!pkgSet.equals(mapper.classToPackage.get(this.typeElement))) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
156 |
configuration.reporter.print(Diagnostic.Kind.WARNING, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
157 |
"Internal error: package sets don't match: " |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
158 |
+ pkgSet + " with: " + mapper.classToPackage.get(this.typeElement)); |
10 | 159 |
} |
47427 | 160 |
|
10 | 161 |
methodSubWriter = new MethodWriterImpl(this); |
162 |
constrSubWriter = new ConstructorWriterImpl(this); |
|
163 |
fieldSubWriter = new FieldWriterImpl(this); |
|
164 |
classSubWriter = new NestedClassWriterImpl(this); |
|
47427 | 165 |
|
166 |
String useTableSummary = resources.getText("doclet.Use_Table_Summary"); |
|
167 |
classUseTableSummary = MessageFormat.format(useTableSummary, |
|
168 |
resources.getText("doclet.classes")); |
|
169 |
subclassUseTableSummary = MessageFormat.format(useTableSummary, |
|
170 |
resources.getText("doclet.subclasses")); |
|
171 |
subinterfaceUseTableSummary = MessageFormat.format(useTableSummary, |
|
172 |
resources.getText("doclet.subinterfaces")); |
|
173 |
fieldUseTableSummary = MessageFormat.format(useTableSummary, |
|
174 |
resources.getText("doclet.fields")); |
|
175 |
methodUseTableSummary = MessageFormat.format(useTableSummary, |
|
176 |
resources.getText("doclet.methods")); |
|
177 |
constructorUseTableSummary = MessageFormat.format(useTableSummary, |
|
178 |
resources.getText("doclet.constructors")); |
|
179 |
packageUseTableSummary = MessageFormat.format(useTableSummary, |
|
180 |
resources.getText("doclet.packages")); |
|
10 | 181 |
} |
182 |
||
183 |
/** |
|
184 |
* Write out class use pages. |
|
40587 | 185 |
* |
186 |
* @param configuration the configuration for this doclet |
|
187 |
* @param classtree the class tree hierarchy |
|
188 |
* @throws DocFileIOException if there is an error while generating the documentation |
|
10 | 189 |
*/ |
45417 | 190 |
public static void generate(HtmlConfiguration configuration, ClassTree classtree) throws DocFileIOException { |
26270
a3635e6d3d78
8050031: [javadoc] class-use pages have duplicates and missing entries
ksrini
parents:
25874
diff
changeset
|
191 |
ClassUseMapper mapper = new ClassUseMapper(configuration, classtree); |
42277 | 192 |
for (TypeElement aClass : configuration.getIncludedTypeElements()) { |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
8841
diff
changeset
|
193 |
// If -nodeprecated option is set and the containing package is marked |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
8841
diff
changeset
|
194 |
// as deprecated, do not generate the class-use page. We will still generate |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
8841
diff
changeset
|
195 |
// the class-use page if the class is marked as deprecated but the containing |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
8841
diff
changeset
|
196 |
// package is not since it could still be linked from that package-use page. |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
8841
diff
changeset
|
197 |
if (!(configuration.nodeprecated && |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
198 |
configuration.utils.isDeprecated(configuration.utils.containingPackage(aClass)))) |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
20613
diff
changeset
|
199 |
ClassUseWriter.generate(configuration, mapper, aClass); |
10 | 200 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
201 |
for (PackageElement pkg : configuration.packages) { |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
8841
diff
changeset
|
202 |
// If -nodeprecated option is set and the package is marked |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
8841
diff
changeset
|
203 |
// as deprecated, do not generate the package-use page. |
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24297
diff
changeset
|
204 |
if (!(configuration.nodeprecated && configuration.utils.isDeprecated(pkg))) |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
20613
diff
changeset
|
205 |
PackageUseWriter.generate(configuration, mapper, pkg); |
10 | 206 |
} |
207 |
} |
|
208 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
209 |
private Map<PackageElement, List<Element>> pkgDivide(Map<TypeElement, ? extends List<? extends Element>> classMap) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
210 |
Map<PackageElement, List<Element>> map = new HashMap<>(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
211 |
List<? extends Element> elements = (List<? extends Element>) classMap.get(typeElement); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
212 |
if (elements != null) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
213 |
Collections.sort(elements, utils.makeClassUseComparator()); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
214 |
for (Element e : elements) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
215 |
PackageElement pkg = utils.containingPackage(e); |
10 | 216 |
pkgSet.add(pkg); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
217 |
List<Element> inPkg = map.get(pkg); |
10 | 218 |
if (inPkg == null) { |
22163 | 219 |
inPkg = new ArrayList<>(); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
220 |
map.put(pkg, inPkg); |
10 | 221 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
222 |
inPkg.add(e); |
10 | 223 |
} |
224 |
} |
|
225 |
return map; |
|
226 |
} |
|
227 |
||
228 |
/** |
|
229 |
* Generate a class page. |
|
40587 | 230 |
* |
231 |
* @throws DocFileIOException if there is a problem while generating the documentation |
|
10 | 232 |
*/ |
45417 | 233 |
public static void generate(HtmlConfiguration configuration, ClassUseMapper mapper, |
40587 | 234 |
TypeElement typeElement) throws DocFileIOException { |
10 | 235 |
ClassUseWriter clsgen; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
236 |
DocPath path = DocPath.forPackage(configuration.utils, typeElement) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
237 |
.resolve(DocPaths.CLASS_USE) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
238 |
.resolve(DocPath.forName(configuration.utils, typeElement)); |
40587 | 239 |
clsgen = new ClassUseWriter(configuration, mapper, path, typeElement); |
240 |
clsgen.generateClassUseFile(); |
|
10 | 241 |
} |
242 |
||
243 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
244 |
* Generate the class use elements. |
40587 | 245 |
* |
246 |
* @throws DocFileIOException if there is a problem while generating the documentation |
|
10 | 247 |
*/ |
40587 | 248 |
protected void generateClassUseFile() throws DocFileIOException { |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
249 |
HtmlTree body = getClassUseHeader(); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
250 |
HtmlTree div = new HtmlTree(HtmlTag.DIV); |
47846 | 251 |
div.setStyle(HtmlStyle.classUseContainer); |
10 | 252 |
if (pkgSet.size() > 0) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
253 |
addClassUse(div); |
10 | 254 |
} else { |
40303 | 255 |
div.addContent(contents.getContent("doclet.ClassUse_No.usage.of.0", |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
256 |
utils.getFullyQualifiedName(typeElement))); |
10 | 257 |
} |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
258 |
if (configuration.allowTag(HtmlTag.MAIN)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
259 |
mainTree.addContent(div); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
260 |
body.addContent(mainTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
261 |
} else { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
262 |
body.addContent(div); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
263 |
} |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
264 |
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
265 |
? HtmlTree.FOOTER() |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
266 |
: body; |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
267 |
addNavLinks(false, htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
268 |
addBottom(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
269 |
if (configuration.allowTag(HtmlTag.FOOTER)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
270 |
body.addContent(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
271 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
272 |
printHtmlDocument(null, true, body); |
10 | 273 |
} |
274 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
275 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
276 |
* Add the class use documentation. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
277 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
278 |
* @param contentTree the content tree to which the class use information will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
279 |
*/ |
40587 | 280 |
protected void addClassUse(Content contentTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
281 |
HtmlTree ul = new HtmlTree(HtmlTag.UL); |
47846 | 282 |
ul.setStyle(HtmlStyle.blockList); |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
24220
diff
changeset
|
283 |
if (configuration.packages.size() > 1) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
284 |
addPackageList(ul); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
285 |
addPackageAnnotationList(ul); |
10 | 286 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
287 |
addClassList(ul); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
288 |
contentTree.addContent(ul); |
10 | 289 |
} |
290 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
291 |
/** |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
292 |
* Add the packages elements that use the given class. |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
293 |
* |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
294 |
* @param contentTree the content tree to which the packages elements will be added |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
295 |
*/ |
40587 | 296 |
protected void addPackageList(Content contentTree) { |
47846 | 297 |
Content caption = getTableCaption(contents.getContent( |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
298 |
"doclet.ClassUse_Packages.that.use.0", |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
299 |
getLink(new LinkInfoImpl(configuration, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
300 |
LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement)))); |
47846 | 301 |
Table table = new Table(configuration.htmlVersion, HtmlStyle.useSummary) |
302 |
.setSummary(packageUseTableSummary) |
|
303 |
.setCaption(caption) |
|
304 |
.setHeader(getPackageTableHeader()) |
|
305 |
.setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
306 |
for (PackageElement pkg : pkgSet) { |
47846 | 307 |
addPackageUse(pkg, table); |
10 | 308 |
} |
47846 | 309 |
Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent()); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
310 |
contentTree.addContent(li); |
10 | 311 |
} |
312 |
||
313 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
314 |
* Add the package annotation elements. |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
315 |
* |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
316 |
* @param contentTree the content tree to which the package annotation elements will be added |
10 | 317 |
*/ |
40587 | 318 |
protected void addPackageAnnotationList(Content contentTree) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
319 |
if (!utils.isAnnotationType(typeElement) || |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
320 |
pkgToPackageAnnotations == null || |
14542 | 321 |
pkgToPackageAnnotations.isEmpty()) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
322 |
return; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
323 |
} |
47846 | 324 |
Content caption = getTableCaption(contents.getContent( |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
325 |
"doclet.ClassUse_PackageAnnotation", |
14542 | 326 |
getLink(new LinkInfoImpl(configuration, |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
327 |
LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement)))); |
47846 | 328 |
|
329 |
Table table = new Table(configuration.htmlVersion, HtmlStyle.useSummary) |
|
330 |
.setSummary(packageUseTableSummary) |
|
331 |
.setCaption(caption) |
|
332 |
.setHeader(getPackageTableHeader()) |
|
333 |
.setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
334 |
for (PackageElement pkg : pkgToPackageAnnotations) { |
47846 | 335 |
Content summary = new ContentBuilder(); |
336 |
addSummaryComment(pkg, summary); |
|
337 |
table.addRow(getPackageLink(pkg), summary); |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
338 |
} |
47846 | 339 |
Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent()); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
340 |
contentTree.addContent(li); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
341 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
342 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
343 |
/** |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
344 |
* Add the class elements that use the given class. |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
345 |
* |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
346 |
* @param contentTree the content tree to which the class elements will be added |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
347 |
*/ |
40587 | 348 |
protected void addClassList(Content contentTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
349 |
HtmlTree ul = new HtmlTree(HtmlTag.UL); |
47846 | 350 |
ul.setStyle(HtmlStyle.blockList); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
351 |
for (PackageElement pkg : pkgSet) { |
47850 | 352 |
Content markerAnchor = links.createAnchor(getPackageAnchorName(pkg)); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
353 |
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.SECTION)) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
354 |
? HtmlTree.SECTION(markerAnchor) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
355 |
: HtmlTree.LI(HtmlStyle.blockList, markerAnchor); |
40303 | 356 |
Content link = contents.getContent("doclet.ClassUse_Uses.of.0.in.1", |
357 |
getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, |
|
358 |
typeElement)), |
|
359 |
getPackageLink(pkg, utils.getPackageName(pkg))); |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
360 |
Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
361 |
htmlTree.addContent(heading); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
362 |
addClassUse(pkg, htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
363 |
if (configuration.allowTag(HtmlTag.SECTION)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
364 |
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
365 |
} else { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
366 |
ul.addContent(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
367 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
368 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
369 |
Content li = HtmlTree.LI(HtmlStyle.blockList, ul); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
370 |
contentTree.addContent(li); |
10 | 371 |
} |
372 |
||
373 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
374 |
* Add the package use information. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
375 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
376 |
* @param pkg the package that uses the given class |
47846 | 377 |
* @param table the table to which the package use information will be added |
10 | 378 |
*/ |
47846 | 379 |
protected void addPackageUse(PackageElement pkg, Table table) { |
380 |
Content pkgLink = |
|
47850 | 381 |
links.createLink(getPackageAnchorName(pkg), new StringContent(utils.getPackageName(pkg))); |
47846 | 382 |
Content summary = new ContentBuilder(); |
383 |
addSummaryComment(pkg, summary); |
|
384 |
table.addRow(pkgLink, summary); |
|
10 | 385 |
} |
386 |
||
387 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
388 |
* Add the class use information. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
389 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
390 |
* @param pkg the package that uses the given class |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
391 |
* @param contentTree the content tree to which the class use information will be added |
10 | 392 |
*/ |
40587 | 393 |
protected void addClassUse(PackageElement pkg, Content contentTree) { |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
394 |
Content classLink = getLink(new LinkInfoImpl(configuration, |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
395 |
LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement)); |
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24297
diff
changeset
|
396 |
Content pkgLink = getPackageLink(pkg, utils.getPackageName(pkg)); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
397 |
classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg), |
40303 | 398 |
configuration.getContent("doclet.ClassUse_Annotation", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
399 |
pkgLink), classUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
400 |
classSubWriter.addUseInfo(pkgToClassTypeParameter.get(pkg), |
40303 | 401 |
configuration.getContent("doclet.ClassUse_TypeParameter", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
402 |
pkgLink), classUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
403 |
classSubWriter.addUseInfo(pkgToSubclass.get(pkg), |
40303 | 404 |
configuration.getContent("doclet.ClassUse_Subclass", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
405 |
pkgLink), subclassUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
406 |
classSubWriter.addUseInfo(pkgToSubinterface.get(pkg), |
40303 | 407 |
configuration.getContent("doclet.ClassUse_Subinterface", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
408 |
pkgLink), subinterfaceUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
409 |
classSubWriter.addUseInfo(pkgToImplementingClass.get(pkg), |
40303 | 410 |
configuration.getContent("doclet.ClassUse_ImplementingClass", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
411 |
pkgLink), classUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
412 |
fieldSubWriter.addUseInfo(pkgToField.get(pkg), |
40303 | 413 |
configuration.getContent("doclet.ClassUse_Field", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
414 |
pkgLink), fieldUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
415 |
fieldSubWriter.addUseInfo(pkgToFieldAnnotations.get(pkg), |
40303 | 416 |
configuration.getContent("doclet.ClassUse_FieldAnnotations", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
417 |
pkgLink), fieldUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
418 |
fieldSubWriter.addUseInfo(pkgToFieldTypeParameter.get(pkg), |
40303 | 419 |
configuration.getContent("doclet.ClassUse_FieldTypeParameter", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
420 |
pkgLink), fieldUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
421 |
methodSubWriter.addUseInfo(pkgToMethodAnnotations.get(pkg), |
40303 | 422 |
configuration.getContent("doclet.ClassUse_MethodAnnotations", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
423 |
pkgLink), methodUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
424 |
methodSubWriter.addUseInfo(pkgToMethodParameterAnnotations.get(pkg), |
40303 | 425 |
configuration.getContent("doclet.ClassUse_MethodParameterAnnotations", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
426 |
pkgLink), methodUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
427 |
methodSubWriter.addUseInfo(pkgToMethodTypeParameter.get(pkg), |
40303 | 428 |
configuration.getContent("doclet.ClassUse_MethodTypeParameter", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
429 |
pkgLink), methodUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
430 |
methodSubWriter.addUseInfo(pkgToMethodReturn.get(pkg), |
40303 | 431 |
configuration.getContent("doclet.ClassUse_MethodReturn", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
432 |
pkgLink), methodUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
433 |
methodSubWriter.addUseInfo(pkgToMethodReturnTypeParameter.get(pkg), |
40303 | 434 |
configuration.getContent("doclet.ClassUse_MethodReturnTypeParameter", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
435 |
pkgLink), methodUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
436 |
methodSubWriter.addUseInfo(pkgToMethodArgs.get(pkg), |
40303 | 437 |
configuration.getContent("doclet.ClassUse_MethodArgs", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
438 |
pkgLink), methodUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
439 |
methodSubWriter.addUseInfo(pkgToMethodArgTypeParameter.get(pkg), |
40303 | 440 |
configuration.getContent("doclet.ClassUse_MethodArgsTypeParameters", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
441 |
pkgLink), methodUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
442 |
methodSubWriter.addUseInfo(pkgToMethodThrows.get(pkg), |
40303 | 443 |
configuration.getContent("doclet.ClassUse_MethodThrows", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
444 |
pkgLink), methodUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
445 |
constrSubWriter.addUseInfo(pkgToConstructorAnnotations.get(pkg), |
40303 | 446 |
configuration.getContent("doclet.ClassUse_ConstructorAnnotations", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
447 |
pkgLink), constructorUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
448 |
constrSubWriter.addUseInfo(pkgToConstructorParameterAnnotations.get(pkg), |
40303 | 449 |
configuration.getContent("doclet.ClassUse_ConstructorParameterAnnotations", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
450 |
pkgLink), constructorUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
451 |
constrSubWriter.addUseInfo(pkgToConstructorArgs.get(pkg), |
40303 | 452 |
configuration.getContent("doclet.ClassUse_ConstructorArgs", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
453 |
pkgLink), constructorUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
454 |
constrSubWriter.addUseInfo(pkgToConstructorArgTypeParameter.get(pkg), |
40303 | 455 |
configuration.getContent("doclet.ClassUse_ConstructorArgsTypeParameters", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
456 |
pkgLink), constructorUseTableSummary, contentTree); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
457 |
constrSubWriter.addUseInfo(pkgToConstructorThrows.get(pkg), |
40303 | 458 |
configuration.getContent("doclet.ClassUse_ConstructorThrows", classLink, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
459 |
pkgLink), constructorUseTableSummary, contentTree); |
10 | 460 |
} |
461 |
||
462 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
463 |
* Get the header for the class use Listing. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
464 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
465 |
* @return a content tree representing the class use header |
10 | 466 |
*/ |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
467 |
protected HtmlTree getClassUseHeader() { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
468 |
String cltype = configuration.getText(utils.isInterface(typeElement) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
469 |
? "doclet.Interface" |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
470 |
: "doclet.Class"); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
471 |
String clname = utils.getFullyQualifiedName(typeElement); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
472 |
String title = configuration.getText("doclet.Window_ClassUse_Header", |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
473 |
cltype, clname); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
474 |
HtmlTree bodyTree = getBody(true, getWindowTitle(title)); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
475 |
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
476 |
? HtmlTree.HEADER() |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
477 |
: bodyTree; |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
478 |
addTop(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
479 |
addNavLinks(true, htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
480 |
if (configuration.allowTag(HtmlTag.HEADER)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
481 |
bodyTree.addContent(htmlTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
482 |
} |
17562
c84f1d7fa11d
8011662: Remove single instance of resource with HTML from doclet resource bundle
jjg
parents:
17561
diff
changeset
|
483 |
ContentBuilder headContent = new ContentBuilder(); |
40303 | 484 |
headContent.addContent(contents.getContent("doclet.ClassUse_Title", cltype)); |
17562
c84f1d7fa11d
8011662: Remove single instance of resource with HTML from doclet resource bundle
jjg
parents:
17561
diff
changeset
|
485 |
headContent.addContent(new HtmlTree(HtmlTag.BR)); |
c84f1d7fa11d
8011662: Remove single instance of resource with HTML from doclet resource bundle
jjg
parents:
17561
diff
changeset
|
486 |
headContent.addContent(clname); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
487 |
Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
488 |
true, HtmlStyle.title, headContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
489 |
Content div = HtmlTree.DIV(HtmlStyle.header, heading); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
490 |
if (configuration.allowTag(HtmlTag.MAIN)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
491 |
mainTree.addContent(div); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
492 |
} else { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
493 |
bodyTree.addContent(div); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
26900
diff
changeset
|
494 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
495 |
return bodyTree; |
10 | 496 |
} |
497 |
||
498 |
/** |
|
37943
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
35426
diff
changeset
|
499 |
* Get the module link. |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
35426
diff
changeset
|
500 |
* |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
35426
diff
changeset
|
501 |
* @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:
35426
diff
changeset
|
502 |
*/ |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
35426
diff
changeset
|
503 |
@Override |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
35426
diff
changeset
|
504 |
protected Content getNavLinkModule() { |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
35426
diff
changeset
|
505 |
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(typeElement), |
40303 | 506 |
contents.moduleLabel); |
37943
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
35426
diff
changeset
|
507 |
Content li = HtmlTree.LI(linkContent); |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
35426
diff
changeset
|
508 |
return li; |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
35426
diff
changeset
|
509 |
} |
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
35426
diff
changeset
|
510 |
|
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
35426
diff
changeset
|
511 |
/** |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
512 |
* Get this package link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
513 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
514 |
* @return a content tree for the package link |
10 | 515 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
516 |
protected Content getNavLinkPackage() { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14260
diff
changeset
|
517 |
Content linkContent = |
48654
36f58bd6269f
8195796: Reduce the size of relative URLs in generated docs
jjg
parents:
47850
diff
changeset
|
518 |
links.createLink(DocPath.parent.resolve(DocPaths.PACKAGE_SUMMARY), contents.packageLabel); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
519 |
Content li = HtmlTree.LI(linkContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
520 |
return li; |
10 | 521 |
} |
522 |
||
523 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
524 |
* Get class page link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
525 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
526 |
* @return a content tree for the class page link |
10 | 527 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
528 |
protected Content getNavLinkClass() { |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
529 |
Content linkContent = getLink(new LinkInfoImpl( |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
530 |
configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement) |
17561 | 531 |
.label(configuration.getText("doclet.Class"))); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
532 |
Content li = HtmlTree.LI(linkContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
533 |
return li; |
10 | 534 |
} |
535 |
||
536 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
537 |
* Get the use link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
538 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
539 |
* @return a content tree for the use link |
10 | 540 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
541 |
protected Content getNavLinkClassUse() { |
40303 | 542 |
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.useLabel); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
543 |
return li; |
10 | 544 |
} |
545 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
546 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
547 |
* Get the tree link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
548 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
549 |
* @return a content tree for the tree link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
550 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
551 |
protected Content getNavLinkTree() { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
552 |
Content linkContent = utils.isEnclosingPackageIncluded(typeElement) |
48654
36f58bd6269f
8195796: Reduce the size of relative URLs in generated docs
jjg
parents:
47850
diff
changeset
|
553 |
? links.createLink(DocPath.parent.resolve(DocPaths.PACKAGE_TREE), contents.treeLabel) |
36f58bd6269f
8195796: Reduce the size of relative URLs in generated docs
jjg
parents:
47850
diff
changeset
|
554 |
: links.createLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), contents.treeLabel); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
555 |
Content li = HtmlTree.LI(linkContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
556 |
return li; |
10 | 557 |
} |
558 |
} |