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

changeset 1372
78962d89f283
parent 1359
25e14ad23cef
child 1373
4a1c57a1c410
equal deleted inserted replaced
1366:12cf6bfd8c05 1372:78962d89f283
65 * Constructor. 65 * Constructor.
66 * @throws IOException 66 * @throws IOException
67 * @throws DocletAbortException 67 * @throws DocletAbortException
68 */ 68 */
69 public PackageTreeWriter(ConfigurationImpl configuration, 69 public PackageTreeWriter(ConfigurationImpl configuration,
70 String path, String filename, 70 DocPath path,
71 PackageDoc packagedoc, 71 PackageDoc packagedoc,
72 PackageDoc prev, PackageDoc next) 72 PackageDoc prev, PackageDoc next)
73 throws IOException { 73 throws IOException {
74 super(configuration, path, filename, 74 super(configuration, path,
75 new ClassTree( 75 new ClassTree(
76 configuration.classDocCatalog.allClasses(packagedoc), 76 configuration.classDocCatalog.allClasses(packagedoc),
77 configuration), 77 configuration));
78 packagedoc);
79 this.packagedoc = packagedoc; 78 this.packagedoc = packagedoc;
80 this.prev = prev; 79 this.prev = prev;
81 this.next = next; 80 this.next = next;
82 } 81 }
83 82
94 */ 93 */
95 public static void generate(ConfigurationImpl configuration, 94 public static void generate(ConfigurationImpl configuration,
96 PackageDoc pkg, PackageDoc prev, 95 PackageDoc pkg, PackageDoc prev,
97 PackageDoc next, boolean noDeprecated) { 96 PackageDoc next, boolean noDeprecated) {
98 PackageTreeWriter packgen; 97 PackageTreeWriter packgen;
99 String path = DirectoryManager.getDirectoryPath(pkg); 98 DocPath path = DocPath.forPackage(pkg).resolve(DocPaths.PACKAGE_TREE);
100 String filename = "package-tree.html";
101 try { 99 try {
102 packgen = new PackageTreeWriter(configuration, path, filename, pkg, 100 packgen = new PackageTreeWriter(configuration, path, pkg,
103 prev, next); 101 prev, next);
104 packgen.generatePackageTreeFile(); 102 packgen.generatePackageTreeFile();
105 packgen.close(); 103 packgen.close();
106 } catch (IOException exc) { 104 } catch (IOException exc) {
107 configuration.standardmessage.error( 105 configuration.standardmessage.error(
108 "doclet.exception_encountered", 106 "doclet.exception_encountered",
109 exc.toString(), filename); 107 exc.toString(), path.getPath());
110 throw new DocletAbortException(); 108 throw new DocletAbortException();
111 } 109 }
112 } 110 }
113 111
114 /** 112 /**
173 */ 171 */
174 protected Content getNavLinkPrevious() { 172 protected Content getNavLinkPrevious() {
175 if (prev == null) { 173 if (prev == null) {
176 return getNavLinkPrevious(null); 174 return getNavLinkPrevious(null);
177 } else { 175 } else {
178 String path = DirectoryManager.getRelativePath(packagedoc.name(), 176 DocPath path = DocPath.relativePath(packagedoc, prev);
179 prev.name()); 177 return getNavLinkPrevious(path.resolve(DocPaths.PACKAGE_TREE));
180 return getNavLinkPrevious(path + "package-tree.html");
181 } 178 }
182 } 179 }
183 180
184 /** 181 /**
185 * Get link for the next package tree file. 182 * Get link for the next package tree file.
188 */ 185 */
189 protected Content getNavLinkNext() { 186 protected Content getNavLinkNext() {
190 if (next == null) { 187 if (next == null) {
191 return getNavLinkNext(null); 188 return getNavLinkNext(null);
192 } else { 189 } else {
193 String path = DirectoryManager.getRelativePath(packagedoc.name(), 190 DocPath path = DocPath.relativePath(packagedoc, next);
194 next.name()); 191 return getNavLinkNext(path.resolve(DocPaths.PACKAGE_TREE));
195 return getNavLinkNext(path + "package-tree.html");
196 } 192 }
197 } 193 }
198 194
199 /** 195 /**
200 * Get link to the package summary page for the package of this tree. 196 * Get link to the package summary page for the package of this tree.
201 * 197 *
202 * @return a content tree for the package link 198 * @return a content tree for the package link
203 */ 199 */
204 protected Content getNavLinkPackage() { 200 protected Content getNavLinkPackage() {
205 Content linkContent = getHyperLink("package-summary.html", "", 201 Content linkContent = getHyperLink(DocPaths.PACKAGE_SUMMARY, "",
206 packageLabel); 202 packageLabel);
207 Content li = HtmlTree.LI(linkContent); 203 Content li = HtmlTree.LI(linkContent);
208 return li; 204 return li;
209 } 205 }
210 } 206 }

mercurial