author | jjg |
Tue, 09 Oct 2012 19:10:00 -0700 | |
changeset 14258 | 8d2148961366 |
parent 9606 | e5a619cb5dd3 |
child 14259 | fb94a1df0d53 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
14258 | 2 |
* Copyright (c) 1997, 2012, 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 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
28 |
import java.io.*; |
14258 | 29 |
|
30 |
import com.sun.tools.doclets.formats.html.markup.*; |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
31 |
import com.sun.tools.doclets.internal.toolkit.*; |
10 | 32 |
import com.sun.tools.doclets.internal.toolkit.util.*; |
33 |
||
34 |
/** |
|
35 |
* Generate File to list all the deprecated classes and class members with the |
|
36 |
* appropriate links. |
|
37 |
* |
|
38 |
* @see java.util.List |
|
39 |
* @author Atul M Dambalkar |
|
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
40 |
* @author Bhavesh Patel (Modified) |
10 | 41 |
*/ |
42 |
public class DeprecatedListWriter extends SubWriterHolderWriter { |
|
43 |
||
44 |
private static final String[] ANCHORS = new String[] { |
|
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
45 |
"package", "interface", "class", "enum", "exception", "error", |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
46 |
"annotation_type", "field", "method", "constructor", "enum_constant", |
10 | 47 |
"annotation_type_member" |
48 |
}; |
|
49 |
||
50 |
private static final String[] HEADING_KEYS = new String[] { |
|
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
51 |
"doclet.Deprecated_Packages", "doclet.Deprecated_Interfaces", |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
52 |
"doclet.Deprecated_Classes", "doclet.Deprecated_Enums", |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
53 |
"doclet.Deprecated_Exceptions", "doclet.Deprecated_Errors", |
10 | 54 |
"doclet.Deprecated_Annotation_Types", |
55 |
"doclet.Deprecated_Fields", |
|
56 |
"doclet.Deprecated_Methods", "doclet.Deprecated_Constructors", |
|
57 |
"doclet.Deprecated_Enum_Constants", |
|
58 |
"doclet.Deprecated_Annotation_Type_Members" |
|
59 |
}; |
|
60 |
||
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
61 |
private static final String[] SUMMARY_KEYS = new String[] { |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
62 |
"doclet.deprecated_packages", "doclet.deprecated_interfaces", |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
63 |
"doclet.deprecated_classes", "doclet.deprecated_enums", |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
64 |
"doclet.deprecated_exceptions", "doclet.deprecated_errors", |
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
65 |
"doclet.deprecated_annotation_types", |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
66 |
"doclet.deprecated_fields", |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
67 |
"doclet.deprecated_methods", "doclet.deprecated_constructors", |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
68 |
"doclet.deprecated_enum_constants", |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
69 |
"doclet.deprecated_annotation_type_members" |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
70 |
}; |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
71 |
|
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
72 |
private static final String[] HEADER_KEYS = new String[] { |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
73 |
"doclet.Package", "doclet.Interface", "doclet.Class", |
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
74 |
"doclet.Enum", "doclet.Exceptions", |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
75 |
"doclet.Errors", |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
76 |
"doclet.AnnotationType", |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
77 |
"doclet.Field", |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
78 |
"doclet.Method", "doclet.Constructor", |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
79 |
"doclet.Enum_Constant", |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
80 |
"doclet.Annotation_Type_Member" |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
81 |
}; |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
82 |
|
10 | 83 |
private AbstractMemberWriter[] writers; |
84 |
||
85 |
private ConfigurationImpl configuration; |
|
86 |
||
87 |
/** |
|
88 |
* Constructor. |
|
89 |
* |
|
90 |
* @param filename the file to be generated. |
|
91 |
*/ |
|
92 |
public DeprecatedListWriter(ConfigurationImpl configuration, |
|
93 |
String filename) throws IOException { |
|
94 |
super(configuration, filename); |
|
95 |
this.configuration = configuration; |
|
96 |
NestedClassWriterImpl classW = new NestedClassWriterImpl(this); |
|
97 |
writers = new AbstractMemberWriter[] |
|
98 |
{classW, classW, classW, classW, classW, classW, |
|
99 |
new FieldWriterImpl(this), |
|
100 |
new MethodWriterImpl(this), |
|
101 |
new ConstructorWriterImpl(this), |
|
102 |
new EnumConstantWriterImpl(this), |
|
103 |
new AnnotationTypeOptionalMemberWriterImpl(this, null)}; |
|
104 |
} |
|
105 |
||
106 |
/** |
|
107 |
* Get list of all the deprecated classes and members in all the Packages |
|
108 |
* specified on the Command Line. |
|
109 |
* Then instantiate DeprecatedListWriter and generate File. |
|
110 |
* |
|
111 |
* @param configuration the current configuration of the doclet. |
|
112 |
*/ |
|
113 |
public static void generate(ConfigurationImpl configuration) { |
|
114 |
String filename = "deprecated-list.html"; |
|
115 |
try { |
|
116 |
DeprecatedListWriter depr = |
|
117 |
new DeprecatedListWriter(configuration, filename); |
|
118 |
depr.generateDeprecatedListFile( |
|
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
119 |
new DeprecatedAPIListBuilder(configuration)); |
10 | 120 |
depr.close(); |
121 |
} catch (IOException exc) { |
|
122 |
configuration.standardmessage.error( |
|
123 |
"doclet.exception_encountered", |
|
124 |
exc.toString(), filename); |
|
125 |
throw new DocletAbortException(); |
|
126 |
} |
|
127 |
} |
|
128 |
||
129 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
130 |
* Generate the deprecated API list. |
10 | 131 |
* |
132 |
* @param deprapi list of deprecated API built already. |
|
133 |
*/ |
|
134 |
protected void generateDeprecatedListFile(DeprecatedAPIListBuilder deprapi) |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
135 |
throws IOException { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
136 |
Content body = getHeader(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
137 |
body.addContent(getContentsList(deprapi)); |
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
138 |
String memberTableSummary; |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
139 |
String[] memberTableHeader = new String[1]; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
140 |
HtmlTree div = new HtmlTree(HtmlTag.DIV); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
141 |
div.addStyle(HtmlStyle.contentContainer); |
10 | 142 |
for (int i = 0; i < DeprecatedAPIListBuilder.NUM_TYPES; i++) { |
143 |
if (deprapi.hasDocumentation(i)) { |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
144 |
addAnchor(deprapi, i, div); |
2320
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
145 |
memberTableSummary = |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
146 |
configuration.getText("doclet.Member_Table_Summary", |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
147 |
configuration.getText(HEADING_KEYS[i]), |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
148 |
configuration.getText(SUMMARY_KEYS[i])); |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
149 |
memberTableHeader[0] = configuration.getText("doclet.0_and_1", |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
150 |
configuration.getText(HEADER_KEYS[i]), |
5b8c377175f4
6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents:
1787
diff
changeset
|
151 |
configuration.getText("doclet.Description")); |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
152 |
// DeprecatedAPIListBuilder.PACKAGE == 0, so if i == 0, it is |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
153 |
// a PackageDoc. |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
154 |
if (i == DeprecatedAPIListBuilder.PACKAGE) |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
155 |
addPackageDeprecatedAPI(deprapi.getList(i), |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
156 |
HEADING_KEYS[i], memberTableSummary, memberTableHeader, div); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
157 |
else |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
158 |
writers[i - 1].addDeprecatedAPI(deprapi.getList(i), |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
7681
diff
changeset
|
159 |
HEADING_KEYS[i], memberTableSummary, memberTableHeader, div); |
10 | 160 |
} |
161 |
} |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
162 |
body.addContent(div); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
163 |
addNavLinks(false, body); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
164 |
addBottom(body); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
165 |
printHtmlDocument(null, true, body); |
10 | 166 |
} |
167 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
168 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
169 |
* Add the index link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
170 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
171 |
* @param builder the deprecated list builder |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
172 |
* @param type the type of list being documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
173 |
* @param contentTree the content tree to which the index link will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
174 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
175 |
private void addIndexLink(DeprecatedAPIListBuilder builder, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
176 |
int type, Content contentTree) { |
10 | 177 |
if (builder.hasDocumentation(type)) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
178 |
Content li = HtmlTree.LI(getHyperLink("#" + ANCHORS[type], |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
179 |
getResource(HEADING_KEYS[type]))); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
180 |
contentTree.addContent(li); |
10 | 181 |
} |
182 |
} |
|
183 |
||
184 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
185 |
* Get the contents list. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
186 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
187 |
* @param deprapi the deprecated list builder |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
188 |
* @return a content tree for the contents list |
10 | 189 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
190 |
public Content getContentsList(DeprecatedAPIListBuilder deprapi) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
191 |
Content headContent = getResource("doclet.Deprecated_API"); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
192 |
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
193 |
HtmlStyle.title, headContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
194 |
Content div = HtmlTree.DIV(HtmlStyle.header, heading); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
195 |
Content headingContent = getResource("doclet.Contents"); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
196 |
div.addContent(HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
197 |
headingContent)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
198 |
Content ul = new HtmlTree(HtmlTag.UL); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
199 |
for (int i = 0; i < DeprecatedAPIListBuilder.NUM_TYPES; i++) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
200 |
addIndexLink(deprapi, i, ul); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
201 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
202 |
div.addContent(ul); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
203 |
return div; |
10 | 204 |
} |
205 |
||
206 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
207 |
* Add the anchor. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
208 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
209 |
* @param builder the deprecated list builder |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
210 |
* @param type the type of list being documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
211 |
* @param contentTree the content tree to which the anchor will be added |
10 | 212 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
213 |
private void addAnchor(DeprecatedAPIListBuilder builder, int type, Content htmlTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
214 |
if (builder.hasDocumentation(type)) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
215 |
htmlTree.addContent(getMarkerAnchor(ANCHORS[type])); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
216 |
} |
10 | 217 |
} |
218 |
||
219 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
220 |
* Get the header for the deprecated API Listing. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
221 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
222 |
* @return a content tree for the header |
10 | 223 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
224 |
public Content getHeader() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
225 |
String title = configuration.getText("doclet.Window_Deprecated_List"); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
226 |
Content bodyTree = getBody(true, getWindowTitle(title)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
227 |
addTop(bodyTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
228 |
addNavLinks(true, bodyTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
229 |
return bodyTree; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
230 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
231 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
232 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
233 |
* Get the deprecated label. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
234 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
235 |
* @return a content tree for the deprecated label |
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 |
protected Content getNavLinkDeprecated() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
238 |
Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, deprecatedLabel); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
239 |
return li; |
10 | 240 |
} |
241 |
} |