< prev index next >

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

Print this page




 138      *
 139      * @param contentTree the content tree to which the links will be added
 140      */
 141     protected void addPackageTreeLinks(Content contentTree) {
 142         //Do nothing if only unnamed package is used
 143         if (isUnnamedPackage()) {
 144             return;
 145         }
 146         if (!classesOnly) {
 147             Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel,
 148                     contents.packageHierarchies);
 149             contentTree.add(span);
 150             HtmlTree ul = new HtmlTree(HtmlTag.UL);
 151             ul.setStyle(HtmlStyle.horizontal);
 152             int i = 0;
 153             for (PackageElement pkg : packages) {
 154                 // If the package name length is 0 or if -nodeprecated option
 155                 // is set and the package is marked as deprecated, do not include
 156                 // the page in the list of package hierarchies.
 157                 if (pkg.isUnnamed() ||
 158                         (configuration.nodeprecated && utils.isDeprecated(pkg))) {
 159                     i++;
 160                     continue;
 161                 }
 162                 DocPath link = pathString(pkg, DocPaths.PACKAGE_TREE);
 163                 Content li = HtmlTree.LI(links.createLink(link,
 164                         new StringContent(utils.getPackageName(pkg))));
 165                 if (i < packages.size() - 1) {
 166                     li.add(", ");
 167                 }
 168                 ul.add(li);
 169                 i++;
 170             }
 171             contentTree.add(ul);
 172         }
 173     }
 174 
 175     /**
 176      * Get the tree header.
 177      *
 178      * @return a content tree for the tree header


 138      *
 139      * @param contentTree the content tree to which the links will be added
 140      */
 141     protected void addPackageTreeLinks(Content contentTree) {
 142         //Do nothing if only unnamed package is used
 143         if (isUnnamedPackage()) {
 144             return;
 145         }
 146         if (!classesOnly) {
 147             Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel,
 148                     contents.packageHierarchies);
 149             contentTree.add(span);
 150             HtmlTree ul = new HtmlTree(HtmlTag.UL);
 151             ul.setStyle(HtmlStyle.horizontal);
 152             int i = 0;
 153             for (PackageElement pkg : packages) {
 154                 // If the package name length is 0 or if -nodeprecated option
 155                 // is set and the package is marked as deprecated, do not include
 156                 // the page in the list of package hierarchies.
 157                 if (pkg.isUnnamed() ||
 158                         (options.noDeprecated && utils.isDeprecated(pkg))) {
 159                     i++;
 160                     continue;
 161                 }
 162                 DocPath link = pathString(pkg, DocPaths.PACKAGE_TREE);
 163                 Content li = HtmlTree.LI(links.createLink(link,
 164                         new StringContent(utils.getPackageName(pkg))));
 165                 if (i < packages.size() - 1) {
 166                     li.add(", ");
 167                 }
 168                 ul.add(li);
 169                 i++;
 170             }
 171             contentTree.add(ul);
 172         }
 173     }
 174 
 175     /**
 176      * Get the tree header.
 177      *
 178      * @return a content tree for the tree header
< prev index next >