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