author | jjg |
Tue, 14 May 2013 10:14:53 -0700 | |
changeset 17563 | e8ddeb9bd17c |
parent 17560 | 9f6771abbd1a |
child 17569 | ef80738645e2 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
17560 | 2 |
* Copyright (c) 1997, 2013, 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.*; |
14544 | 34 |
import com.sun.tools.doclets.internal.toolkit.util.DocFile; |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
35 |
import com.sun.tools.doclets.internal.toolkit.util.DocLink; |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
36 |
import com.sun.tools.doclets.internal.toolkit.util.DocPath; |
10 | 37 |
|
38 |
||
39 |
/** |
|
40 |
* Class for the Html Format Code Generation specific to JavaDoc. |
|
41 |
* This Class contains methods related to the Html Code Generation which |
|
42 |
* are used by the Sub-Classes in the package com.sun.tools.doclets.standard |
|
43 |
* and com.sun.tools.doclets.oneone. |
|
44 |
* |
|
14260 | 45 |
* <p><b>This is NOT part of any supported API. |
46 |
* If you write code that depends on this, you do so at your own risk. |
|
47 |
* This code and its internal interfaces are subject to change or |
|
48 |
* deletion without notice.</b> |
|
49 |
* |
|
10 | 50 |
* @since 1.2 |
51 |
* @author Atul M Dambalkar |
|
52 |
* @author Robert Field |
|
53 |
*/ |
|
54 |
public abstract class HtmlDocWriter extends HtmlWriter { |
|
55 |
||
56 |
/** |
|
57 |
* Constructor. Initializes the destination file name through the super |
|
58 |
* class HtmlWriter. |
|
59 |
* |
|
60 |
* @param filename String file name. |
|
61 |
*/ |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
62 |
public HtmlDocWriter(Configuration configuration, DocPath filename) |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
63 |
throws IOException { |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
64 |
super(configuration, filename); |
10 | 65 |
configuration.message.notice("doclet.Generating_0", |
14544 | 66 |
DocFile.createFileForOutput(configuration, filename).getPath()); |
10 | 67 |
} |
68 |
||
69 |
/** |
|
70 |
* Accessor for configuration. |
|
71 |
*/ |
|
72 |
public abstract Configuration configuration(); |
|
73 |
||
74 |
/** |
|
17560 | 75 |
* Return Html hyperlink string. |
10 | 76 |
* |
77 |
* @param link String name of the file. |
|
78 |
* @param label Tag for the link. |
|
79 |
* @return String Hyper Link. |
|
80 |
*/ |
|
17560 | 81 |
public String getHyperLinkString(DocPath link, String label) { |
82 |
return getHyperLinkString(link, label, false, "", "", ""); |
|
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
83 |
} |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
84 |
|
17563
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17560
diff
changeset
|
85 |
public Content getHyperLink(DocPath link, String label) { |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17560
diff
changeset
|
86 |
return getHyperLink(link, new StringContent(label), false, "", "", ""); |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17560
diff
changeset
|
87 |
} |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17560
diff
changeset
|
88 |
|
17560 | 89 |
public String getHyperLinkString(DocLink link, String label) { |
90 |
return getHyperLinkString(link, label, false, "", "", ""); |
|
10 | 91 |
} |
92 |
||
93 |
/** |
|
94 |
* Get Html Hyper Link string. |
|
95 |
* |
|
96 |
* @param link String name of the file. |
|
97 |
* @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
|
98 |
* @param strong Boolean that sets label to strong. |
10 | 99 |
* @param stylename String style of text defined in style sheet. |
100 |
* @return String Hyper Link. |
|
101 |
*/ |
|
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
102 |
public String getHyperLinkString(DocPath link, |
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
103 |
String label, boolean strong, |
10 | 104 |
String stylename) { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
105 |
return getHyperLinkString(link, label, strong, stylename, "", ""); |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
106 |
} |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
107 |
|
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
108 |
public String getHyperLinkString(DocLink link, |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
109 |
String label, boolean strong, |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
110 |
String stylename) { |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
111 |
return getHyperLinkString(link, label, strong, stylename, "", ""); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
112 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
113 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
114 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
115 |
* Get Html Hyper Link string. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
116 |
* |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
117 |
* @param where Position of the link in the file. Character '#' is not |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
118 |
* needed. |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
119 |
* @param label Tag for the link. |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
120 |
* @return a content tree for the hyper link |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
121 |
*/ |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
122 |
public Content getHyperLink(String where, |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
123 |
Content label) { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
124 |
return getHyperLink(DocLink.fragment(where), label, "", ""); |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
125 |
} |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
126 |
|
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
127 |
/** |
17560 | 128 |
* Get Html hyperlink. |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
129 |
* |
17560 | 130 |
* @param link path of the file. |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
131 |
* @param label Tag for the link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
132 |
* @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
|
133 |
*/ |
17560 | 134 |
public Content getHyperLink(DocPath link, Content label) { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
135 |
return getHyperLink(link, label, "", ""); |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
136 |
} |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
137 |
|
17560 | 138 |
public Content getHyperLink(DocLink link, Content label) { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
139 |
return getHyperLink(link, label, "", ""); |
10 | 140 |
} |
141 |
||
142 |
/** |
|
143 |
* Get Html Hyper Link string. |
|
144 |
* |
|
145 |
* @param link String name of the file. |
|
146 |
* @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
|
147 |
* @param strong Boolean that sets label to strong. |
10 | 148 |
* @param stylename String style of text defined in style sheet. |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
149 |
* @param title String that describes the links content for accessibility. |
10 | 150 |
* @param target Target frame. |
151 |
* @return String Hyper Link. |
|
152 |
*/ |
|
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
153 |
public String getHyperLinkString(DocPath link, |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
154 |
String label, boolean strong, |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
155 |
String stylename, String title, String target) { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
156 |
return getHyperLinkString(new DocLink(link), label, strong, |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
157 |
stylename, title, target); |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
158 |
} |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
159 |
|
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
160 |
public String getHyperLinkString(DocLink link, |
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
161 |
String label, boolean strong, |
10 | 162 |
String stylename, String title, String target) { |
14263 | 163 |
StringBuilder retlink = new StringBuilder(); |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
164 |
retlink.append("<a href=\"").append(link).append('"'); |
10 | 165 |
if (title != null && title.length() != 0) { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
166 |
retlink.append(" title=\"").append(title).append('"'); |
10 | 167 |
} |
168 |
if (target != null && target.length() != 0) { |
|
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
169 |
retlink.append(" target=\"").append(target).append('"'); |
10 | 170 |
} |
171 |
retlink.append(">"); |
|
172 |
if (stylename != null && stylename.length() != 0) { |
|
173 |
retlink.append("<FONT CLASS=\""); |
|
174 |
retlink.append(stylename); |
|
175 |
retlink.append("\">"); |
|
176 |
} |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
177 |
if (strong) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
178 |
retlink.append("<span class=\"strong\">"); |
10 | 179 |
} |
180 |
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
|
181 |
if (strong) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
182 |
retlink.append("</span>"); |
10 | 183 |
} |
184 |
if (stylename != null && stylename.length() != 0) { |
|
185 |
retlink.append("</FONT>"); |
|
186 |
} |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
187 |
retlink.append("</a>"); |
10 | 188 |
return retlink.toString(); |
189 |
} |
|
190 |
||
17563
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17560
diff
changeset
|
191 |
public Content getHyperLink(DocPath link, |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17560
diff
changeset
|
192 |
Content label, boolean strong, |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17560
diff
changeset
|
193 |
String stylename, String title, String target) { |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17560
diff
changeset
|
194 |
return getHyperLink(new DocLink(link), label, strong, |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17560
diff
changeset
|
195 |
stylename, title, target); |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17560
diff
changeset
|
196 |
} |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17560
diff
changeset
|
197 |
|
17560 | 198 |
public Content getHyperLink(DocLink link, |
199 |
Content label, boolean strong, |
|
200 |
String stylename, String title, String target) { |
|
201 |
Content body = label; |
|
202 |
if (strong) { |
|
203 |
body = HtmlTree.SPAN(HtmlStyle.strong, body); |
|
204 |
} |
|
205 |
if (stylename != null && stylename.length() != 0) { |
|
206 |
HtmlTree t = new HtmlTree(HtmlTag.FONT, body); |
|
207 |
t.addAttr(HtmlAttr.CLASS, stylename); |
|
208 |
body = t; |
|
209 |
} |
|
210 |
HtmlTree l = HtmlTree.A(link.toString(), body); |
|
211 |
if (title != null && title.length() != 0) { |
|
212 |
l.addAttr(HtmlAttr.TITLE, title); |
|
213 |
} |
|
214 |
if (target != null && target.length() != 0) { |
|
215 |
l.addAttr(HtmlAttr.TARGET, target); |
|
216 |
} |
|
217 |
return l; |
|
218 |
} |
|
219 |
||
10 | 220 |
/** |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
221 |
* Get Html Hyper Link. |
10 | 222 |
* |
223 |
* @param link String name of the file. |
|
224 |
* @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
|
225 |
* @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
|
226 |
* @param target Target frame. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
227 |
* @return a content tree for the hyper link. |
10 | 228 |
*/ |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
229 |
public Content getHyperLink(DocPath link, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
230 |
Content label, String title, String target) { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
231 |
return getHyperLink(new DocLink(link), label, title, target); |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
232 |
} |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
233 |
|
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
234 |
public Content getHyperLink(DocLink link, |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
235 |
Content label, String title, String target) { |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
236 |
HtmlTree anchor = HtmlTree.A(link.toString(), label); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
237 |
if (title != null && title.length() != 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
238 |
anchor.addAttr(HtmlAttr.TITLE, title); |
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 |
if (target != null && target.length() != 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
241 |
anchor.addAttr(HtmlAttr.TARGET, target); |
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 |
return anchor; |
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 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
246 |
/** |
10 | 247 |
* Get the name of the package, this class is in. |
248 |
* |
|
249 |
* @param cd ClassDoc. |
|
250 |
*/ |
|
251 |
public String getPkgName(ClassDoc cd) { |
|
252 |
String pkgName = cd.containingPackage().name(); |
|
253 |
if (pkgName.length() > 0) { |
|
254 |
pkgName += "."; |
|
255 |
return pkgName; |
|
256 |
} |
|
257 |
return ""; |
|
258 |
} |
|
259 |
||
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
260 |
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
|
261 |
return memberDetailsListPrinted; |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
262 |
} |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
263 |
|
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
264 |
/** |
10 | 265 |
* Print the frameset version of the Html file header. |
266 |
* Called only when generating an HTML frameset file. |
|
267 |
* |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
268 |
* @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
|
269 |
* @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
|
270 |
* @param frameset the frameset to be added to the HTML document |
10 | 271 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
272 |
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
|
273 |
Content frameset) throws IOException { |
14542 | 274 |
Content htmlDocType = DocType.FRAMESET; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
275 |
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
|
276 |
Content head = new HtmlTree(HtmlTag.HEAD); |
10 | 277 |
if (! noTimeStamp) { |
14262
058238ba531e
8000418: javadoc should used a standard "generated by javadoc" string
jjg
parents:
14260
diff
changeset
|
278 |
Content headComment = new Comment(getGeneratedByString()); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
279 |
head.addContent(headComment); |
10 | 280 |
} |
281 |
if (configuration.charset.length() > 0) { |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
282 |
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
|
283 |
configuration.charset); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
284 |
head.addContent(meta); |
10 | 285 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
286 |
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
|
287 |
head.addContent(windowTitle); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
288 |
head.addContent(getFramesetJavaScript()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
289 |
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
|
290 |
head, frameset); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
291 |
Content htmlDocument = new HtmlDocument(htmlDocType, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
292 |
htmlComment, htmlTree); |
14266
69453558960d
8000673: remove dead code from HtmlWriter and subtypes
jjg
parents:
14265
diff
changeset
|
293 |
write(htmlDocument); |
10 | 294 |
} |
295 |
||
14262
058238ba531e
8000418: javadoc should used a standard "generated by javadoc" string
jjg
parents:
14260
diff
changeset
|
296 |
protected String getGeneratedByString() { |
10 | 297 |
Calendar calendar = new GregorianCalendar(TimeZone.getDefault()); |
14262
058238ba531e
8000418: javadoc should used a standard "generated by javadoc" string
jjg
parents:
14260
diff
changeset
|
298 |
Date today = calendar.getTime(); |
058238ba531e
8000418: javadoc should used a standard "generated by javadoc" string
jjg
parents:
14260
diff
changeset
|
299 |
return "Generated by javadoc ("+ ConfigurationImpl.BUILD_DATE + ") on " + today; |
10 | 300 |
} |
301 |
} |