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