src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java

changeset 1372
78962d89f283
parent 1364
8db45b13526e
child 1373
4a1c57a1c410
equal deleted inserted replaced
1366:12cf6bfd8c05 1372:78962d89f283
63 * The package being documented. 63 * The package being documented.
64 */ 64 */
65 protected PackageDoc packageDoc; 65 protected PackageDoc packageDoc;
66 66
67 /** 67 /**
68 * The name of the output file.
69 */
70 private static final String OUTPUT_FILE_NAME = "package-summary.html";
71
72 /**
73 * Constructor to construct PackageWriter object and to generate 68 * Constructor to construct PackageWriter object and to generate
74 * "package-summary.html" file in the respective package directory. 69 * "package-summary.html" file in the respective package directory.
75 * For example for package "java.lang" this will generate file 70 * For example for package "java.lang" this will generate file
76 * "package-summary.html" file in the "java/lang" directory. It will also 71 * "package-summary.html" file in the "java/lang" directory. It will also
77 * create "java/lang" directory in the current or the destination directory 72 * create "java/lang" directory in the current or the destination directory
78 * if it doesen't exist. 73 * if it doesn't exist.
79 * 74 *
80 * @param configuration the configuration of the doclet. 75 * @param configuration the configuration of the doclet.
81 * @param packageDoc PackageDoc under consideration. 76 * @param packageDoc PackageDoc under consideration.
82 * @param prev Previous package in the sorted array. 77 * @param prev Previous package in the sorted array.
83 * @param next Next package in the sorted array. 78 * @param next Next package in the sorted array.
84 */ 79 */
85 public PackageWriterImpl(ConfigurationImpl configuration, 80 public PackageWriterImpl(ConfigurationImpl configuration,
86 PackageDoc packageDoc, PackageDoc prev, PackageDoc next) 81 PackageDoc packageDoc, PackageDoc prev, PackageDoc next)
87 throws IOException { 82 throws IOException {
88 super(configuration, DirectoryManager.getDirectoryPath(packageDoc), OUTPUT_FILE_NAME, 83 super(configuration, DocPath.forPackage(packageDoc).resolve(DocPaths.PACKAGE_SUMMARY));
89 DirectoryManager.getRelativePath(packageDoc.name()));
90 this.prev = prev; 84 this.prev = prev;
91 this.next = next; 85 this.next = next;
92 this.packageDoc = packageDoc; 86 this.packageDoc = packageDoc;
93 }
94
95 /**
96 * Return the name of the output file.
97 *
98 * @return the name of the output file.
99 */
100 public String getOutputFileName() {
101 return OUTPUT_FILE_NAME;
102 } 87 }
103 88
104 /** 89 /**
105 * {@inheritDoc} 90 * {@inheritDoc}
106 */ 91 */
263 * Get "Use" link for this pacakge in the navigation bar. 248 * Get "Use" link for this pacakge in the navigation bar.
264 * 249 *
265 * @return a content tree for the class use link 250 * @return a content tree for the class use link
266 */ 251 */
267 protected Content getNavLinkClassUse() { 252 protected Content getNavLinkClassUse() {
268 Content useLink = getHyperLink("package-use.html", "", 253 Content useLink = getHyperLink(DocPaths.PACKAGE_USE, "",
269 useLabel, "", ""); 254 useLabel, "", "");
270 Content li = HtmlTree.LI(useLink); 255 Content li = HtmlTree.LI(useLink);
271 return li; 256 return li;
272 } 257 }
273 258
279 public Content getNavLinkPrevious() { 264 public Content getNavLinkPrevious() {
280 Content li; 265 Content li;
281 if (prev == null) { 266 if (prev == null) {
282 li = HtmlTree.LI(prevpackageLabel); 267 li = HtmlTree.LI(prevpackageLabel);
283 } else { 268 } else {
284 String path = DirectoryManager.getRelativePath(packageDoc.name(), 269 DocPath path = DocPath.relativePath(packageDoc, prev);
285 prev.name()); 270 li = HtmlTree.LI(getHyperLink(path.resolve(DocPaths.PACKAGE_SUMMARY), "",
286 li = HtmlTree.LI(getHyperLink(path + "package-summary.html", "",
287 prevpackageLabel, "", "")); 271 prevpackageLabel, "", ""));
288 } 272 }
289 return li; 273 return li;
290 } 274 }
291 275
297 public Content getNavLinkNext() { 281 public Content getNavLinkNext() {
298 Content li; 282 Content li;
299 if (next == null) { 283 if (next == null) {
300 li = HtmlTree.LI(nextpackageLabel); 284 li = HtmlTree.LI(nextpackageLabel);
301 } else { 285 } else {
302 String path = DirectoryManager.getRelativePath(packageDoc.name(), 286 DocPath path = DocPath.relativePath(packageDoc, next);
303 next.name()); 287 li = HtmlTree.LI(getHyperLink(path.resolve(DocPaths.PACKAGE_SUMMARY), "",
304 li = HtmlTree.LI(getHyperLink(path + "package-summary.html", "",
305 nextpackageLabel, "", "")); 288 nextpackageLabel, "", ""));
306 } 289 }
307 return li; 290 return li;
308 } 291 }
309 292
312 * tree file. 295 * tree file.
313 * 296 *
314 * @return a content tree for the tree link 297 * @return a content tree for the tree link
315 */ 298 */
316 protected Content getNavLinkTree() { 299 protected Content getNavLinkTree() {
317 Content useLink = getHyperLink("package-tree.html", "", 300 Content useLink = getHyperLink(DocPaths.PACKAGE_TREE, "",
318 treeLabel, "", ""); 301 treeLabel, "", "");
319 Content li = HtmlTree.LI(useLink); 302 Content li = HtmlTree.LI(useLink);
320 return li; 303 return li;
321 } 304 }
322 305

mercurial