author | jjg |
Thu, 16 Nov 2017 15:16:21 -0800 | |
changeset 47850 | 4a28dc8a86c2 |
parent 47846 | 4e78aba768f0 |
child 48654 | 36f58bd6269f |
permissions | -rw-r--r-- |
10 | 1 |
/* |
47427 | 2 |
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. |
10 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5520 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
10 | 24 |
*/ |
25 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
26 |
package jdk.javadoc.internal.doclets.formats.html; |
10 | 27 |
|
47846 | 28 |
import jdk.javadoc.internal.doclets.formats.html.markup.Table; |
29 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
30 |
import java.util.Arrays; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
31 |
import java.util.List; |
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1787
diff
changeset
|
32 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
33 |
import javax.lang.model.element.Element; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
34 |
import javax.lang.model.element.ExecutableElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
35 |
import javax.lang.model.element.TypeElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
36 |
import javax.lang.model.type.TypeMirror; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
37 |
|
47846 | 38 |
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
39 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
40 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
41 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
42 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
47850 | 43 |
import jdk.javadoc.internal.doclets.formats.html.markup.Links; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
44 |
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
45 |
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeRequiredMemberWriter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
46 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
47 |
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
48 |
|
10 | 49 |
|
50 |
/** |
|
51 |
* Writes annotation type required member documentation in HTML format. |
|
52 |
* |
|
14260 | 53 |
* <p><b>This is NOT part of any supported API. |
54 |
* If you write code that depends on this, you do so at your own risk. |
|
55 |
* This code and its internal interfaces are subject to change or |
|
56 |
* deletion without notice.</b> |
|
57 |
* |
|
10 | 58 |
* @author Jamie Ho |
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
59 |
* @author Bhavesh Patel (Modified) |
10 | 60 |
*/ |
61 |
public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter |
|
62 |
implements AnnotationTypeRequiredMemberWriter, MemberSummaryWriter { |
|
63 |
||
64 |
/** |
|
65 |
* Construct a new AnnotationTypeRequiredMemberWriterImpl. |
|
66 |
* |
|
67 |
* @param writer the writer that will write the output. |
|
68 |
* @param annotationType the AnnotationType that holds this member. |
|
69 |
*/ |
|
70 |
public AnnotationTypeRequiredMemberWriterImpl(SubWriterHolderWriter writer, |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
71 |
TypeElement annotationType) { |
10 | 72 |
super(writer, annotationType); |
73 |
} |
|
74 |
||
75 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
76 |
* {@inheritDoc} |
10 | 77 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
78 |
public Content getMemberSummaryHeader(TypeElement typeElement, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
79 |
Content memberSummaryTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
80 |
memberSummaryTree.addContent( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
81 |
HtmlConstants.START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
82 |
Content memberTree = writer.getMemberTreeHeader(); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
83 |
writer.addSummaryHeader(this, typeElement, memberTree); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
84 |
return memberTree; |
10 | 85 |
} |
86 |
||
87 |
/** |
|
88 |
* {@inheritDoc} |
|
89 |
*/ |
|
20237
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
90 |
public Content getMemberTreeHeader() { |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
91 |
return writer.getMemberTreeHeader(); |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
92 |
} |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
93 |
|
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
94 |
/** |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
95 |
* {@inheritDoc} |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
96 |
*/ |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
97 |
public void addMemberTree(Content memberSummaryTree, Content memberTree) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
98 |
writer.addMemberTree(memberSummaryTree, memberTree); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
99 |
} |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
100 |
|
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
101 |
/** |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
102 |
* {@inheritDoc} |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
103 |
*/ |
20237
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
104 |
public void addAnnotationDetailsMarker(Content memberDetails) { |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
105 |
memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_DETAILS); |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
106 |
} |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
107 |
|
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
108 |
/** |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
109 |
* {@inheritDoc} |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19253
diff
changeset
|
110 |
*/ |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40303
diff
changeset
|
111 |
public void addAnnotationDetailsTreeHeader(TypeElement te, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
112 |
Content memberDetailsTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
113 |
if (!writer.printedAnnotationHeading) { |
47850 | 114 |
memberDetailsTree.addContent(links.createAnchor( |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20237
diff
changeset
|
115 |
SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
116 |
Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, |
40303 | 117 |
contents.annotationTypeDetailsLabel); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
118 |
memberDetailsTree.addContent(heading); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
119 |
writer.printedAnnotationHeading = true; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
120 |
} |
10 | 121 |
} |
122 |
||
123 |
/** |
|
124 |
* {@inheritDoc} |
|
125 |
*/ |
|
47850 | 126 |
@Override |
127 |
public Content getAnnotationDocTreeHeader(Element member, Content annotationDetailsTree) { |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
128 |
String simpleName = name(member); |
47850 | 129 |
annotationDetailsTree.addContent(links.createAnchor( |
130 |
simpleName + utils.signature((ExecutableElement) member))); |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
131 |
Content annotationDocTree = writer.getMemberTreeHeader(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
132 |
Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
133 |
heading.addContent(simpleName); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
134 |
annotationDocTree.addContent(heading); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
135 |
return annotationDocTree; |
10 | 136 |
} |
137 |
||
138 |
/** |
|
139 |
* {@inheritDoc} |
|
140 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
141 |
public Content getSignature(Element member) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
142 |
Content pre = new HtmlTree(HtmlTag.PRE); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
143 |
writer.addAnnotationInfo(member, pre); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
144 |
addModifiers(member, pre); |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
145 |
Content link = |
14542 | 146 |
writer.getLink(new LinkInfoImpl(configuration, |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
147 |
LinkInfoImpl.Kind.MEMBER, getType(member))); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
148 |
pre.addContent(link); |
40303 | 149 |
pre.addContent(Contents.SPACE); |
14542 | 150 |
if (configuration.linksource) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
151 |
Content memberName = new StringContent(name(member)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
152 |
writer.addSrcLink(member, memberName, pre); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
153 |
} else { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
154 |
addName(name(member), pre); |
10 | 155 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
156 |
return pre; |
10 | 157 |
} |
158 |
||
159 |
/** |
|
160 |
* {@inheritDoc} |
|
161 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
162 |
public void addDeprecated(Element member, Content annotationDocTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
163 |
addDeprecatedInfo(member, annotationDocTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
164 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
165 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
166 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
167 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
168 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
169 |
public void addComments(Element member, Content annotationDocTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
170 |
addComment(member, annotationDocTree); |
10 | 171 |
} |
172 |
||
173 |
/** |
|
174 |
* {@inheritDoc} |
|
175 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
176 |
public void addTags(Element member, Content annotationDocTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
177 |
writer.addTagsInfo(member, annotationDocTree); |
10 | 178 |
} |
179 |
||
180 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
181 |
* {@inheritDoc} |
10 | 182 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
183 |
public Content getAnnotationDetails(Content annotationDetailsTree) { |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
184 |
if (configuration.allowTag(HtmlTag.SECTION)) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
185 |
HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(annotationDetailsTree)); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
186 |
return htmlTree; |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
187 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
188 |
return getMemberTree(annotationDetailsTree); |
10 | 189 |
} |
190 |
||
191 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
192 |
* {@inheritDoc} |
10 | 193 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
194 |
public Content getAnnotationDoc(Content annotationDocTree, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
195 |
boolean isLastContent) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
196 |
return getMemberTree(annotationDocTree, isLastContent); |
10 | 197 |
} |
198 |
||
199 |
/** |
|
200 |
* {@inheritDoc} |
|
201 |
*/ |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
202 |
public void addSummaryLabel(Content memberTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
203 |
Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, |
40303 | 204 |
contents.annotateTypeRequiredMemberSummaryLabel); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
205 |
memberTree.addContent(label); |
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
206 |
} |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
207 |
|
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
208 |
/** |
47846 | 209 |
* Get the summary for the member summary table. |
210 |
* |
|
211 |
* @return a string for the table summary |
|
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
212 |
*/ |
47846 | 213 |
// Overridden by AnnotationTypeOptionalMemberWriterImpl |
214 |
protected String getTableSummary() { |
|
215 |
return resources.getText("doclet.Member_Table_Summary", |
|
216 |
resources.getText("doclet.Annotation_Type_Required_Member_Summary"), |
|
217 |
resources.getText("doclet.annotation_type_required_members")); |
|
218 |
} |
|
219 |
||
220 |
/** |
|
221 |
* Get the caption for the summary table. |
|
222 |
* @return the caption |
|
223 |
*/ |
|
224 |
// Overridden by AnnotationTypeOptionalMemberWriterImpl |
|
225 |
protected Content getCaption() { |
|
226 |
return contents.getContent("doclet.Annotation_Type_Required_Members"); |
|
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
227 |
} |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
2216
diff
changeset
|
228 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
229 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
230 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
231 |
*/ |
47846 | 232 |
@Override |
233 |
public TableHeader getSummaryTableHeader(Element member) { |
|
234 |
return new TableHeader(contents.modifierAndTypeLabel, |
|
235 |
contents.annotationTypeRequiredMemberLabel, contents.descriptionLabel); |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
236 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
237 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
238 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
239 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
240 |
*/ |
47846 | 241 |
@Override |
242 |
protected Table createSummaryTable() { |
|
243 |
return new Table(configuration.htmlVersion, HtmlStyle.memberSummary) |
|
244 |
.setSummary(getTableSummary()) |
|
245 |
.setCaption(getCaption()) |
|
246 |
.setHeader(getSummaryTableHeader(typeElement)) |
|
247 |
.setRowScopeColumn(1) |
|
248 |
.setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast) |
|
249 |
.setUseTBody(false); // temporary? compatibility mode for TBody |
|
10 | 250 |
} |
251 |
||
252 |
/** |
|
253 |
* {@inheritDoc} |
|
254 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
255 |
public void addSummaryAnchor(TypeElement typeElement, Content memberTree) { |
47850 | 256 |
memberTree.addContent(links.createAnchor( |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20237
diff
changeset
|
257 |
SectionName.ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
258 |
} |
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 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
261 |
* {@inheritDoc} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
262 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
263 |
public void addInheritedSummaryAnchor(TypeElement typeElement, Content inheritedTree) { |
10 | 264 |
} |
265 |
||
266 |
/** |
|
267 |
* {@inheritDoc} |
|
268 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
269 |
public void addInheritedSummaryLabel(TypeElement typeElement, Content inheritedTree) { |
10 | 270 |
} |
271 |
||
272 |
/** |
|
273 |
* {@inheritDoc} |
|
274 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
275 |
protected void addSummaryLink(LinkInfoImpl.Kind context, TypeElement typeElement, Element member, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
276 |
Content tdSummary) { |
21478
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
21008
diff
changeset
|
277 |
Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink, |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
278 |
writer.getDocLink(context, member, name(member), false)); |
21478
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
21008
diff
changeset
|
279 |
Content code = HtmlTree.CODE(memberLink); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
280 |
tdSummary.addContent(code); |
10 | 281 |
} |
282 |
||
283 |
/** |
|
284 |
* {@inheritDoc} |
|
285 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
286 |
protected void addInheritedSummaryLink(TypeElement typeElement, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
287 |
Element member, Content linksTree) { |
10 | 288 |
//Not applicable. |
289 |
} |
|
290 |
||
291 |
/** |
|
292 |
* {@inheritDoc} |
|
293 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
294 |
protected void addSummaryType(Element member, Content tdSummaryType) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
295 |
addModifierAndType(member, getType(member), tdSummaryType); |
10 | 296 |
} |
297 |
||
298 |
/** |
|
299 |
* {@inheritDoc} |
|
300 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
301 |
protected Content getDeprecatedLink(Element member) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
302 |
String name = utils.getFullyQualifiedName(member) + "." + member.getSimpleName(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
303 |
return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, member, name); |
10 | 304 |
} |
305 |
||
306 |
/** |
|
307 |
* {@inheritDoc} |
|
308 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
309 |
protected Content getNavSummaryLink(TypeElement typeElement, boolean link) { |
10 | 310 |
if (link) { |
47850 | 311 |
return Links.createLink( |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20237
diff
changeset
|
312 |
SectionName.ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY, |
40303 | 313 |
contents.navAnnotationTypeRequiredMember); |
10 | 314 |
} else { |
40303 | 315 |
return contents.navAnnotationTypeRequiredMember; |
10 | 316 |
} |
317 |
} |
|
318 |
||
319 |
/** |
|
320 |
* {@inheritDoc} |
|
321 |
*/ |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
322 |
protected void addNavDetailLink(boolean link, Content liNav) { |
10 | 323 |
if (link) { |
47850 | 324 |
liNav.addContent(Links.createLink( |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20237
diff
changeset
|
325 |
SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL, |
40303 | 326 |
contents.navAnnotationTypeMember)); |
10 | 327 |
} else { |
40303 | 328 |
liNav.addContent(contents.navAnnotationTypeMember); |
10 | 329 |
} |
330 |
} |
|
331 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
332 |
private TypeMirror getType(Element member) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
333 |
return utils.isExecutableElement(member) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
334 |
? utils.getReturnType((ExecutableElement) member) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
335 |
: member.asType(); |
10 | 336 |
} |
337 |
} |