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