1 /* |
1 /* |
2 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2014, 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 |
90 public static void generate(ConfigurationImpl configuration, |
90 public static void generate(ConfigurationImpl configuration, |
91 PackageDoc packageDoc) { |
91 PackageDoc packageDoc) { |
92 PackageFrameWriter packgen; |
92 PackageFrameWriter packgen; |
93 try { |
93 try { |
94 packgen = new PackageFrameWriter(configuration, packageDoc); |
94 packgen = new PackageFrameWriter(configuration, packageDoc); |
95 String pkgName = Util.getPackageName(packageDoc); |
95 String pkgName = configuration.utils.getPackageName(packageDoc); |
96 Content body = packgen.getBody(false, packgen.getWindowTitle(pkgName)); |
96 Content body = packgen.getBody(false, packgen.getWindowTitle(pkgName)); |
97 Content pkgNameContent = new StringContent(pkgName); |
97 Content pkgNameContent = new StringContent(pkgName); |
98 Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar, |
98 Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar, |
99 packgen.getTargetPackageLink(packageDoc, "classFrame", pkgNameContent)); |
99 packgen.getTargetPackageLink(packageDoc, "classFrame", pkgNameContent)); |
100 body.addContent(heading); |
100 body.addContent(heading); |
134 addClassKindListing(packageDoc.errors(), |
134 addClassKindListing(packageDoc.errors(), |
135 getResource("doclet.Errors"), contentTree); |
135 getResource("doclet.Errors"), contentTree); |
136 addClassKindListing(packageDoc.annotationTypes(), |
136 addClassKindListing(packageDoc.annotationTypes(), |
137 getResource("doclet.AnnotationTypes"), contentTree); |
137 getResource("doclet.AnnotationTypes"), contentTree); |
138 } else { |
138 } else { |
139 String name = Util.getPackageName(packageDoc); |
139 String name = utils.getPackageName(packageDoc); |
140 addClassKindListing(config.classDocCatalog.interfaces(name), |
140 addClassKindListing(config.classDocCatalog.interfaces(name), |
141 getResource("doclet.Interfaces"), contentTree); |
141 getResource("doclet.Interfaces"), contentTree); |
142 addClassKindListing(config.classDocCatalog.ordinaryClasses(name), |
142 addClassKindListing(config.classDocCatalog.ordinaryClasses(name), |
143 getResource("doclet.Classes"), contentTree); |
143 getResource("doclet.Classes"), contentTree); |
144 addClassKindListing(config.classDocCatalog.enums(name), |
144 addClassKindListing(config.classDocCatalog.enums(name), |
159 * @param labelContent content tree of the label to be added |
159 * @param labelContent content tree of the label to be added |
160 * @param contentTree the content tree to which the class kind listing will be added |
160 * @param contentTree the content tree to which the class kind listing will be added |
161 */ |
161 */ |
162 protected void addClassKindListing(ClassDoc[] arr, Content labelContent, |
162 protected void addClassKindListing(ClassDoc[] arr, Content labelContent, |
163 Content contentTree) { |
163 Content contentTree) { |
164 arr = Util.filterOutPrivateClasses(arr, configuration.javafx); |
164 arr = utils.filterOutPrivateClasses(arr, configuration.javafx); |
165 if(arr.length > 0) { |
165 if(arr.length > 0) { |
166 Arrays.sort(arr); |
166 Arrays.sort(arr); |
167 boolean printedHeader = false; |
167 boolean printedHeader = false; |
168 HtmlTree ul = new HtmlTree(HtmlTag.UL); |
168 HtmlTree ul = new HtmlTree(HtmlTag.UL); |
169 ul.setTitle(labelContent); |
169 ul.setTitle(labelContent); |
170 for (ClassDoc classDoc : arr) { |
170 for (ClassDoc classDoc : arr) { |
171 if (documentedClasses != null && !documentedClasses.contains(classDoc)) { |
171 if (documentedClasses != null && !documentedClasses.contains(classDoc)) { |
172 continue; |
172 continue; |
173 } |
173 } |
174 if (!Util.isCoreClass(classDoc) || !configuration.isGeneratedDoc(classDoc)) { |
174 if (!utils.isCoreClass(classDoc) || !configuration.isGeneratedDoc(classDoc)) { |
175 continue; |
175 continue; |
176 } |
176 } |
177 if (!printedHeader) { |
177 if (!printedHeader) { |
178 Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, |
178 Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, |
179 true, labelContent); |
179 true, labelContent); |