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

changeset 1372
78962d89f283
parent 1359
25e14ad23cef
child 1373
4a1c57a1c410
equal deleted inserted replaced
1366:12cf6bfd8c05 1372:78962d89f283
55 * @param filename the file to be generated. 55 * @param filename the file to be generated.
56 * @throws IOException 56 * @throws IOException
57 * @throws DocletAbortException 57 * @throws DocletAbortException
58 */ 58 */
59 public PackageUseWriter(ConfigurationImpl configuration, 59 public PackageUseWriter(ConfigurationImpl configuration,
60 ClassUseMapper mapper, String filename, 60 ClassUseMapper mapper, DocPath filename,
61 PackageDoc pkgdoc) throws IOException { 61 PackageDoc pkgdoc) throws IOException {
62 super(configuration, DirectoryManager.getDirectoryPath(pkgdoc), 62 super(configuration, DocPath.forPackage(pkgdoc).resolve(filename));
63 filename,
64 DirectoryManager.getRelativePath(pkgdoc.name()));
65 this.pkgdoc = pkgdoc; 63 this.pkgdoc = pkgdoc;
66 64
67 // by examining all classes in this package, find what packages 65 // by examining all classes in this package, find what packages
68 // use these classes - produce a map between using package and 66 // use these classes - produce a map between using package and
69 // used classes. 67 // used classes.
96 * @param pkgdoc the package doc being documented. 94 * @param pkgdoc the package doc being documented.
97 */ 95 */
98 public static void generate(ConfigurationImpl configuration, 96 public static void generate(ConfigurationImpl configuration,
99 ClassUseMapper mapper, PackageDoc pkgdoc) { 97 ClassUseMapper mapper, PackageDoc pkgdoc) {
100 PackageUseWriter pkgusegen; 98 PackageUseWriter pkgusegen;
101 String filename = "package-use.html"; 99 DocPath filename = DocPaths.PACKAGE_USE;
102 try { 100 try {
103 pkgusegen = new PackageUseWriter(configuration, 101 pkgusegen = new PackageUseWriter(configuration,
104 mapper, filename, pkgdoc); 102 mapper, filename, pkgdoc);
105 pkgusegen.generatePackageUseFile(); 103 pkgusegen.generatePackageUseFile();
106 pkgusegen.close(); 104 pkgusegen.close();
230 * @param packageName the name of the package to which the class belongs 228 * @param packageName the name of the package to which the class belongs
231 * @param contentTree the content tree to which the row will be added 229 * @param contentTree the content tree to which the row will be added
232 */ 230 */
233 protected void addClassRow(ClassDoc usedClass, String packageName, 231 protected void addClassRow(ClassDoc usedClass, String packageName,
234 Content contentTree) { 232 Content contentTree) {
235 String path = pathString(usedClass, 233 DocPath path = pathString(usedClass,
236 "class-use/" + usedClass.name() + ".html"); 234 DocPaths.CLASS_USE.resolve(DocPath.forName(usedClass)));
237 Content td = HtmlTree.TD(HtmlStyle.colOne, 235 Content td = HtmlTree.TD(HtmlStyle.colOne,
238 getHyperLink(path, packageName, new StringContent(usedClass.name()))); 236 getHyperLink(path, packageName, new StringContent(usedClass.name())));
239 addIndexComment(usedClass, td); 237 addIndexComment(usedClass, td);
240 contentTree.addContent(td); 238 contentTree.addContent(td);
241 } 239 }
246 * @param pkg the package that used the given package 244 * @param pkg the package that used the given package
247 * @param contentTree the content tree to which the information will be added 245 * @param contentTree the content tree to which the information will be added
248 */ 246 */
249 protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException { 247 protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException {
250 Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst, 248 Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
251 getHyperLink("", Util.getPackageName(pkg), 249 getHyperLink(Util.getPackageName(pkg),
252 new RawHtml(Util.getPackageName(pkg)))); 250 new RawHtml(Util.getPackageName(pkg))));
253 contentTree.addContent(tdFirst); 251 contentTree.addContent(tdFirst);
254 HtmlTree tdLast = new HtmlTree(HtmlTag.TD); 252 HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
255 tdLast.addStyle(HtmlStyle.colLast); 253 tdLast.addStyle(HtmlStyle.colLast);
256 if (pkg != null && pkg.name().length() != 0) { 254 if (pkg != null && pkg.name().length() != 0) {
286 * Get this package link. 284 * Get this package link.
287 * 285 *
288 * @return a content tree for the package link 286 * @return a content tree for the package link
289 */ 287 */
290 protected Content getNavLinkPackage() { 288 protected Content getNavLinkPackage() {
291 Content linkContent = getHyperLink("package-summary.html", "", 289 Content linkContent = getHyperLink(DocPaths.PACKAGE_SUMMARY, "",
292 packageLabel); 290 packageLabel);
293 Content li = HtmlTree.LI(linkContent); 291 Content li = HtmlTree.LI(linkContent);
294 return li; 292 return li;
295 } 293 }
296 294
308 * Get the tree link. 306 * Get the tree link.
309 * 307 *
310 * @return a content tree for the tree link 308 * @return a content tree for the tree link
311 */ 309 */
312 protected Content getNavLinkTree() { 310 protected Content getNavLinkTree() {
313 Content linkContent = getHyperLink("package-tree.html", "", 311 Content linkContent = getHyperLink(DocPaths.PACKAGE_TREE, "",
314 treeLabel); 312 treeLabel);
315 Content li = HtmlTree.LI(linkContent); 313 Content li = HtmlTree.LI(linkContent);
316 return li; 314 return li;
317 } 315 }
318 } 316 }

mercurial