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