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