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

Tue, 09 Oct 2012 19:10:00 -0700

author
jjg
date
Tue, 09 Oct 2012 19:10:00 -0700
changeset 1357
c75be5bc5283
parent 1350
ef88ae455c88
child 1359
25e14ad23cef
permissions
-rw-r--r--

8000663: clean up langtools imports
Reviewed-by: darcy

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

mercurial