author | jjg |
Tue, 30 Oct 2012 10:15:19 -0700 | |
changeset 14366 | af625e568667 |
parent 14358 | 9eda9239cba0 |
child 14542 | 7062120649c2 |
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.*; |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
34 |
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
|
35 |
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
|
36 |
import com.sun.tools.doclets.internal.toolkit.util.DocPaths; |
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", |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
66 |
filename.resolveAgainst(configuration.destDirName)); |
10 | 67 |
} |
68 |
||
69 |
/** |
|
70 |
* Accessor for configuration. |
|
71 |
*/ |
|
72 |
public abstract Configuration configuration(); |
|
73 |
||
74 |
/** |
|
75 |
* Return Html Hyper Link string. |
|
76 |
* |
|
77 |
* @param link String name of the file. |
|
78 |
* @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
|
79 |
* @param strong Boolean that sets label to strong. |
10 | 80 |
* @return String Hyper Link. |
81 |
*/ |
|
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
82 |
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
|
83 |
String label, boolean strong) { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
84 |
return getHyperLinkString(link, label, strong, "", "", ""); |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
85 |
} |
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 |
public String getHyperLinkString(DocLink link, |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
88 |
String label, boolean strong) { |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
89 |
return getHyperLinkString(link, label, strong, "", "", ""); |
10 | 90 |
} |
91 |
||
92 |
/** |
|
93 |
* Get Html Hyper Link string. |
|
94 |
* |
|
95 |
* @param link String name of the file. |
|
96 |
* @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
|
97 |
* @param strong Boolean that sets label to strong. |
10 | 98 |
* @param stylename String style of text defined in style sheet. |
99 |
* @return String Hyper Link. |
|
100 |
*/ |
|
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
101 |
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
|
102 |
String label, boolean strong, |
10 | 103 |
String stylename) { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
104 |
return getHyperLinkString(link, label, strong, stylename, "", ""); |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
105 |
} |
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 |
public String getHyperLinkString(DocLink link, |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
108 |
String label, boolean strong, |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
109 |
String stylename) { |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
110 |
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
|
111 |
} |
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 |
* Get Html Hyper Link string. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
115 |
* |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
116 |
* @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
|
117 |
* needed. |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
118 |
* @param label Tag for the link. |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
119 |
* @return a content tree for the hyper link |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
120 |
*/ |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
121 |
public Content getHyperLink(String where, |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
122 |
Content label) { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
123 |
return getHyperLink(DocLink.fragment(where), label, "", ""); |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
124 |
} |
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 |
* Get Html Hyper Link string. |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
128 |
* |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
129 |
* @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
|
130 |
* @param label Tag for the link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
131 |
* @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
|
132 |
*/ |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
133 |
public Content getHyperLink(DocPath link, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
134 |
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 |
|
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
138 |
public Content getHyperLink(DocLink link, |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
139 |
Content label) { |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
140 |
return getHyperLink(link, label, "", ""); |
10 | 141 |
} |
142 |
||
143 |
/** |
|
144 |
* Get Html Hyper Link string. |
|
145 |
* |
|
146 |
* @param link String name of the file. |
|
147 |
* @param label Tag for the link. |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
148 |
* @param strong Boolean that sets label to strong. |
10 | 149 |
* @param stylename String style of text defined in style sheet. |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
150 |
* @param title String that describes the links content for accessibility. |
10 | 151 |
* @param target Target frame. |
152 |
* @return String Hyper Link. |
|
153 |
*/ |
|
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
154 |
public String getHyperLinkString(DocPath link, |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
155 |
String label, boolean strong, |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
156 |
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
|
157 |
return getHyperLinkString(new DocLink(link), label, strong, |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
158 |
stylename, title, target); |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
159 |
} |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
160 |
|
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
161 |
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
|
162 |
String label, boolean strong, |
10 | 163 |
String stylename, String title, String target) { |
14263 | 164 |
StringBuilder retlink = new StringBuilder(); |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
165 |
retlink.append("<a href=\"").append(link).append('"'); |
10 | 166 |
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
|
167 |
retlink.append(" title=\"").append(title).append('"'); |
10 | 168 |
} |
169 |
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
|
170 |
retlink.append(" target=\"").append(target).append('"'); |
10 | 171 |
} |
172 |
retlink.append(">"); |
|
173 |
if (stylename != null && stylename.length() != 0) { |
|
174 |
retlink.append("<FONT CLASS=\""); |
|
175 |
retlink.append(stylename); |
|
176 |
retlink.append("\">"); |
|
177 |
} |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
178 |
if (strong) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
179 |
retlink.append("<span class=\"strong\">"); |
10 | 180 |
} |
181 |
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
|
182 |
if (strong) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
183 |
retlink.append("</span>"); |
10 | 184 |
} |
185 |
if (stylename != null && stylename.length() != 0) { |
|
186 |
retlink.append("</FONT>"); |
|
187 |
} |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
188 |
retlink.append("</a>"); |
10 | 189 |
return retlink.toString(); |
190 |
} |
|
191 |
||
192 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
193 |
* Get Html Hyper Link. |
10 | 194 |
* |
195 |
* @param link String name of the file. |
|
196 |
* @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
|
197 |
* @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
|
198 |
* @param target Target frame. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
199 |
* @return a content tree for the hyper link. |
10 | 200 |
*/ |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
201 |
public Content getHyperLink(DocPath link, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
202 |
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
|
203 |
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
|
204 |
} |
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 |
public Content getHyperLink(DocLink link, |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
207 |
Content label, String title, String target) { |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
208 |
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
|
209 |
if (title != null && title.length() != 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
210 |
anchor.addAttr(HtmlAttr.TITLE, title); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
211 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
212 |
if (target != null && target.length() != 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
213 |
anchor.addAttr(HtmlAttr.TARGET, target); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
214 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
215 |
return anchor; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
216 |
} |
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 |
/** |
10 | 219 |
* Get link string without positioning in the file. |
220 |
* |
|
221 |
* @param link String name of the file. |
|
222 |
* @param label Tag for the link. |
|
223 |
* @return Strign Hyper link. |
|
224 |
*/ |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
225 |
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
|
226 |
return getHyperLinkString(link, label, false); |
10 | 227 |
} |
228 |
||
229 |
/** |
|
230 |
* Get the name of the package, this class is in. |
|
231 |
* |
|
232 |
* @param cd ClassDoc. |
|
233 |
*/ |
|
234 |
public String getPkgName(ClassDoc cd) { |
|
235 |
String pkgName = cd.containingPackage().name(); |
|
236 |
if (pkgName.length() > 0) { |
|
237 |
pkgName += "."; |
|
238 |
return pkgName; |
|
239 |
} |
|
240 |
return ""; |
|
241 |
} |
|
242 |
||
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
243 |
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
|
244 |
return memberDetailsListPrinted; |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1869
diff
changeset
|
245 |
} |
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 |
/** |
10 | 248 |
* Print the frameset version of the Html file header. |
249 |
* Called only when generating an HTML frameset file. |
|
250 |
* |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
251 |
* @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
|
252 |
* @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
|
253 |
* @param frameset the frameset to be added to the HTML document |
10 | 254 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
255 |
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
|
256 |
Content frameset) throws IOException { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
257 |
Content htmlDocType = DocType.Frameset(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
258 |
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
|
259 |
Content head = new HtmlTree(HtmlTag.HEAD); |
10 | 260 |
if (! noTimeStamp) { |
14262
058238ba531e
8000418: javadoc should used a standard "generated by javadoc" string
jjg
parents:
14260
diff
changeset
|
261 |
Content headComment = new Comment(getGeneratedByString()); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
262 |
head.addContent(headComment); |
10 | 263 |
} |
264 |
if (configuration.charset.length() > 0) { |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
265 |
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
|
266 |
configuration.charset); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
267 |
head.addContent(meta); |
10 | 268 |
} |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
269 |
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
|
270 |
head.addContent(windowTitle); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
271 |
head.addContent(getFramesetJavaScript()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
272 |
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
|
273 |
head, frameset); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
274 |
Content htmlDocument = new HtmlDocument(htmlDocType, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
275 |
htmlComment, htmlTree); |
14266
69453558960d
8000673: remove dead code from HtmlWriter and subtypes
jjg
parents:
14265
diff
changeset
|
276 |
write(htmlDocument); |
10 | 277 |
} |
278 |
||
279 |
/** |
|
280 |
* Print the appropriate spaces to format the class tree in the class page. |
|
281 |
* |
|
282 |
* @param len Number of spaces. |
|
283 |
*/ |
|
284 |
public String spaces(int len) { |
|
285 |
String space = ""; |
|
286 |
||
287 |
for (int i = 0; i < len; i++) { |
|
288 |
space += " "; |
|
289 |
} |
|
290 |
return space; |
|
291 |
} |
|
292 |
||
14262
058238ba531e
8000418: javadoc should used a standard "generated by javadoc" string
jjg
parents:
14260
diff
changeset
|
293 |
protected String getGeneratedByString() { |
10 | 294 |
Calendar calendar = new GregorianCalendar(TimeZone.getDefault()); |
14262
058238ba531e
8000418: javadoc should used a standard "generated by javadoc" string
jjg
parents:
14260
diff
changeset
|
295 |
Date today = calendar.getTime(); |
058238ba531e
8000418: javadoc should used a standard "generated by javadoc" string
jjg
parents:
14260
diff
changeset
|
296 |
return "Generated by javadoc ("+ ConfigurationImpl.BUILD_DATE + ") on " + today; |
10 | 297 |
} |
298 |
} |