author | jjg |
Wed, 10 Oct 2012 16:48:21 -0700 | |
changeset 14260 | 727a84636f12 |
parent 7681 | 1f0819a3341f |
child 14262 | 058238ba531e |
permissions | -rw-r--r-- |
10 | 1 |
/* |
14260 | 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.markup; |
|
27 |
||
1869
0e193a8f3520
6794582: javadoc should read files using a FileManager
jjg
parents:
1787
diff
changeset
|
28 |
import java.io.*; |
0e193a8f3520
6794582: javadoc should read files using a FileManager
jjg
parents:
1787
diff
changeset
|
29 |
import java.util.*; |
10 | 30 |
|
31 |
import com.sun.javadoc.*; |
|
1869
0e193a8f3520
6794582: javadoc should read files using a FileManager
jjg
parents:
1787
diff
changeset
|
32 |
import com.sun.tools.doclets.internal.toolkit.*; |
10 | 33 |
|
34 |
||
35 |
/** |
|
36 |
* Class for the Html Format Code Generation specific to JavaDoc. |
|
37 |
* This Class contains methods related to the Html Code Generation which |
|
38 |
* are used by the Sub-Classes in the package com.sun.tools.doclets.standard |
|
39 |
* and com.sun.tools.doclets.oneone. |
|
40 |
* |
|
14260 | 41 |
* <p><b>This is NOT part of any supported API. |
42 |
* If you write code that depends on this, you do so at your own risk. |
|
43 |
* This code and its internal interfaces are subject to change or |
|
44 |
* deletion without notice.</b> |
|
45 |
* |
|
10 | 46 |
* @since 1.2 |
47 |
* @author Atul M Dambalkar |
|
48 |
* @author Robert Field |
|
49 |
*/ |
|
50 |
public abstract class HtmlDocWriter extends HtmlWriter { |
|
51 |
||
52 |
/** |
|
53 |
* Constructor. Initializes the destination file name through the super |
|
54 |
* class HtmlWriter. |
|
55 |
* |
|
56 |
* @param filename String file name. |
|
57 |
*/ |
|
58 |
public HtmlDocWriter(Configuration configuration, |
|
59 |
String filename) throws IOException { |
|
60 |
super(configuration, |
|
61 |
null, configuration.destDirName + filename, |
|
62 |
configuration.docencoding); |
|
1869
0e193a8f3520
6794582: javadoc should read files using a FileManager
jjg
parents:
1787
diff
changeset
|
63 |
// use File to normalize file separators |
10 | 64 |
configuration.message.notice("doclet.Generating_0", |
1869
0e193a8f3520
6794582: javadoc should read files using a FileManager
jjg
parents:
1787
diff
changeset
|
65 |
new File(configuration.destDirName, filename)); |
10 | 66 |
} |
67 |
||
68 |
public HtmlDocWriter(Configuration configuration, |
|
69 |
String path, String filename) throws IOException { |
|
70 |
super(configuration, |
|
71 |
configuration.destDirName + path, filename, |
|
72 |
configuration.docencoding); |
|
1869
0e193a8f3520
6794582: javadoc should read files using a FileManager
jjg
parents:
1787
diff
changeset
|
73 |
// use File to normalize file separators |
10 | 74 |
configuration.message.notice("doclet.Generating_0", |
1869
0e193a8f3520
6794582: javadoc should read files using a FileManager
jjg
parents:
1787
diff
changeset
|
75 |
new File(configuration.destDirName, |
0e193a8f3520
6794582: javadoc should read files using a FileManager
jjg
parents:
1787
diff
changeset
|
76 |
((path.length() > 0)? path + File.separator: "") + filename)); |
10 | 77 |
} |
78 |
||
79 |
/** |
|
80 |
* Accessor for configuration. |
|
81 |
*/ |
|
82 |
public abstract Configuration configuration(); |
|
83 |
||
84 |
/** |
|
85 |
* Print Html Hyper Link. |
|
86 |
* |
|
87 |
* @param link String name of the file. |
|
88 |
* @param where Position of the link in the file. Character '#' is not |
|
89 |
* needed. |
|
90 |
* @param label Tag for the link. |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
91 |
* @param strong Boolean that sets label to strong. |
10 | 92 |
*/ |
93 |
public void printHyperLink(String link, String where, |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
94 |
String label, boolean strong) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
95 |
print(getHyperLinkString(link, where, label, strong, "", "", "")); |
10 | 96 |
} |
97 |
||
98 |
/** |
|
99 |
* Print Html Hyper Link. |
|
100 |
* |
|
101 |
* @param link String name of the file. |
|
102 |
* @param where Position of the link in the file. Character '#' is not |
|
103 |
* needed. |
|
104 |
* @param label Tag for the link. |
|
105 |
*/ |
|
106 |
public void printHyperLink(String link, String where, String label) { |
|
107 |
printHyperLink(link, where, label, false); |
|
108 |
} |
|
109 |
||
110 |
/** |
|
111 |
* Print Html Hyper Link. |
|
112 |
* |
|
113 |
* @param link String name of the file. |
|
114 |
* @param where Position of the link in the file. Character '#' is not |
|
115 |
* needed. |
|
116 |
* @param label Tag for the link. |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
117 |
* @param strong Boolean that sets label to strong. |
10 | 118 |
* @param stylename String style of text defined in style sheet. |
119 |
*/ |
|
120 |
public void printHyperLink(String link, String where, |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
121 |
String label, boolean strong, |
10 | 122 |
String stylename) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
123 |
print(getHyperLinkString(link, where, label, strong, stylename, "", "")); |
10 | 124 |
} |
125 |
||
126 |
/** |
|
127 |
* Return Html Hyper Link string. |
|
128 |
* |
|
129 |
* @param link String name of the file. |
|
130 |
* @param where Position of the link in the file. Character '#' is not |
|
131 |
* needed. |
|
132 |
* @param label Tag for the link. |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
133 |
* @param strong Boolean that sets label to strong. |
10 | 134 |
* @return String Hyper Link. |
135 |
*/ |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
136 |
public String getHyperLinkString(String link, String where, |
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
137 |
String label, boolean strong) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
138 |
return getHyperLinkString(link, where, label, strong, "", "", ""); |
10 | 139 |
} |
140 |
||
141 |
/** |
|
142 |
* Get Html Hyper Link string. |
|
143 |
* |
|
144 |
* @param link String name of the file. |
|
145 |
* @param where Position of the link in the file. Character '#' is not |
|
146 |
* needed. |
|
147 |
* @param label Tag for the link. |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
148 |
* @param strong Boolean that sets label to strong. |
10 | 149 |
* @param stylename String style of text defined in style sheet. |
150 |
* @return String Hyper Link. |
|
151 |
*/ |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
152 |
public String getHyperLinkString(String link, String where, |
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
153 |
String label, boolean strong, |
10 | 154 |
String stylename) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
155 |
return getHyperLinkString(link, where, label, strong, stylename, "", ""); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
156 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
157 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
158 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
159 |
* Get Html Hyper Link string. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
160 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
161 |
* @param link String name of the file. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
162 |
* @param where Position of the link in the file. Character '#' is not |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
163 |
* needed. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
164 |
* @param label Tag for the link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
165 |
* @return a content tree for the hyper link |
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 |
public Content getHyperLink(String link, String where, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
168 |
Content label) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
169 |
return getHyperLink(link, where, label, "", ""); |
10 | 170 |
} |
171 |
||
172 |
/** |
|
173 |
* Get Html Hyper Link string. |
|
174 |
* |
|
175 |
* @param link String name of the file. |
|
176 |
* @param where Position of the link in the file. Character '#' is not |
|
177 |
* needed. |
|
178 |
* @param label Tag for the link. |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
179 |
* @param strong Boolean that sets label to strong. |
10 | 180 |
* @param stylename String style of text defined in style sheet. |
181 |
* @param title String that describes the link's content for accessibility. |
|
182 |
* @param target Target frame. |
|
183 |
* @return String Hyper Link. |
|
184 |
*/ |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
185 |
public String getHyperLinkString(String link, String where, |
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
186 |
String label, boolean strong, |
10 | 187 |
String stylename, String title, String target) { |
188 |
StringBuffer retlink = new StringBuffer(); |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
189 |
retlink.append("<a href=\""); |
10 | 190 |
retlink.append(link); |
191 |
if (where != null && where.length() != 0) { |
|
192 |
retlink.append("#"); |
|
193 |
retlink.append(where); |
|
194 |
} |
|
195 |
retlink.append("\""); |
|
196 |
if (title != null && title.length() != 0) { |
|
197 |
retlink.append(" title=\"" + title + "\""); |
|
198 |
} |
|
199 |
if (target != null && target.length() != 0) { |
|
200 |
retlink.append(" target=\"" + target + "\""); |
|
201 |
} |
|
202 |
retlink.append(">"); |
|
203 |
if (stylename != null && stylename.length() != 0) { |
|
204 |
retlink.append("<FONT CLASS=\""); |
|
205 |
retlink.append(stylename); |
|
206 |
retlink.append("\">"); |
|
207 |
} |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
208 |
if (strong) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
209 |
retlink.append("<span class=\"strong\">"); |
10 | 210 |
} |
211 |
retlink.append(label); |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
212 |
if (strong) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
213 |
retlink.append("</span>"); |
10 | 214 |
} |
215 |
if (stylename != null && stylename.length() != 0) { |
|
216 |
retlink.append("</FONT>"); |
|
217 |
} |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
218 |
retlink.append("</a>"); |
10 | 219 |
return retlink.toString(); |
220 |
} |
|
221 |
||
222 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
223 |
* Get Html Hyper Link. |
10 | 224 |
* |
225 |
* @param link String name of the file. |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
226 |
* @param where Position of the link in the file. Character '#' is not |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
227 |
* needed. |
10 | 228 |
* @param label Tag for the link. |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
229 |
* @param title String that describes the link's content for accessibility. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
230 |
* @param target Target frame. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
231 |
* @return a content tree for the hyper link. |
10 | 232 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
233 |
public Content getHyperLink(String link, String where, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
234 |
Content label, String title, String target) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
235 |
if (where != null && where.length() != 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
236 |
link += "#" + where; |
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 |
HtmlTree anchor = HtmlTree.A(link, label); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
239 |
if (title != null && title.length() != 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
240 |
anchor.addAttr(HtmlAttr.TITLE, title); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
241 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
242 |
if (target != null && target.length() != 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
243 |
anchor.addAttr(HtmlAttr.TARGET, target); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
244 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
245 |
return anchor; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
246 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
247 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
248 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
249 |
* Get a hyperlink to a file. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
250 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
251 |
* @param link String name of the file |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
252 |
* @param label Label for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
253 |
* @return a content for the hyperlink to the file |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
254 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
255 |
public Content getHyperLink(String link, Content label) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
256 |
return getHyperLink(link, "", label); |
10 | 257 |
} |
258 |
||
259 |
/** |
|
260 |
* Get link string without positioning in the file. |
|
261 |
* |
|
262 |
* @param link String name of the file. |
|
263 |
* @param label Tag for the link. |
|
264 |
* @return Strign Hyper link. |
|
265 |
*/ |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
266 |
public String getHyperLinkString(String link, String label) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
267 |
return getHyperLinkString(link, "", label, false); |
10 | 268 |
} |
269 |
||
270 |
/** |
|
271 |
* Print the name of the package, this class is in. |
|
272 |
* |
|
273 |
* @param cd ClassDoc. |
|
274 |
*/ |
|
275 |
public void printPkgName(ClassDoc cd) { |
|
276 |
print(getPkgName(cd)); |
|
277 |
} |
|
278 |
||
279 |
/** |
|
280 |
* Get the name of the package, this class is in. |
|
281 |
* |
|
282 |
* @param cd ClassDoc. |
|
283 |
*/ |
|
284 |
public String getPkgName(ClassDoc cd) { |
|
285 |
String pkgName = cd.containingPackage().name(); |
|
286 |
if (pkgName.length() > 0) { |
|
287 |
pkgName += "."; |
|
288 |
return pkgName; |
|
289 |
} |
|
290 |
return ""; |
|
291 |
} |
|
292 |
||
293 |
/** |
|
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
294 |
* Keep track of member details list. Print the definition list start tag |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
295 |
* if it is not printed yet. |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
296 |
*/ |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
297 |
public void printMemberDetailsListStartTag () { |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
298 |
if (!getMemberDetailsListPrinted()) { |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
299 |
dl(); |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
300 |
memberDetailsListPrinted = true; |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
301 |
} |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
302 |
} |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
303 |
|
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
304 |
/** |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
305 |
* Print the definition list end tag if the list start tag was printed. |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
306 |
*/ |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
307 |
public void printMemberDetailsListEndTag () { |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
308 |
if (getMemberDetailsListPrinted()) { |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
309 |
dlEnd(); |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
310 |
memberDetailsListPrinted = false; |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
311 |
} |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
312 |
} |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
313 |
|
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
314 |
public boolean getMemberDetailsListPrinted() { |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
315 |
return memberDetailsListPrinted; |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
316 |
} |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
317 |
|
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
318 |
/** |
10 | 319 |
* Print the frameset version of the Html file header. |
320 |
* Called only when generating an HTML frameset file. |
|
321 |
* |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
322 |
* @param title Title of this HTML document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
323 |
* @param noTimeStamp If true, don't print time stamp in header |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
324 |
* @param frameset the frameset to be added to the HTML document |
10 | 325 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
326 |
public void printFramesetDocument(String title, boolean noTimeStamp, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
327 |
Content frameset) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
328 |
Content htmlDocType = DocType.Frameset(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
329 |
Content htmlComment = new Comment(configuration.getText("doclet.New_Page")); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
330 |
Content head = new HtmlTree(HtmlTag.HEAD); |
10 | 331 |
if (! noTimeStamp) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
332 |
Content headComment = new Comment("Generated by javadoc on " + today()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
333 |
head.addContent(headComment); |
10 | 334 |
} |
335 |
if (configuration.charset.length() > 0) { |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
336 |
Content meta = HtmlTree.META("Content-Type", "text/html", |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
337 |
configuration.charset); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
338 |
head.addContent(meta); |
10 | 339 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
340 |
Content windowTitle = HtmlTree.TITLE(new StringContent(title)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
341 |
head.addContent(windowTitle); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
342 |
head.addContent(getFramesetJavaScript()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
343 |
Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
344 |
head, frameset); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
345 |
Content htmlDocument = new HtmlDocument(htmlDocType, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
346 |
htmlComment, htmlTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
347 |
print(htmlDocument.toString()); |
10 | 348 |
} |
349 |
||
350 |
/** |
|
351 |
* Print the appropriate spaces to format the class tree in the class page. |
|
352 |
* |
|
353 |
* @param len Number of spaces. |
|
354 |
*/ |
|
355 |
public String spaces(int len) { |
|
356 |
String space = ""; |
|
357 |
||
358 |
for (int i = 0; i < len; i++) { |
|
359 |
space += " "; |
|
360 |
} |
|
361 |
return space; |
|
362 |
} |
|
363 |
||
364 |
/** |
|
365 |
* Print the closing </body> and </html> tags. |
|
366 |
*/ |
|
367 |
public void printBodyHtmlEnd() { |
|
368 |
println(); |
|
369 |
bodyEnd(); |
|
370 |
htmlEnd(); |
|
371 |
} |
|
372 |
||
373 |
/** |
|
374 |
* Calls {@link #printBodyHtmlEnd()} method. |
|
375 |
*/ |
|
376 |
public void printFooter() { |
|
377 |
printBodyHtmlEnd(); |
|
378 |
} |
|
379 |
||
380 |
/** |
|
381 |
* Print closing </html> tag. |
|
382 |
*/ |
|
383 |
public void printFrameFooter() { |
|
384 |
htmlEnd(); |
|
385 |
} |
|
386 |
||
387 |
/** |
|
388 |
* Print ten non-breaking spaces("&nbsp;"). |
|
389 |
*/ |
|
390 |
public void printNbsps() { |
|
391 |
print(" "); |
|
392 |
} |
|
393 |
||
394 |
/** |
|
395 |
* Get the day and date information for today, depending upon user option. |
|
396 |
* |
|
397 |
* @return String Today. |
|
398 |
* @see java.util.Calendar |
|
399 |
* @see java.util.GregorianCalendar |
|
400 |
* @see java.util.TimeZone |
|
401 |
*/ |
|
402 |
public String today() { |
|
403 |
Calendar calendar = new GregorianCalendar(TimeZone.getDefault()); |
|
404 |
return calendar.getTime().toString(); |
|
405 |
} |
|
406 |
} |