langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java
author bpatel
Fri, 11 Mar 2011 15:39:51 -0800
changeset 8841 b4422fa4f2e6
parent 7681 1f0819a3341f
child 9606 e5a619cb5dd3
permissions -rw-r--r--
7006178: findbugs high priority issues in new javadoc Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
8841
b4422fa4f2e6 7006178: findbugs high priority issues in new javadoc
bpatel
parents: 7681
diff changeset
     2
 * Copyright (c) 1998, 2011, 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++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
            ClassUseWriter.generate(configuration, mapper, classes[i]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
        PackageDoc[] pkgs = configuration.packages;
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
        for (int i = 0; i < pkgs.length; i++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
            PackageUseWriter.generate(configuration, mapper, pkgs[i]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   160
    private Map<String,List<ProgramElementDoc>> pkgDivide(Map<String,? extends List<? extends ProgramElementDoc>> classMap) {
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   161
        Map<String,List<ProgramElementDoc>> map = new HashMap<String,List<ProgramElementDoc>>();
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   162
        List<? extends ProgramElementDoc> list= classMap.get(classdoc.qualifiedName());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
        if (list != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
            Collections.sort(list);
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   165
            Iterator<? extends ProgramElementDoc> it = list.iterator();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
            while (it.hasNext()) {
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   167
                ProgramElementDoc doc = it.next();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
                PackageDoc pkg = doc.containingPackage();
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
                pkgSet.add(pkg);
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   170
                List<ProgramElementDoc> inPkg = map.get(pkg.name());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
                if (inPkg == null) {
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   172
                    inPkg = new ArrayList<ProgramElementDoc>();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
                    map.put(pkg.name(), inPkg);
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
                inPkg.add(doc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
        return map;
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
     * Generate a class page.
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
    public static void generate(ConfigurationImpl configuration,
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
                                ClassUseMapper mapper, ClassDoc classdoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
        ClassUseWriter clsgen;
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
        String path = DirectoryManager.getDirectoryPath(classdoc.
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
                                                            containingPackage());
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
        if (path.length() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
            path += File.separator;
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
        path += "class-use";
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
        String filename = classdoc.name() + ".html";
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
        String pkgname = classdoc.containingPackage().name();
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
        pkgname += (pkgname.length() > 0)? ".class-use": "class-use";
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
        String relpath = DirectoryManager.getRelativePath(pkgname);
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
        try {
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
            clsgen = new ClassUseWriter(configuration,
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
                                        mapper, path, filename,
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
                                        relpath, classdoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
            clsgen.generateClassUseFile();
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
            clsgen.close();
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
        } catch (IOException exc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
            configuration.standardmessage.
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
                error("doclet.exception_encountered",
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
                      exc.toString(), filename);
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
            throw new DocletAbortException();
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   212
     * Generate the class use list.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
    protected void generateClassUseFile() throws IOException {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   215
        Content body = getClassUseHeader();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   216
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   217
        div.addStyle(HtmlStyle.classUseContainer);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
        if (pkgSet.size() > 0) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   219
            addClassUse(div);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
        } else {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   221
            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
   222
                    classdoc.qualifiedName()));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   224
        body.addContent(div);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   225
        addNavLinks(false, body);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   226
        addBottom(body);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   227
        printHtmlDocument(null, true, body);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
    }
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
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   231
     * Add the class use documentation.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   232
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   233
     * @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
   234
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   235
    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
   236
        HtmlTree ul = new HtmlTree(HtmlTag.UL);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   237
        ul.addStyle(HtmlStyle.blockList);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   238
        if (configuration.packages.length > 1) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   239
            addPackageList(ul);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   240
            addPackageAnnotationList(ul);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   242
        addClassList(ul);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   243
        contentTree.addContent(ul);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   246
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   247
     * 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
   248
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   249
     * @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
   250
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   251
    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
   252
        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
   253
                getTableCaption(configuration().getText(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   254
                "doclet.ClassUse_Packages.that.use.0",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   255
                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
   256
                false)))));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   257
        table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   258
        Content tbody = new HtmlTree(HtmlTag.TBODY);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   259
        Iterator<PackageDoc> it = pkgSet.iterator();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   260
        for (int i = 0; it.hasNext(); i++) {
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
   261
            PackageDoc pkg = it.next();
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   262
            HtmlTree tr = new HtmlTree(HtmlTag.TR);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   263
            if (i % 2 == 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   264
                tr.addStyle(HtmlStyle.altColor);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   265
            } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   266
                tr.addStyle(HtmlStyle.rowColor);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   267
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   268
            addPackageUse(pkg, tr);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   269
            tbody.addContent(tr);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   271
        table.addContent(tbody);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   272
        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
   273
        contentTree.addContent(li);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
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
     * Add the package annotation list.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   278
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   279
     * @param contentTree the content tree to which the package annotation list will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   281
    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
   282
        if ((!classdoc.isAnnotationType()) ||
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   283
                pkgToPackageAnnotations == null ||
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   284
                pkgToPackageAnnotations.size() == 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   285
            return;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   286
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   287
        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
   288
                getTableCaption(configuration().getText(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   289
                "doclet.ClassUse_PackageAnnotation",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   290
                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
   291
                false)))));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   292
        table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   293
        Content tbody = new HtmlTree(HtmlTag.TBODY);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   294
        Iterator<PackageDoc> it = pkgToPackageAnnotations.iterator();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   295
        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
   296
            PackageDoc pkg = it.next();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   297
            HtmlTree tr = new HtmlTree(HtmlTag.TR);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   298
            if (i % 2 == 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   299
                tr.addStyle(HtmlStyle.altColor);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   300
            } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   301
                tr.addStyle(HtmlStyle.rowColor);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   302
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   303
            Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   304
                    getPackageLink(pkg, new StringContent(pkg.name())));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   305
            tr.addContent(tdFirst);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   306
            HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   307
            tdLast.addStyle(HtmlStyle.colLast);
8841
b4422fa4f2e6 7006178: findbugs high priority issues in new javadoc
bpatel
parents: 7681
diff changeset
   308
            addSummaryComment(pkg, tdLast);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   309
            tr.addContent(tdLast);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   310
            tbody.addContent(tr);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   311
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   312
        table.addContent(tbody);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   313
        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
   314
        contentTree.addContent(li);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   315
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   316
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
     * 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
   319
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   320
     * @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
   321
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   322
    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
   323
        HtmlTree ul = new HtmlTree(HtmlTag.UL);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   324
        ul.addStyle(HtmlStyle.blockList);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   325
        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
   326
            PackageDoc pkg = it.next();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   327
            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
   328
            Content link = new RawHtml(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   329
                    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
   330
                    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
   331
                    classdoc, false)),
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   332
                    getPackageLinkString(pkg, Util.getPackageName(pkg), false)));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   333
            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
   334
            li.addContent(heading);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   335
            addClassUse(pkg, li);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   336
            ul.addContent(li);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   337
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   338
        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
   339
        contentTree.addContent(li);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   340
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   341
06bc494ca11e Initial load
duke
parents:
diff changeset
   342
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   343
     * Add the package use information.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   344
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   345
     * @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
   346
     * @param contentTree the content tree to which the package use information will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   347
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   348
    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
   349
        Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   350
                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
   351
        contentTree.addContent(tdFirst);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   352
        HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   353
        tdLast.addStyle(HtmlStyle.colLast);
8841
b4422fa4f2e6 7006178: findbugs high priority issues in new javadoc
bpatel
parents: 7681
diff changeset
   354
        addSummaryComment(pkg, tdLast);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   355
        contentTree.addContent(tdLast);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   356
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   357
06bc494ca11e Initial load
duke
parents:
diff changeset
   358
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   359
     * Add the class use information.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   360
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   361
     * @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
   362
     * @param contentTree the content tree to which the class use information will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   363
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   364
    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
   365
        String classLink = getLink(new LinkInfoImpl(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   366
            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
   367
        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
   368
        classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg.name()),
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   369
                configuration.getText("doclet.ClassUse_Annotation", classLink,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   370
                pkgLink), classUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   371
        classSubWriter.addUseInfo(pkgToClassTypeParameter.get(pkg.name()),
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   372
                configuration.getText("doclet.ClassUse_TypeParameter", classLink,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   373
                pkgLink), classUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   374
        classSubWriter.addUseInfo(pkgToSubclass.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_Subclass", classLink,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   376
                pkgLink), subclassUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   377
        classSubWriter.addUseInfo(pkgToSubinterface.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_Subinterface", classLink,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   379
                pkgLink), subinterfaceUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   380
        classSubWriter.addUseInfo(pkgToImplementingClass.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_ImplementingClass", classLink,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   382
                pkgLink), classUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   383
        fieldSubWriter.addUseInfo(pkgToField.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_Field", classLink,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   385
                pkgLink), fieldUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   386
        fieldSubWriter.addUseInfo(pkgToFieldAnnotations.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_FieldAnnotations", classLink,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   388
                pkgLink), fieldUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   389
        fieldSubWriter.addUseInfo(pkgToFieldTypeParameter.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_FieldTypeParameter", 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
        methodSubWriter.addUseInfo(pkgToMethodAnnotations.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_MethodAnnotations", classLink,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   394
                pkgLink), methodUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   395
        methodSubWriter.addUseInfo(pkgToMethodParameterAnnotations.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_MethodParameterAnnotations", classLink,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   397
                pkgLink), methodUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   398
        methodSubWriter.addUseInfo(pkgToMethodTypeParameter.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_MethodTypeParameter", 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(pkgToMethodReturn.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_MethodReturn", 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(pkgToMethodReturnTypeParameter.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_MethodReturnTypeParameter", 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(pkgToMethodArgs.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_MethodArgs", 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(pkgToMethodArgTypeParameter.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_MethodArgsTypeParameters", 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(pkgToMethodThrows.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_MethodThrows", 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
        constrSubWriter.addUseInfo(pkgToConstructorAnnotations.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_ConstructorAnnotations", classLink,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   418
                pkgLink), constructorUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   419
        constrSubWriter.addUseInfo(pkgToConstructorParameterAnnotations.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_ConstructorParameterAnnotations", classLink,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   421
                pkgLink), constructorUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   422
        constrSubWriter.addUseInfo(pkgToConstructorArgs.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_ConstructorArgs", 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(pkgToConstructorArgTypeParameter.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_ConstructorArgsTypeParameters", 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(pkgToConstructorThrows.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_ConstructorThrows", classLink,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   430
                pkgLink), constructorUseTableSummary, contentTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   431
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   432
06bc494ca11e Initial load
duke
parents:
diff changeset
   433
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   434
     * 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
   435
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   436
     * @return a content tree representing the class use header
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   437
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   438
    protected Content getClassUseHeader() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   439
        String cltype = configuration.getText(classdoc.isInterface()?
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   440
            "doclet.Interface":"doclet.Class");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   441
        String clname = classdoc.qualifiedName();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   442
        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
   443
                cltype, clname);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   444
        Content bodyTree = getBody(true, getWindowTitle(title));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   445
        addTop(bodyTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   446
        addNavLinks(true, bodyTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   447
        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
   448
        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
   449
                true, HtmlStyle.title, headContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   450
        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
   451
        bodyTree.addContent(div);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   452
        return bodyTree;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   453
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   454
06bc494ca11e Initial load
duke
parents:
diff changeset
   455
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   456
     * Get this package link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   457
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   458
     * @return a content tree for the package link
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   459
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   460
    protected Content getNavLinkPackage() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   461
        Content linkContent = getHyperLink("../package-summary.html", "",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   462
                packageLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   463
        Content li = HtmlTree.LI(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   464
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   465
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   466
06bc494ca11e Initial load
duke
parents:
diff changeset
   467
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   468
     * Get class page link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   469
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   470
     * @return a content tree for the class page link
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   471
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   472
    protected Content getNavLinkClass() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   473
        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
   474
                LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, "",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   475
                configuration.getText("doclet.Class"), false)));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   476
        Content li = HtmlTree.LI(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   477
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   478
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   479
06bc494ca11e Initial load
duke
parents:
diff changeset
   480
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   481
     * Get the use link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   482
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   483
     * @return a content tree for the use link
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   484
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   485
    protected Content getNavLinkClassUse() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   486
        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
   487
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   488
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   489
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   490
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   491
     * Get the tree link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   492
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   493
     * @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
   494
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   495
    protected Content getNavLinkTree() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   496
        Content linkContent = classdoc.containingPackage().isIncluded() ?
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   497
            getHyperLink("../package-tree.html", "", treeLabel) :
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   498
            getHyperLink(relativePath + "overview-tree.html", "", treeLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   499
        Content li = HtmlTree.LI(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   500
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   501
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   502
}