88 /** 89 * The HTML tree for section tag. 90 */ 91 protected HtmlTree sectionTree = HtmlTree.SECTION(); 92 93 /** 94 * Constructor to construct PackageWriter object and to generate 95 * "package-summary.html" file in the respective package directory. 96 * For example for package "java.lang" this will generate file 97 * "package-summary.html" file in the "java/lang" directory. It will also 98 * create "java/lang" directory in the current or the destination directory 99 * if it doesn't exist. 100 * 101 * @param configuration the configuration of the doclet. 102 * @param packageElement PackageElement under consideration. 103 * @param prev Previous package in the sorted array. 104 * @param next Next package in the sorted array. 105 */ 106 public PackageWriterImpl(HtmlConfiguration configuration, 107 PackageElement packageElement, PackageElement prev, PackageElement next) { 108 super(configuration, DocPath 109 .forPackage(packageElement) 110 .resolve(DocPaths.PACKAGE_SUMMARY)); 111 this.prev = prev; 112 this.next = next; 113 this.packageElement = packageElement; 114 } 115 116 /** 117 * {@inheritDoc} 118 */ 119 @Override 120 public Content getPackageHeader(String heading) { 121 HtmlTree bodyTree = getBody(true, getWindowTitle(utils.getPackageName(packageElement))); 122 HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) 123 ? HtmlTree.HEADER() 124 : bodyTree; 125 addTop(htmlTree); 126 addNavLinks(true, htmlTree); 127 if (configuration.allowTag(HtmlTag.HEADER)) { 128 bodyTree.addContent(htmlTree); 129 } 385 */ 386 @Override 387 protected Content getNavLinkClassUse() { 388 Content useLink = links.createLink(DocPaths.PACKAGE_USE, 389 contents.useLabel, "", ""); 390 Content li = HtmlTree.LI(useLink); 391 return li; 392 } 393 394 /** 395 * Get "PREV PACKAGE" link in the navigation bar. 396 * 397 * @return a content tree for the previous link 398 */ 399 @Override 400 public Content getNavLinkPrevious() { 401 Content li; 402 if (prev == null) { 403 li = HtmlTree.LI(contents.prevPackageLabel); 404 } else { 405 DocPath p = DocPath.relativePath(packageElement, prev); 406 li = HtmlTree.LI(links.createLink(p.resolve(DocPaths.PACKAGE_SUMMARY), 407 contents.prevPackageLabel, "", "")); 408 } 409 return li; 410 } 411 412 /** 413 * Get "NEXT PACKAGE" link in the navigation bar. 414 * 415 * @return a content tree for the next link 416 */ 417 @Override 418 public Content getNavLinkNext() { 419 Content li; 420 if (next == null) { 421 li = HtmlTree.LI(contents.nextPackageLabel); 422 } else { 423 DocPath p = DocPath.relativePath(packageElement, next); 424 li = HtmlTree.LI(links.createLink(p.resolve(DocPaths.PACKAGE_SUMMARY), 425 contents.nextPackageLabel, "", "")); 426 } 427 return li; 428 } 429 430 /** 431 * Get "Tree" link in the navigation bar. This will be link to the package 432 * tree file. 433 * 434 * @return a content tree for the tree link 435 */ 436 @Override 437 protected Content getNavLinkTree() { 438 Content useLink = links.createLink(DocPaths.PACKAGE_TREE, 439 contents.treeLabel, "", ""); 440 Content li = HtmlTree.LI(useLink); 441 return li; 442 } 443 | 88 /** 89 * The HTML tree for section tag. 90 */ 91 protected HtmlTree sectionTree = HtmlTree.SECTION(); 92 93 /** 94 * Constructor to construct PackageWriter object and to generate 95 * "package-summary.html" file in the respective package directory. 96 * For example for package "java.lang" this will generate file 97 * "package-summary.html" file in the "java/lang" directory. It will also 98 * create "java/lang" directory in the current or the destination directory 99 * if it doesn't exist. 100 * 101 * @param configuration the configuration of the doclet. 102 * @param packageElement PackageElement under consideration. 103 * @param prev Previous package in the sorted array. 104 * @param next Next package in the sorted array. 105 */ 106 public PackageWriterImpl(HtmlConfiguration configuration, 107 PackageElement packageElement, PackageElement prev, PackageElement next) { 108 super(configuration, 109 configuration.docPaths.forPackage(packageElement) 110 .resolve(DocPaths.PACKAGE_SUMMARY)); 111 this.prev = prev; 112 this.next = next; 113 this.packageElement = packageElement; 114 } 115 116 /** 117 * {@inheritDoc} 118 */ 119 @Override 120 public Content getPackageHeader(String heading) { 121 HtmlTree bodyTree = getBody(true, getWindowTitle(utils.getPackageName(packageElement))); 122 HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) 123 ? HtmlTree.HEADER() 124 : bodyTree; 125 addTop(htmlTree); 126 addNavLinks(true, htmlTree); 127 if (configuration.allowTag(HtmlTag.HEADER)) { 128 bodyTree.addContent(htmlTree); 129 } 385 */ 386 @Override 387 protected Content getNavLinkClassUse() { 388 Content useLink = links.createLink(DocPaths.PACKAGE_USE, 389 contents.useLabel, "", ""); 390 Content li = HtmlTree.LI(useLink); 391 return li; 392 } 393 394 /** 395 * Get "PREV PACKAGE" link in the navigation bar. 396 * 397 * @return a content tree for the previous link 398 */ 399 @Override 400 public Content getNavLinkPrevious() { 401 Content li; 402 if (prev == null) { 403 li = HtmlTree.LI(contents.prevPackageLabel); 404 } else { 405 DocPath p = docPaths.relativePath(packageElement, prev); 406 li = HtmlTree.LI(links.createLink(p.resolve(DocPaths.PACKAGE_SUMMARY), 407 contents.prevPackageLabel, "", "")); 408 } 409 return li; 410 } 411 412 /** 413 * Get "NEXT PACKAGE" link in the navigation bar. 414 * 415 * @return a content tree for the next link 416 */ 417 @Override 418 public Content getNavLinkNext() { 419 Content li; 420 if (next == null) { 421 li = HtmlTree.LI(contents.nextPackageLabel); 422 } else { 423 DocPath p = docPaths.relativePath(packageElement, next); 424 li = HtmlTree.LI(links.createLink(p.resolve(DocPaths.PACKAGE_SUMMARY), 425 contents.nextPackageLabel, "", "")); 426 } 427 return li; 428 } 429 430 /** 431 * Get "Tree" link in the navigation bar. This will be link to the package 432 * tree file. 433 * 434 * @return a content tree for the tree link 435 */ 436 @Override 437 protected Content getNavLinkTree() { 438 Content useLink = links.createLink(DocPaths.PACKAGE_TREE, 439 contents.treeLabel, "", ""); 440 Content li = HtmlTree.LI(useLink); 441 return li; 442 } 443 |