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

Tue, 24 Dec 2013 09:17:37 -0800

author
ksrini
date
Tue, 24 Dec 2013 09:17:37 -0800
changeset 2227
998b10c43157
parent 2084
6e186ca11ec0
child 2525
2eb010b6cb22
permissions
-rw-r--r--

8029230: Update copyright year to match last edit in jdk8 langtools repository for 2013
Reviewed-by: ksrini
Contributed-by: steve.sides@oracle.com

duke@1 1 /*
jjg@1735 2 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
ohair@554 7 * published by the Free Software Foundation. Oracle designates this
duke@1 8 * particular file as subject to the "Classpath" exception as provided
ohair@554 9 * by Oracle in the LICENSE file that accompanied this code.
duke@1 10 *
duke@1 11 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 14 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 15 * accompanied this code).
duke@1 16 *
duke@1 17 * You should have received a copy of the GNU General Public License version
duke@1 18 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 20 *
ohair@554 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@554 22 * or visit www.oracle.com if you need additional information or have any
ohair@554 23 * questions.
duke@1 24 */
duke@1 25
duke@1 26 package com.sun.tools.doclets.formats.html;
duke@1 27
jjg@1965 28 import java.io.IOException;
jjg@1965 29 import java.util.ArrayList;
jjg@1965 30 import java.util.Collections;
jjg@1965 31 import java.util.HashMap;
jjg@1965 32 import java.util.Iterator;
jjg@1965 33 import java.util.List;
jjg@1965 34 import java.util.Map;
jjg@1965 35 import java.util.Set;
jjg@1965 36 import java.util.SortedSet;
jjg@1965 37 import java.util.TreeSet;
jjg@1357 38
bpatel@766 39 import com.sun.javadoc.*;
bpatel@766 40 import com.sun.tools.doclets.formats.html.markup.*;
bpatel@766 41 import com.sun.tools.doclets.internal.toolkit.*;
jjg@1357 42 import com.sun.tools.doclets.internal.toolkit.util.*;
duke@1 43
duke@1 44 /**
duke@1 45 * Generate class usage information.
duke@1 46 *
jjg@1359 47 * <p><b>This is NOT part of any supported API.
jjg@1359 48 * If you write code that depends on this, you do so at your own risk.
jjg@1359 49 * This code and its internal interfaces are subject to change or
jjg@1359 50 * deletion without notice.</b>
jjg@1359 51 *
duke@1 52 * @author Robert G. Field
bpatel@243 53 * @author Bhavesh Patel (Modified)
duke@1 54 */
duke@1 55 public class ClassUseWriter extends SubWriterHolderWriter {
duke@1 56
duke@1 57 final ClassDoc classdoc;
mcimadamore@184 58 Set<PackageDoc> pkgToPackageAnnotations = null;
jjg@74 59 final Map<String,List<ProgramElementDoc>> pkgToClassTypeParameter;
jjg@74 60 final Map<String,List<ProgramElementDoc>> pkgToClassAnnotations;
jjg@74 61 final Map<String,List<ProgramElementDoc>> pkgToMethodTypeParameter;
jjg@74 62 final Map<String,List<ProgramElementDoc>> pkgToMethodArgTypeParameter;
jjg@74 63 final Map<String,List<ProgramElementDoc>> pkgToMethodReturnTypeParameter;
jjg@74 64 final Map<String,List<ProgramElementDoc>> pkgToMethodAnnotations;
jjg@74 65 final Map<String,List<ProgramElementDoc>> pkgToMethodParameterAnnotations;
jjg@74 66 final Map<String,List<ProgramElementDoc>> pkgToFieldTypeParameter;
jjg@74 67 final Map<String,List<ProgramElementDoc>> pkgToFieldAnnotations;
jjg@74 68 final Map<String,List<ProgramElementDoc>> pkgToSubclass;
jjg@74 69 final Map<String,List<ProgramElementDoc>> pkgToSubinterface;
jjg@74 70 final Map<String,List<ProgramElementDoc>> pkgToImplementingClass;
jjg@74 71 final Map<String,List<ProgramElementDoc>> pkgToField;
jjg@74 72 final Map<String,List<ProgramElementDoc>> pkgToMethodReturn;
jjg@74 73 final Map<String,List<ProgramElementDoc>> pkgToMethodArgs;
jjg@74 74 final Map<String,List<ProgramElementDoc>> pkgToMethodThrows;
jjg@74 75 final Map<String,List<ProgramElementDoc>> pkgToConstructorAnnotations;
jjg@74 76 final Map<String,List<ProgramElementDoc>> pkgToConstructorParameterAnnotations;
jjg@74 77 final Map<String,List<ProgramElementDoc>> pkgToConstructorArgs;
jjg@74 78 final Map<String,List<ProgramElementDoc>> pkgToConstructorArgTypeParameter;
jjg@74 79 final Map<String,List<ProgramElementDoc>> pkgToConstructorThrows;
jjg@74 80 final SortedSet<PackageDoc> pkgSet;
duke@1 81 final MethodWriterImpl methodSubWriter;
duke@1 82 final ConstructorWriterImpl constrSubWriter;
duke@1 83 final FieldWriterImpl fieldSubWriter;
duke@1 84 final NestedClassWriterImpl classSubWriter;
bpatel@243 85 // Summary for various use tables.
bpatel@243 86 final String classUseTableSummary;
bpatel@243 87 final String subclassUseTableSummary;
bpatel@243 88 final String subinterfaceUseTableSummary;
bpatel@243 89 final String fieldUseTableSummary;
bpatel@243 90 final String methodUseTableSummary;
bpatel@243 91 final String constructorUseTableSummary;
duke@1 92
duke@1 93 /**
duke@1 94 * Constructor.
duke@1 95 *
duke@1 96 * @param filename the file to be generated.
duke@1 97 * @throws IOException
duke@1 98 * @throws DocletAbortException
duke@1 99 */
duke@1 100 public ClassUseWriter(ConfigurationImpl configuration,
jjg@1372 101 ClassUseMapper mapper, DocPath filename,
duke@1 102 ClassDoc classdoc) throws IOException {
jjg@1372 103 super(configuration, filename);
duke@1 104 this.classdoc = classdoc;
duke@1 105 if (mapper.classToPackageAnnotations.containsKey(classdoc.qualifiedName()))
jjg@1965 106 pkgToPackageAnnotations = new TreeSet<PackageDoc>(mapper.classToPackageAnnotations.get(classdoc.qualifiedName()));
duke@1 107 configuration.currentcd = classdoc;
jjg@74 108 this.pkgSet = new TreeSet<PackageDoc>();
duke@1 109 this.pkgToClassTypeParameter = pkgDivide(mapper.classToClassTypeParam);
duke@1 110 this.pkgToClassAnnotations = pkgDivide(mapper.classToClassAnnotations);
duke@1 111 this.pkgToMethodTypeParameter = pkgDivide(mapper.classToExecMemberDocTypeParam);
duke@1 112 this.pkgToMethodArgTypeParameter = pkgDivide(mapper.classToExecMemberDocArgTypeParam);
duke@1 113 this.pkgToFieldTypeParameter = pkgDivide(mapper.classToFieldDocTypeParam);
duke@1 114 this.pkgToFieldAnnotations = pkgDivide(mapper.annotationToFieldDoc);
duke@1 115 this.pkgToMethodReturnTypeParameter = pkgDivide(mapper.classToExecMemberDocReturnTypeParam);
duke@1 116 this.pkgToMethodAnnotations = pkgDivide(mapper.classToExecMemberDocAnnotations);
duke@1 117 this.pkgToMethodParameterAnnotations = pkgDivide(mapper.classToExecMemberDocParamAnnotation);
duke@1 118 this.pkgToSubclass = pkgDivide(mapper.classToSubclass);
duke@1 119 this.pkgToSubinterface = pkgDivide(mapper.classToSubinterface);
duke@1 120 this.pkgToImplementingClass = pkgDivide(mapper.classToImplementingClass);
duke@1 121 this.pkgToField = pkgDivide(mapper.classToField);
duke@1 122 this.pkgToMethodReturn = pkgDivide(mapper.classToMethodReturn);
duke@1 123 this.pkgToMethodArgs = pkgDivide(mapper.classToMethodArgs);
duke@1 124 this.pkgToMethodThrows = pkgDivide(mapper.classToMethodThrows);
duke@1 125 this.pkgToConstructorAnnotations = pkgDivide(mapper.classToConstructorAnnotations);
duke@1 126 this.pkgToConstructorParameterAnnotations = pkgDivide(mapper.classToConstructorParamAnnotation);
duke@1 127 this.pkgToConstructorArgs = pkgDivide(mapper.classToConstructorArgs);
duke@1 128 this.pkgToConstructorArgTypeParameter = pkgDivide(mapper.classToConstructorDocArgTypeParam);
duke@1 129 this.pkgToConstructorThrows = pkgDivide(mapper.classToConstructorThrows);
duke@1 130 //tmp test
duke@1 131 if (pkgSet.size() > 0 &&
duke@1 132 mapper.classToPackage.containsKey(classdoc.qualifiedName()) &&
duke@1 133 !pkgSet.equals(mapper.classToPackage.get(classdoc.qualifiedName()))) {
duke@1 134 configuration.root.printWarning("Internal error: package sets don't match: " + pkgSet + " with: " +
duke@1 135 mapper.classToPackage.get(classdoc.qualifiedName()));
duke@1 136 }
duke@1 137 methodSubWriter = new MethodWriterImpl(this);
duke@1 138 constrSubWriter = new ConstructorWriterImpl(this);
duke@1 139 fieldSubWriter = new FieldWriterImpl(this);
duke@1 140 classSubWriter = new NestedClassWriterImpl(this);
bpatel@243 141 classUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
bpatel@243 142 configuration.getText("doclet.classes"));
bpatel@243 143 subclassUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
bpatel@243 144 configuration.getText("doclet.subclasses"));
bpatel@243 145 subinterfaceUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
bpatel@243 146 configuration.getText("doclet.subinterfaces"));
bpatel@243 147 fieldUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
bpatel@243 148 configuration.getText("doclet.fields"));
bpatel@243 149 methodUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
bpatel@243 150 configuration.getText("doclet.methods"));
bpatel@243 151 constructorUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
bpatel@243 152 configuration.getText("doclet.constructors"));
duke@1 153 }
duke@1 154
duke@1 155 /**
duke@1 156 * Write out class use pages.
duke@1 157 * @throws DocletAbortException
duke@1 158 */
duke@1 159 public static void generate(ConfigurationImpl configuration,
duke@1 160 ClassTree classtree) {
duke@1 161 ClassUseMapper mapper = new ClassUseMapper(configuration.root, classtree);
duke@1 162 ClassDoc[] classes = configuration.root.classes();
duke@1 163 for (int i = 0; i < classes.length; i++) {
bpatel@995 164 // If -nodeprecated option is set and the containing package is marked
bpatel@995 165 // as deprecated, do not generate the class-use page. We will still generate
bpatel@995 166 // the class-use page if the class is marked as deprecated but the containing
bpatel@995 167 // package is not since it could still be linked from that package-use page.
bpatel@995 168 if (!(configuration.nodeprecated &&
bpatel@995 169 Util.isDeprecated(classes[i].containingPackage())))
bpatel@995 170 ClassUseWriter.generate(configuration, mapper, classes[i]);
duke@1 171 }
duke@1 172 PackageDoc[] pkgs = configuration.packages;
duke@1 173 for (int i = 0; i < pkgs.length; i++) {
bpatel@995 174 // If -nodeprecated option is set and the package is marked
bpatel@995 175 // as deprecated, do not generate the package-use page.
bpatel@995 176 if (!(configuration.nodeprecated && Util.isDeprecated(pkgs[i])))
bpatel@995 177 PackageUseWriter.generate(configuration, mapper, pkgs[i]);
duke@1 178 }
duke@1 179 }
duke@1 180
jjg@74 181 private Map<String,List<ProgramElementDoc>> pkgDivide(Map<String,? extends List<? extends ProgramElementDoc>> classMap) {
jjg@74 182 Map<String,List<ProgramElementDoc>> map = new HashMap<String,List<ProgramElementDoc>>();
jjg@74 183 List<? extends ProgramElementDoc> list= classMap.get(classdoc.qualifiedName());
duke@1 184 if (list != null) {
duke@1 185 Collections.sort(list);
jjg@74 186 Iterator<? extends ProgramElementDoc> it = list.iterator();
duke@1 187 while (it.hasNext()) {
jjg@74 188 ProgramElementDoc doc = it.next();
duke@1 189 PackageDoc pkg = doc.containingPackage();
duke@1 190 pkgSet.add(pkg);
jjg@74 191 List<ProgramElementDoc> inPkg = map.get(pkg.name());
duke@1 192 if (inPkg == null) {
jjg@74 193 inPkg = new ArrayList<ProgramElementDoc>();
duke@1 194 map.put(pkg.name(), inPkg);
duke@1 195 }
duke@1 196 inPkg.add(doc);
duke@1 197 }
duke@1 198 }
duke@1 199 return map;
duke@1 200 }
duke@1 201
duke@1 202 /**
duke@1 203 * Generate a class page.
duke@1 204 */
duke@1 205 public static void generate(ConfigurationImpl configuration,
duke@1 206 ClassUseMapper mapper, ClassDoc classdoc) {
duke@1 207 ClassUseWriter clsgen;
jjg@1372 208 DocPath path = DocPath.forPackage(classdoc)
jjg@1372 209 .resolve(DocPaths.CLASS_USE)
jjg@1372 210 .resolve(DocPath.forName(classdoc));
duke@1 211 try {
duke@1 212 clsgen = new ClassUseWriter(configuration,
jjg@1372 213 mapper, path,
jjg@1372 214 classdoc);
duke@1 215 clsgen.generateClassUseFile();
duke@1 216 clsgen.close();
duke@1 217 } catch (IOException exc) {
duke@1 218 configuration.standardmessage.
duke@1 219 error("doclet.exception_encountered",
jjg@1372 220 exc.toString(), path.getPath());
jjg@1985 221 throw new DocletAbortException(exc);
duke@1 222 }
duke@1 223 }
duke@1 224
duke@1 225 /**
bpatel@766 226 * Generate the class use list.
duke@1 227 */
duke@1 228 protected void generateClassUseFile() throws IOException {
bpatel@766 229 Content body = getClassUseHeader();
bpatel@766 230 HtmlTree div = new HtmlTree(HtmlTag.DIV);
bpatel@766 231 div.addStyle(HtmlStyle.classUseContainer);
duke@1 232 if (pkgSet.size() > 0) {
bpatel@766 233 addClassUse(div);
duke@1 234 } else {
bpatel@766 235 div.addContent(getResource("doclet.ClassUse_No.usage.of.0",
bpatel@766 236 classdoc.qualifiedName()));
duke@1 237 }
bpatel@766 238 body.addContent(div);
bpatel@766 239 addNavLinks(false, body);
bpatel@766 240 addBottom(body);
bpatel@766 241 printHtmlDocument(null, true, body);
duke@1 242 }
duke@1 243
duke@1 244 /**
bpatel@766 245 * Add the class use documentation.
bpatel@766 246 *
bpatel@766 247 * @param contentTree the content tree to which the class use information will be added
duke@1 248 */
bpatel@766 249 protected void addClassUse(Content contentTree) throws IOException {
bpatel@766 250 HtmlTree ul = new HtmlTree(HtmlTag.UL);
bpatel@766 251 ul.addStyle(HtmlStyle.blockList);
bpatel@766 252 if (configuration.packages.length > 1) {
bpatel@766 253 addPackageList(ul);
bpatel@766 254 addPackageAnnotationList(ul);
bpatel@766 255 }
bpatel@766 256 addClassList(ul);
bpatel@766 257 contentTree.addContent(ul);
duke@1 258 }
duke@1 259
duke@1 260 /**
bpatel@766 261 * Add the packages list that use the given class.
bpatel@766 262 *
bpatel@766 263 * @param contentTree the content tree to which the packages list will be added
duke@1 264 */
bpatel@766 265 protected void addPackageList(Content contentTree) throws IOException {
bpatel@2084 266 Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, useTableSummary,
jjg@1747 267 getTableCaption(configuration.getResource(
bpatel@766 268 "doclet.ClassUse_Packages.that.use.0",
jjg@1738 269 getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc
jjg@1747 270 )))));
bpatel@766 271 table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
bpatel@766 272 Content tbody = new HtmlTree(HtmlTag.TBODY);
bpatel@766 273 Iterator<PackageDoc> it = pkgSet.iterator();
bpatel@766 274 for (int i = 0; it.hasNext(); i++) {
bpatel@766 275 PackageDoc pkg = it.next();
bpatel@766 276 HtmlTree tr = new HtmlTree(HtmlTag.TR);
bpatel@766 277 if (i % 2 == 0) {
bpatel@766 278 tr.addStyle(HtmlStyle.altColor);
bpatel@766 279 } else {
bpatel@766 280 tr.addStyle(HtmlStyle.rowColor);
bpatel@766 281 }
bpatel@766 282 addPackageUse(pkg, tr);
bpatel@766 283 tbody.addContent(tr);
bpatel@766 284 }
bpatel@766 285 table.addContent(tbody);
bpatel@766 286 Content li = HtmlTree.LI(HtmlStyle.blockList, table);
bpatel@766 287 contentTree.addContent(li);
duke@1 288 }
duke@1 289
duke@1 290 /**
bpatel@766 291 * Add the package annotation list.
bpatel@766 292 *
bpatel@766 293 * @param contentTree the content tree to which the package annotation list will be added
duke@1 294 */
bpatel@766 295 protected void addPackageAnnotationList(Content contentTree) throws IOException {
bpatel@766 296 if ((!classdoc.isAnnotationType()) ||
bpatel@766 297 pkgToPackageAnnotations == null ||
jjg@1410 298 pkgToPackageAnnotations.isEmpty()) {
bpatel@766 299 return;
bpatel@766 300 }
bpatel@2084 301 Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, useTableSummary,
jjg@1747 302 getTableCaption(configuration.getResource(
bpatel@766 303 "doclet.ClassUse_PackageAnnotation",
jjg@1410 304 getLink(new LinkInfoImpl(configuration,
jjg@1747 305 LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)))));
bpatel@766 306 table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
bpatel@766 307 Content tbody = new HtmlTree(HtmlTag.TBODY);
bpatel@766 308 Iterator<PackageDoc> it = pkgToPackageAnnotations.iterator();
bpatel@766 309 for (int i = 0; it.hasNext(); i++) {
bpatel@766 310 PackageDoc pkg = it.next();
bpatel@766 311 HtmlTree tr = new HtmlTree(HtmlTag.TR);
bpatel@766 312 if (i % 2 == 0) {
bpatel@766 313 tr.addStyle(HtmlStyle.altColor);
bpatel@766 314 } else {
bpatel@766 315 tr.addStyle(HtmlStyle.rowColor);
bpatel@766 316 }
bpatel@766 317 Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
bpatel@766 318 getPackageLink(pkg, new StringContent(pkg.name())));
bpatel@766 319 tr.addContent(tdFirst);
bpatel@766 320 HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
bpatel@766 321 tdLast.addStyle(HtmlStyle.colLast);
bpatel@927 322 addSummaryComment(pkg, tdLast);
bpatel@766 323 tr.addContent(tdLast);
bpatel@766 324 tbody.addContent(tr);
bpatel@766 325 }
bpatel@766 326 table.addContent(tbody);
bpatel@766 327 Content li = HtmlTree.LI(HtmlStyle.blockList, table);
bpatel@766 328 contentTree.addContent(li);
duke@1 329 }
duke@1 330
duke@1 331 /**
bpatel@766 332 * Add the class list that use the given class.
bpatel@766 333 *
bpatel@766 334 * @param contentTree the content tree to which the class list will be added
duke@1 335 */
bpatel@766 336 protected void addClassList(Content contentTree) throws IOException {
bpatel@766 337 HtmlTree ul = new HtmlTree(HtmlTag.UL);
bpatel@766 338 ul.addStyle(HtmlStyle.blockList);
bpatel@766 339 for (Iterator<PackageDoc> it = pkgSet.iterator(); it.hasNext();) {
bpatel@766 340 PackageDoc pkg = it.next();
bpatel@766 341 Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name()));
jjg@1740 342 Content link = getResource("doclet.ClassUse_Uses.of.0.in.1",
jjg@1735 343 getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER,
jjg@1740 344 classdoc)),
jjg@1740 345 getPackageLink(pkg, Util.getPackageName(pkg)));
bpatel@766 346 Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link);
bpatel@766 347 li.addContent(heading);
bpatel@766 348 addClassUse(pkg, li);
bpatel@766 349 ul.addContent(li);
bpatel@766 350 }
bpatel@766 351 Content li = HtmlTree.LI(HtmlStyle.blockList, ul);
bpatel@766 352 contentTree.addContent(li);
duke@1 353 }
duke@1 354
duke@1 355 /**
bpatel@766 356 * Add the package use information.
bpatel@766 357 *
bpatel@766 358 * @param pkg the package that uses the given class
bpatel@766 359 * @param contentTree the content tree to which the package use information will be added
duke@1 360 */
bpatel@766 361 protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException {
bpatel@766 362 Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
jjg@1372 363 getHyperLink(pkg.name(), new StringContent(Util.getPackageName(pkg))));
bpatel@766 364 contentTree.addContent(tdFirst);
bpatel@766 365 HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
bpatel@766 366 tdLast.addStyle(HtmlStyle.colLast);
bpatel@927 367 addSummaryComment(pkg, tdLast);
bpatel@766 368 contentTree.addContent(tdLast);
duke@1 369 }
duke@1 370
duke@1 371 /**
bpatel@766 372 * Add the class use information.
bpatel@766 373 *
bpatel@766 374 * @param pkg the package that uses the given class
bpatel@766 375 * @param contentTree the content tree to which the class use information will be added
duke@1 376 */
bpatel@766 377 protected void addClassUse(PackageDoc pkg, Content contentTree) throws IOException {
jjg@1747 378 Content classLink = getLink(new LinkInfoImpl(configuration,
jjg@1747 379 LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc));
jjg@1747 380 Content pkgLink = getPackageLink(pkg, Util.getPackageName(pkg));
bpatel@766 381 classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg.name()),
jjg@1747 382 configuration.getResource("doclet.ClassUse_Annotation", classLink,
bpatel@766 383 pkgLink), classUseTableSummary, contentTree);
bpatel@766 384 classSubWriter.addUseInfo(pkgToClassTypeParameter.get(pkg.name()),
jjg@1747 385 configuration.getResource("doclet.ClassUse_TypeParameter", classLink,
bpatel@766 386 pkgLink), classUseTableSummary, contentTree);
bpatel@766 387 classSubWriter.addUseInfo(pkgToSubclass.get(pkg.name()),
jjg@1747 388 configuration.getResource("doclet.ClassUse_Subclass", classLink,
bpatel@766 389 pkgLink), subclassUseTableSummary, contentTree);
bpatel@766 390 classSubWriter.addUseInfo(pkgToSubinterface.get(pkg.name()),
jjg@1747 391 configuration.getResource("doclet.ClassUse_Subinterface", classLink,
bpatel@766 392 pkgLink), subinterfaceUseTableSummary, contentTree);
bpatel@766 393 classSubWriter.addUseInfo(pkgToImplementingClass.get(pkg.name()),
jjg@1747 394 configuration.getResource("doclet.ClassUse_ImplementingClass", classLink,
bpatel@766 395 pkgLink), classUseTableSummary, contentTree);
bpatel@766 396 fieldSubWriter.addUseInfo(pkgToField.get(pkg.name()),
jjg@1747 397 configuration.getResource("doclet.ClassUse_Field", classLink,
bpatel@766 398 pkgLink), fieldUseTableSummary, contentTree);
bpatel@766 399 fieldSubWriter.addUseInfo(pkgToFieldAnnotations.get(pkg.name()),
jjg@1747 400 configuration.getResource("doclet.ClassUse_FieldAnnotations", classLink,
bpatel@766 401 pkgLink), fieldUseTableSummary, contentTree);
bpatel@766 402 fieldSubWriter.addUseInfo(pkgToFieldTypeParameter.get(pkg.name()),
jjg@1747 403 configuration.getResource("doclet.ClassUse_FieldTypeParameter", classLink,
bpatel@766 404 pkgLink), fieldUseTableSummary, contentTree);
bpatel@766 405 methodSubWriter.addUseInfo(pkgToMethodAnnotations.get(pkg.name()),
jjg@1747 406 configuration.getResource("doclet.ClassUse_MethodAnnotations", classLink,
bpatel@766 407 pkgLink), methodUseTableSummary, contentTree);
bpatel@766 408 methodSubWriter.addUseInfo(pkgToMethodParameterAnnotations.get(pkg.name()),
jjg@1747 409 configuration.getResource("doclet.ClassUse_MethodParameterAnnotations", classLink,
bpatel@766 410 pkgLink), methodUseTableSummary, contentTree);
bpatel@766 411 methodSubWriter.addUseInfo(pkgToMethodTypeParameter.get(pkg.name()),
jjg@1747 412 configuration.getResource("doclet.ClassUse_MethodTypeParameter", classLink,
bpatel@766 413 pkgLink), methodUseTableSummary, contentTree);
bpatel@766 414 methodSubWriter.addUseInfo(pkgToMethodReturn.get(pkg.name()),
jjg@1747 415 configuration.getResource("doclet.ClassUse_MethodReturn", classLink,
bpatel@766 416 pkgLink), methodUseTableSummary, contentTree);
bpatel@766 417 methodSubWriter.addUseInfo(pkgToMethodReturnTypeParameter.get(pkg.name()),
jjg@1747 418 configuration.getResource("doclet.ClassUse_MethodReturnTypeParameter", classLink,
bpatel@766 419 pkgLink), methodUseTableSummary, contentTree);
bpatel@766 420 methodSubWriter.addUseInfo(pkgToMethodArgs.get(pkg.name()),
jjg@1747 421 configuration.getResource("doclet.ClassUse_MethodArgs", classLink,
bpatel@766 422 pkgLink), methodUseTableSummary, contentTree);
bpatel@766 423 methodSubWriter.addUseInfo(pkgToMethodArgTypeParameter.get(pkg.name()),
jjg@1747 424 configuration.getResource("doclet.ClassUse_MethodArgsTypeParameters", classLink,
bpatel@766 425 pkgLink), methodUseTableSummary, contentTree);
bpatel@766 426 methodSubWriter.addUseInfo(pkgToMethodThrows.get(pkg.name()),
jjg@1747 427 configuration.getResource("doclet.ClassUse_MethodThrows", classLink,
bpatel@766 428 pkgLink), methodUseTableSummary, contentTree);
bpatel@766 429 constrSubWriter.addUseInfo(pkgToConstructorAnnotations.get(pkg.name()),
jjg@1747 430 configuration.getResource("doclet.ClassUse_ConstructorAnnotations", classLink,
bpatel@766 431 pkgLink), constructorUseTableSummary, contentTree);
bpatel@766 432 constrSubWriter.addUseInfo(pkgToConstructorParameterAnnotations.get(pkg.name()),
jjg@1747 433 configuration.getResource("doclet.ClassUse_ConstructorParameterAnnotations", classLink,
bpatel@766 434 pkgLink), constructorUseTableSummary, contentTree);
bpatel@766 435 constrSubWriter.addUseInfo(pkgToConstructorArgs.get(pkg.name()),
jjg@1747 436 configuration.getResource("doclet.ClassUse_ConstructorArgs", classLink,
bpatel@766 437 pkgLink), constructorUseTableSummary, contentTree);
bpatel@766 438 constrSubWriter.addUseInfo(pkgToConstructorArgTypeParameter.get(pkg.name()),
jjg@1747 439 configuration.getResource("doclet.ClassUse_ConstructorArgsTypeParameters", classLink,
bpatel@766 440 pkgLink), constructorUseTableSummary, contentTree);
bpatel@766 441 constrSubWriter.addUseInfo(pkgToConstructorThrows.get(pkg.name()),
jjg@1747 442 configuration.getResource("doclet.ClassUse_ConstructorThrows", classLink,
bpatel@766 443 pkgLink), constructorUseTableSummary, contentTree);
duke@1 444 }
duke@1 445
bpatel@766 446 /**
bpatel@766 447 * Get the header for the class use Listing.
bpatel@766 448 *
bpatel@766 449 * @return a content tree representing the class use header
bpatel@766 450 */
bpatel@766 451 protected Content getClassUseHeader() {
bpatel@766 452 String cltype = configuration.getText(classdoc.isInterface()?
bpatel@766 453 "doclet.Interface":"doclet.Class");
bpatel@766 454 String clname = classdoc.qualifiedName();
bpatel@766 455 String title = configuration.getText("doclet.Window_ClassUse_Header",
bpatel@766 456 cltype, clname);
bpatel@766 457 Content bodyTree = getBody(true, getWindowTitle(title));
bpatel@766 458 addTop(bodyTree);
bpatel@766 459 addNavLinks(true, bodyTree);
jjg@1739 460 ContentBuilder headContent = new ContentBuilder();
jjg@1739 461 headContent.addContent(getResource("doclet.ClassUse_Title", cltype));
jjg@1739 462 headContent.addContent(new HtmlTree(HtmlTag.BR));
jjg@1739 463 headContent.addContent(clname);
bpatel@766 464 Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING,
bpatel@766 465 true, HtmlStyle.title, headContent);
bpatel@766 466 Content div = HtmlTree.DIV(HtmlStyle.header, heading);
bpatel@766 467 bodyTree.addContent(div);
bpatel@766 468 return bodyTree;
duke@1 469 }
duke@1 470
bpatel@766 471 /**
bpatel@766 472 * Get this package link.
bpatel@766 473 *
bpatel@766 474 * @return a content tree for the package link
bpatel@766 475 */
bpatel@766 476 protected Content getNavLinkPackage() {
jjg@1372 477 Content linkContent =
jjg@1373 478 getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_SUMMARY), packageLabel);
bpatel@766 479 Content li = HtmlTree.LI(linkContent);
bpatel@766 480 return li;
bpatel@766 481 }
bpatel@766 482
bpatel@766 483 /**
bpatel@766 484 * Get class page link.
bpatel@766 485 *
bpatel@766 486 * @return a content tree for the class page link
bpatel@766 487 */
bpatel@766 488 protected Content getNavLinkClass() {
jjg@1736 489 Content linkContent = getLink(new LinkInfoImpl(
jjg@1738 490 configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)
jjg@1738 491 .label(configuration.getText("doclet.Class")));
bpatel@766 492 Content li = HtmlTree.LI(linkContent);
bpatel@766 493 return li;
bpatel@766 494 }
bpatel@766 495
bpatel@766 496 /**
bpatel@766 497 * Get the use link.
bpatel@766 498 *
bpatel@766 499 * @return a content tree for the use link
bpatel@766 500 */
bpatel@766 501 protected Content getNavLinkClassUse() {
bpatel@766 502 Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, useLabel);
bpatel@766 503 return li;
bpatel@766 504 }
bpatel@766 505
bpatel@766 506 /**
bpatel@766 507 * Get the tree link.
bpatel@766 508 *
bpatel@766 509 * @return a content tree for the tree link
bpatel@766 510 */
bpatel@766 511 protected Content getNavLinkTree() {
bpatel@766 512 Content linkContent = classdoc.containingPackage().isIncluded() ?
jjg@1373 513 getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_TREE), treeLabel) :
jjg@1373 514 getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), treeLabel);
bpatel@766 515 Content li = HtmlTree.LI(linkContent);
bpatel@766 516 return li;
bpatel@766 517 }
duke@1 518 }

mercurial