langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java
changeset 26900 dccc7a72526d
parent 25874 83c19f00452c
child 29957 7740f9657f56
equal deleted inserted replaced
26786:f0c5e4b732da 26900:dccc7a72526d
   205                 if (i % 2 == 0) {
   205                 if (i % 2 == 0) {
   206                     tr.addStyle(HtmlStyle.altColor);
   206                     tr.addStyle(HtmlStyle.altColor);
   207                 } else {
   207                 } else {
   208                     tr.addStyle(HtmlStyle.rowColor);
   208                     tr.addStyle(HtmlStyle.rowColor);
   209                 }
   209                 }
   210                 addClassRow(itc.next(), packageName, tr);
   210                 addClassRow(itc.next(), usingPackage, tr);
   211                 tbody.addContent(tr);
   211                 tbody.addContent(tr);
   212             }
   212             }
   213             table.addContent(tbody);
   213             table.addContent(tbody);
   214             li.addContent(table);
   214             li.addContent(table);
   215             contentTree.addContent(li);
   215             contentTree.addContent(li);
   218 
   218 
   219     /**
   219     /**
   220      * Add a row for the class that uses the given package.
   220      * Add a row for the class that uses the given package.
   221      *
   221      *
   222      * @param usedClass the class that uses the given package
   222      * @param usedClass the class that uses the given package
   223      * @param packageName the name of the package to which the class belongs
   223      * @param pkg the package to which the class belongs
   224      * @param contentTree the content tree to which the row will be added
   224      * @param contentTree the content tree to which the row will be added
   225      */
   225      */
   226     protected void addClassRow(ClassDoc usedClass, String packageName,
   226     protected void addClassRow(ClassDoc usedClass, PackageDoc pkg,
   227             Content contentTree) {
   227             Content contentTree) {
   228         DocPath dp = pathString(usedClass,
   228         DocPath dp = pathString(usedClass,
   229                 DocPaths.CLASS_USE.resolve(DocPath.forName(usedClass)));
   229                 DocPaths.CLASS_USE.resolve(DocPath.forName(usedClass)));
   230         Content td = HtmlTree.TD(HtmlStyle.colOne,
   230         Content td = HtmlTree.TD(HtmlStyle.colOne,
   231                 getHyperLink(dp.fragment(packageName), new StringContent(usedClass.name())));
   231                 getHyperLink(dp.fragment(getPackageAnchorName(pkg)), new StringContent(usedClass.name())));
   232         addIndexComment(usedClass, td);
   232         addIndexComment(usedClass, td);
   233         contentTree.addContent(td);
   233         contentTree.addContent(td);
   234     }
   234     }
   235 
   235 
   236     /**
   236     /**