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