< prev index next >

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java

Print this page




  86         this.prev = prev;
  87         this.next = next;
  88     }
  89 
  90     /**
  91      * Construct a PackageTreeWriter object and then use it to generate the
  92      * package tree page.
  93      *
  94      * @param configuration the configuration for this run.
  95      * @param pkg      Package for which tree file is to be generated.
  96      * @param prev     Previous package in the alpha-ordered list.
  97      * @param next     Next package in the alpha-ordered list.
  98      * @param noDeprecated  If true, do not generate any information for
  99      * deprecated classe or interfaces.
 100      * @throws DocFileIOException if there is a problem generating the package tree page
 101      */
 102     public static void generate(HtmlConfiguration configuration,
 103                                 PackageElement pkg, PackageElement prev,
 104                                 PackageElement next, boolean noDeprecated)
 105             throws DocFileIOException {
 106         DocPath path = DocPath.forPackage(pkg).resolve(DocPaths.PACKAGE_TREE);
 107         PackageTreeWriter packgen = new PackageTreeWriter(configuration, path, pkg, prev, next);
 108         packgen.generatePackageTreeFile();
 109     }
 110 
 111     /**
 112      * Generate a separate tree file for each package.
 113      * @throws DocFileIOException if there is a problem generating the package tree file
 114      */
 115     protected void generatePackageTreeFile() throws DocFileIOException {
 116         HtmlTree body = getPackageTreeHeader();
 117         HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
 118                 ? HtmlTree.MAIN()
 119                 : body;
 120         Content headContent = contents.getContent("doclet.Hierarchy_For_Package",
 121                 utils.getPackageName(packageElement));
 122         Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false,
 123                 HtmlStyle.title, headContent);
 124         Content div = HtmlTree.DIV(HtmlStyle.header, heading);
 125         if (configuration.packages.size() > 1) {
 126             addLinkToMainTree(div);


 175     protected void addLinkToMainTree(Content div) {
 176         Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel,
 177                 contents.packageHierarchies);
 178         div.addContent(span);
 179         HtmlTree ul = new HtmlTree (HtmlTag.UL);
 180         ul.setStyle(HtmlStyle.horizontal);
 181         ul.addContent(getNavLinkMainTree(configuration.getText("doclet.All_Packages")));
 182         div.addContent(ul);
 183     }
 184 
 185     /**
 186      * Get link for the previous package tree file.
 187      *
 188      * @return a content tree for the link
 189      */
 190     @Override
 191     protected Content getNavLinkPrevious() {
 192         if (prev == null) {
 193             return getNavLinkPrevious(null);
 194         } else {
 195             DocPath path = DocPath.relativePath(packageElement, prev);
 196             return getNavLinkPrevious(path.resolve(DocPaths.PACKAGE_TREE));
 197         }
 198     }
 199 
 200     /**
 201      * Get link for the next package tree file.
 202      *
 203      * @return a content tree for the link
 204      */
 205     @Override
 206     protected Content getNavLinkNext() {
 207         if (next == null) {
 208             return getNavLinkNext(null);
 209         } else {
 210             DocPath path = DocPath.relativePath(packageElement, next);
 211             return getNavLinkNext(path.resolve(DocPaths.PACKAGE_TREE));
 212         }
 213     }
 214 
 215     /**
 216      * Get the module link.
 217      *
 218      * @return a content tree for the module link
 219      */
 220     @Override
 221     protected Content getNavLinkModule() {
 222         Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement),
 223                 contents.moduleLabel);
 224         Content li = HtmlTree.LI(linkContent);
 225         return li;
 226     }
 227 
 228     /**
 229      * Get link to the package summary page for the package of this tree.
 230      *


  86         this.prev = prev;
  87         this.next = next;
  88     }
  89 
  90     /**
  91      * Construct a PackageTreeWriter object and then use it to generate the
  92      * package tree page.
  93      *
  94      * @param configuration the configuration for this run.
  95      * @param pkg      Package for which tree file is to be generated.
  96      * @param prev     Previous package in the alpha-ordered list.
  97      * @param next     Next package in the alpha-ordered list.
  98      * @param noDeprecated  If true, do not generate any information for
  99      * deprecated classe or interfaces.
 100      * @throws DocFileIOException if there is a problem generating the package tree page
 101      */
 102     public static void generate(HtmlConfiguration configuration,
 103                                 PackageElement pkg, PackageElement prev,
 104                                 PackageElement next, boolean noDeprecated)
 105             throws DocFileIOException {
 106         DocPath path = configuration.docPaths.forPackage(pkg).resolve(DocPaths.PACKAGE_TREE);
 107         PackageTreeWriter packgen = new PackageTreeWriter(configuration, path, pkg, prev, next);
 108         packgen.generatePackageTreeFile();
 109     }
 110 
 111     /**
 112      * Generate a separate tree file for each package.
 113      * @throws DocFileIOException if there is a problem generating the package tree file
 114      */
 115     protected void generatePackageTreeFile() throws DocFileIOException {
 116         HtmlTree body = getPackageTreeHeader();
 117         HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
 118                 ? HtmlTree.MAIN()
 119                 : body;
 120         Content headContent = contents.getContent("doclet.Hierarchy_For_Package",
 121                 utils.getPackageName(packageElement));
 122         Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false,
 123                 HtmlStyle.title, headContent);
 124         Content div = HtmlTree.DIV(HtmlStyle.header, heading);
 125         if (configuration.packages.size() > 1) {
 126             addLinkToMainTree(div);


 175     protected void addLinkToMainTree(Content div) {
 176         Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel,
 177                 contents.packageHierarchies);
 178         div.addContent(span);
 179         HtmlTree ul = new HtmlTree (HtmlTag.UL);
 180         ul.setStyle(HtmlStyle.horizontal);
 181         ul.addContent(getNavLinkMainTree(configuration.getText("doclet.All_Packages")));
 182         div.addContent(ul);
 183     }
 184 
 185     /**
 186      * Get link for the previous package tree file.
 187      *
 188      * @return a content tree for the link
 189      */
 190     @Override
 191     protected Content getNavLinkPrevious() {
 192         if (prev == null) {
 193             return getNavLinkPrevious(null);
 194         } else {
 195             DocPath path = docPaths.relativePath(packageElement, prev);
 196             return getNavLinkPrevious(path.resolve(DocPaths.PACKAGE_TREE));
 197         }
 198     }
 199 
 200     /**
 201      * Get link for the next package tree file.
 202      *
 203      * @return a content tree for the link
 204      */
 205     @Override
 206     protected Content getNavLinkNext() {
 207         if (next == null) {
 208             return getNavLinkNext(null);
 209         } else {
 210             DocPath path = docPaths.relativePath(packageElement, next);
 211             return getNavLinkNext(path.resolve(DocPaths.PACKAGE_TREE));
 212         }
 213     }
 214 
 215     /**
 216      * Get the module link.
 217      *
 218      * @return a content tree for the module link
 219      */
 220     @Override
 221     protected Content getNavLinkModule() {
 222         Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement),
 223                 contents.moduleLabel);
 224         Content li = HtmlTree.LI(linkContent);
 225         return li;
 226     }
 227 
 228     /**
 229      * Get link to the package summary page for the package of this tree.
 230      *
< prev index next >