163 // If -nodeprecated option is set and the containing package is marked |
163 // If -nodeprecated option is set and the containing package is marked |
164 // as deprecated, do not generate the class-use page. We will still generate |
164 // as deprecated, do not generate the class-use page. We will still generate |
165 // the class-use page if the class is marked as deprecated but the containing |
165 // the class-use page if the class is marked as deprecated but the containing |
166 // package is not since it could still be linked from that package-use page. |
166 // package is not since it could still be linked from that package-use page. |
167 if (!(configuration.nodeprecated && |
167 if (!(configuration.nodeprecated && |
168 Util.isDeprecated(aClass.containingPackage()))) |
168 configuration.utils.isDeprecated(aClass.containingPackage()))) |
169 ClassUseWriter.generate(configuration, mapper, aClass); |
169 ClassUseWriter.generate(configuration, mapper, aClass); |
170 } |
170 } |
171 for (PackageDoc pkg : configuration.packages) { |
171 for (PackageDoc pkg : configuration.packages) { |
172 // If -nodeprecated option is set and the package is marked |
172 // If -nodeprecated option is set and the package is marked |
173 // as deprecated, do not generate the package-use page. |
173 // as deprecated, do not generate the package-use page. |
174 if (!(configuration.nodeprecated && Util.isDeprecated(pkg))) |
174 if (!(configuration.nodeprecated && configuration.utils.isDeprecated(pkg))) |
175 PackageUseWriter.generate(configuration, mapper, pkg); |
175 PackageUseWriter.generate(configuration, mapper, pkg); |
176 } |
176 } |
177 } |
177 } |
178 |
178 |
179 private Map<String,List<ProgramElementDoc>> pkgDivide(Map<String,? extends List<? extends ProgramElementDoc>> classMap) { |
179 private Map<String,List<ProgramElementDoc>> pkgDivide(Map<String,? extends List<? extends ProgramElementDoc>> classMap) { |
180 Map<String,List<ProgramElementDoc>> map = new HashMap<>(); |
180 Map<String,List<ProgramElementDoc>> map = new HashMap<>(); |
181 List<? extends ProgramElementDoc> list= classMap.get(classdoc.qualifiedName()); |
181 List<? extends ProgramElementDoc> list= classMap.get(classdoc.qualifiedName()); |
182 if (list != null) { |
182 if (list != null) { |
183 Collections.sort(list, Util.makeComparatorForClassUse()); |
183 Collections.sort(list, utils.makeComparatorForClassUse()); |
184 for (ProgramElementDoc doc : list) { |
184 for (ProgramElementDoc doc : list) { |
185 PackageDoc pkg = doc.containingPackage(); |
185 PackageDoc pkg = doc.containingPackage(); |
186 pkgSet.add(pkg); |
186 pkgSet.add(pkg); |
187 List<ProgramElementDoc> inPkg = map.get(pkg.name()); |
187 List<ProgramElementDoc> inPkg = map.get(pkg.name()); |
188 if (inPkg == null) { |
188 if (inPkg == null) { |
335 for (PackageDoc pkg : pkgSet) { |
335 for (PackageDoc pkg : pkgSet) { |
336 Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name())); |
336 Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name())); |
337 Content link = getResource("doclet.ClassUse_Uses.of.0.in.1", |
337 Content link = getResource("doclet.ClassUse_Uses.of.0.in.1", |
338 getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, |
338 getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, |
339 classdoc)), |
339 classdoc)), |
340 getPackageLink(pkg, Util.getPackageName(pkg))); |
340 getPackageLink(pkg, utils.getPackageName(pkg))); |
341 Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link); |
341 Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link); |
342 li.addContent(heading); |
342 li.addContent(heading); |
343 addClassUse(pkg, li); |
343 addClassUse(pkg, li); |
344 ul.addContent(li); |
344 ul.addContent(li); |
345 } |
345 } |
353 * @param pkg the package that uses the given class |
353 * @param pkg the package that uses the given class |
354 * @param contentTree the content tree to which the package use information will be added |
354 * @param contentTree the content tree to which the package use information will be added |
355 */ |
355 */ |
356 protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException { |
356 protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException { |
357 Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst, |
357 Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst, |
358 getHyperLink(pkg.name(), new StringContent(Util.getPackageName(pkg)))); |
358 getHyperLink(pkg.name(), new StringContent(utils.getPackageName(pkg)))); |
359 contentTree.addContent(tdFirst); |
359 contentTree.addContent(tdFirst); |
360 HtmlTree tdLast = new HtmlTree(HtmlTag.TD); |
360 HtmlTree tdLast = new HtmlTree(HtmlTag.TD); |
361 tdLast.addStyle(HtmlStyle.colLast); |
361 tdLast.addStyle(HtmlStyle.colLast); |
362 addSummaryComment(pkg, tdLast); |
362 addSummaryComment(pkg, tdLast); |
363 contentTree.addContent(tdLast); |
363 contentTree.addContent(tdLast); |
370 * @param contentTree the content tree to which the class use information will be added |
370 * @param contentTree the content tree to which the class use information will be added |
371 */ |
371 */ |
372 protected void addClassUse(PackageDoc pkg, Content contentTree) throws IOException { |
372 protected void addClassUse(PackageDoc pkg, Content contentTree) throws IOException { |
373 Content classLink = getLink(new LinkInfoImpl(configuration, |
373 Content classLink = getLink(new LinkInfoImpl(configuration, |
374 LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)); |
374 LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)); |
375 Content pkgLink = getPackageLink(pkg, Util.getPackageName(pkg)); |
375 Content pkgLink = getPackageLink(pkg, utils.getPackageName(pkg)); |
376 classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg.name()), |
376 classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg.name()), |
377 configuration.getResource("doclet.ClassUse_Annotation", classLink, |
377 configuration.getResource("doclet.ClassUse_Annotation", classLink, |
378 pkgLink), classUseTableSummary, contentTree); |
378 pkgLink), classUseTableSummary, contentTree); |
379 classSubWriter.addUseInfo(pkgToClassTypeParameter.get(pkg.name()), |
379 classSubWriter.addUseInfo(pkgToClassTypeParameter.get(pkg.name()), |
380 configuration.getResource("doclet.ClassUse_TypeParameter", classLink, |
380 configuration.getResource("doclet.ClassUse_TypeParameter", classLink, |