1 /* |
1 /* |
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
34 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
34 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; |
35 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
35 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
36 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
36 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; |
37 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
37 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; |
38 import jdk.javadoc.internal.doclets.toolkit.Content; |
38 import jdk.javadoc.internal.doclets.toolkit.Content; |
|
39 import jdk.javadoc.internal.doclets.toolkit.Messages; |
39 import jdk.javadoc.internal.doclets.toolkit.util.ClassTree; |
40 import jdk.javadoc.internal.doclets.toolkit.util.ClassTree; |
40 import jdk.javadoc.internal.doclets.toolkit.util.DocPath; |
41 import jdk.javadoc.internal.doclets.toolkit.util.DocPath; |
41 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
42 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
42 import jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException; |
43 import jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException; |
43 |
44 |
94 TreeWriter treegen; |
95 TreeWriter treegen; |
95 DocPath filename = DocPaths.OVERVIEW_TREE; |
96 DocPath filename = DocPaths.OVERVIEW_TREE; |
96 try { |
97 try { |
97 treegen = new TreeWriter(configuration, filename, classtree); |
98 treegen = new TreeWriter(configuration, filename, classtree); |
98 treegen.generateTreeFile(); |
99 treegen.generateTreeFile(); |
99 treegen.close(); |
|
100 } catch (IOException exc) { |
100 } catch (IOException exc) { |
101 configuration.standardmessage.error( |
101 Messages messages = configuration.getMessages(); |
102 "doclet.exception_encountered", |
102 messages.error("doclet.exception_encountered", |
103 exc.toString(), filename); |
103 exc.toString(), filename); |
104 throw new DocletAbortException(exc); |
104 throw new DocletAbortException(exc); |
105 } |
105 } |
106 } |
106 } |
107 |
107 |
108 /** |
108 /** |
109 * Generate the interface hierarchy and class hierarchy. |
109 * Generate the interface hierarchy and class hierarchy. |
110 */ |
110 */ |
111 public void generateTreeFile() throws IOException { |
111 public void generateTreeFile() throws IOException { |
112 HtmlTree body = getTreeHeader(); |
112 HtmlTree body = getTreeHeader(); |
113 Content headContent = getResource("doclet.Hierarchy_For_All_Packages"); |
113 Content headContent = contents.hierarchyForAllPackages; |
114 Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, |
114 Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, |
115 HtmlStyle.title, headContent); |
115 HtmlStyle.title, headContent); |
116 Content div = HtmlTree.DIV(HtmlStyle.header, heading); |
116 Content div = HtmlTree.DIV(HtmlStyle.header, heading); |
117 addPackageTreeLinks(div); |
117 addPackageTreeLinks(div); |
118 HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN)) |
118 HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN)) |
152 if (isUnnamedPackage()) { |
152 if (isUnnamedPackage()) { |
153 return; |
153 return; |
154 } |
154 } |
155 if (!classesonly) { |
155 if (!classesonly) { |
156 Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel, |
156 Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel, |
157 getResource("doclet.Package_Hierarchies")); |
157 contents.packageHierarchies); |
158 contentTree.addContent(span); |
158 contentTree.addContent(span); |
159 HtmlTree ul = new HtmlTree(HtmlTag.UL); |
159 HtmlTree ul = new HtmlTree(HtmlTag.UL); |
160 ul.addStyle(HtmlStyle.horizontal); |
160 ul.addStyle(HtmlStyle.horizontal); |
161 int i = 0; |
161 int i = 0; |
162 for (PackageElement pkg : packages) { |
162 for (PackageElement pkg : packages) { |