langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java
author chegar
Sun, 17 Aug 2014 15:52:32 +0100
changeset 25874 83c19f00452c
parent 25454 langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java@376a52c9540c
child 26270 a3635e6d3d78
permissions -rw-r--r--
8054834: Modular Source Code Reviewed-by: alanb, chegar, ihse, mduigou Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, chris.hegarty@oracle.com, erik.joelsson@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, magnus.ihse.bursie@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, paul.sandoz@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
24220
eb213562268d 8039410: [javadoc] fix class-use items to be deterministic and index ordering
ksrini
parents: 22163
diff changeset
     2
 * Copyright (c) 1998, 2014, 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
19512
07dcf1232608 8013887: In class use, some tables are randomly unsorted
jjg
parents: 17570
diff changeset
    28
import java.io.IOException;
07dcf1232608 8013887: In class use, some tables are randomly unsorted
jjg
parents: 17570
diff changeset
    29
import java.util.ArrayList;
07dcf1232608 8013887: In class use, some tables are randomly unsorted
jjg
parents: 17570
diff changeset
    30
import java.util.Collections;
07dcf1232608 8013887: In class use, some tables are randomly unsorted
jjg
parents: 17570
diff changeset
    31
import java.util.HashMap;
07dcf1232608 8013887: In class use, some tables are randomly unsorted
jjg
parents: 17570
diff changeset
    32
import java.util.Iterator;
07dcf1232608 8013887: In class use, some tables are randomly unsorted
jjg
parents: 17570
diff changeset
    33
import java.util.List;
07dcf1232608 8013887: In class use, some tables are randomly unsorted
jjg
parents: 17570
diff changeset
    34
import java.util.Map;
07dcf1232608 8013887: In class use, some tables are randomly unsorted
jjg
parents: 17570
diff changeset
    35
import java.util.Set;
07dcf1232608 8013887: In class use, some tables are randomly unsorted
jjg
parents: 17570
diff changeset
    36
import java.util.SortedSet;
07dcf1232608 8013887: In class use, some tables are randomly unsorted
jjg
parents: 17570
diff changeset
    37
import java.util.TreeSet;
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 14060
diff changeset
    38
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    39
import com.sun.javadoc.*;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    40
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
    41
import com.sun.tools.doclets.internal.toolkit.*;
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 14060
diff changeset
    42
import com.sun.tools.doclets.internal.toolkit.util.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 * Generate class usage information.
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    47
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    48
 *  If you write code that depends on this, you do so at your own risk.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    49
 *  This code and its internal interfaces are subject to change or
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    50
 *  deletion without notice.</b>
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    51
 *
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
 * @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
    53
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
public class ClassUseWriter extends SubWriterHolderWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
    final ClassDoc classdoc;
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
    58
    Set<PackageDoc> pkgToPackageAnnotations = null;
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    59
    final Map<String,List<ProgramElementDoc>> pkgToClassTypeParameter;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    60
    final Map<String,List<ProgramElementDoc>> pkgToClassAnnotations;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    61
    final Map<String,List<ProgramElementDoc>> pkgToMethodTypeParameter;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    62
    final Map<String,List<ProgramElementDoc>> pkgToMethodArgTypeParameter;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    63
    final Map<String,List<ProgramElementDoc>> pkgToMethodReturnTypeParameter;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    64
    final Map<String,List<ProgramElementDoc>> pkgToMethodAnnotations;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    65
    final Map<String,List<ProgramElementDoc>> pkgToMethodParameterAnnotations;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    66
    final Map<String,List<ProgramElementDoc>> pkgToFieldTypeParameter;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    67
    final Map<String,List<ProgramElementDoc>> pkgToFieldAnnotations;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    68
    final Map<String,List<ProgramElementDoc>> pkgToSubclass;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    69
    final Map<String,List<ProgramElementDoc>> pkgToSubinterface;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    70
    final Map<String,List<ProgramElementDoc>> pkgToImplementingClass;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    71
    final Map<String,List<ProgramElementDoc>> pkgToField;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    72
    final Map<String,List<ProgramElementDoc>> pkgToMethodReturn;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    73
    final Map<String,List<ProgramElementDoc>> pkgToMethodArgs;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    74
    final Map<String,List<ProgramElementDoc>> pkgToMethodThrows;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    75
    final Map<String,List<ProgramElementDoc>> pkgToConstructorAnnotations;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    76
    final Map<String,List<ProgramElementDoc>> pkgToConstructorParameterAnnotations;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    77
    final Map<String,List<ProgramElementDoc>> pkgToConstructorArgs;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    78
    final Map<String,List<ProgramElementDoc>> pkgToConstructorArgTypeParameter;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    79
    final Map<String,List<ProgramElementDoc>> pkgToConstructorThrows;
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    80
    final SortedSet<PackageDoc> pkgSet;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
    final MethodWriterImpl methodSubWriter;
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
    final ConstructorWriterImpl constrSubWriter;
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
    final FieldWriterImpl fieldSubWriter;
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
    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
    85
    // 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
    86
    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
    87
    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
    88
    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
    89
    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
    90
    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
    91
    final String constructorUseTableSummary;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
     * Constructor.
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
     * @param filename the file to be generated.
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
     * @throws IOException
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
     * @throws DocletAbortException
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
    public ClassUseWriter(ConfigurationImpl configuration,
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
   101
                          ClassUseMapper mapper, DocPath filename,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
                          ClassDoc classdoc) throws IOException {
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
   103
        super(configuration, filename);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
        this.classdoc = classdoc;
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
        if (mapper.classToPackageAnnotations.containsKey(classdoc.qualifiedName()))
22163
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 22159
diff changeset
   106
                pkgToPackageAnnotations = new TreeSet<>(mapper.classToPackageAnnotations.get(classdoc.qualifiedName()));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
        configuration.currentcd = classdoc;
22163
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 22159
diff changeset
   108
        this.pkgSet = new TreeSet<>();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
        this.pkgToClassTypeParameter = pkgDivide(mapper.classToClassTypeParam);
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
        this.pkgToClassAnnotations = pkgDivide(mapper.classToClassAnnotations);
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
        this.pkgToMethodTypeParameter = pkgDivide(mapper.classToExecMemberDocTypeParam);
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
        this.pkgToMethodArgTypeParameter = pkgDivide(mapper.classToExecMemberDocArgTypeParam);
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
        this.pkgToFieldTypeParameter = pkgDivide(mapper.classToFieldDocTypeParam);
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
        this.pkgToFieldAnnotations = pkgDivide(mapper.annotationToFieldDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
        this.pkgToMethodReturnTypeParameter = pkgDivide(mapper.classToExecMemberDocReturnTypeParam);
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
        this.pkgToMethodAnnotations = pkgDivide(mapper.classToExecMemberDocAnnotations);
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
        this.pkgToMethodParameterAnnotations = pkgDivide(mapper.classToExecMemberDocParamAnnotation);
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
        this.pkgToSubclass = pkgDivide(mapper.classToSubclass);
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
        this.pkgToSubinterface = pkgDivide(mapper.classToSubinterface);
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
        this.pkgToImplementingClass = pkgDivide(mapper.classToImplementingClass);
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
        this.pkgToField = pkgDivide(mapper.classToField);
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
        this.pkgToMethodReturn = pkgDivide(mapper.classToMethodReturn);
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
        this.pkgToMethodArgs = pkgDivide(mapper.classToMethodArgs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
        this.pkgToMethodThrows = pkgDivide(mapper.classToMethodThrows);
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
        this.pkgToConstructorAnnotations = pkgDivide(mapper.classToConstructorAnnotations);
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
        this.pkgToConstructorParameterAnnotations = pkgDivide(mapper.classToConstructorParamAnnotation);
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
        this.pkgToConstructorArgs = pkgDivide(mapper.classToConstructorArgs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
        this.pkgToConstructorArgTypeParameter = pkgDivide(mapper.classToConstructorDocArgTypeParam);
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
        this.pkgToConstructorThrows = pkgDivide(mapper.classToConstructorThrows);
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
        //tmp test
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
        if (pkgSet.size() > 0 &&
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
            mapper.classToPackage.containsKey(classdoc.qualifiedName()) &&
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
            !pkgSet.equals(mapper.classToPackage.get(classdoc.qualifiedName()))) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
            configuration.root.printWarning("Internal error: package sets don't match: " + pkgSet + " with: " +
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
                                   mapper.classToPackage.get(classdoc.qualifiedName()));
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
        methodSubWriter = new MethodWriterImpl(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
        constrSubWriter = new ConstructorWriterImpl(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
        fieldSubWriter = new FieldWriterImpl(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
        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
   141
        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
   142
                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
   143
        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
   144
                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
   145
        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
   146
                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
   147
        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
   148
                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
   149
        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
   150
                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
   151
        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
   152
                configuration.getText("doclet.constructors"));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
     * Write out class use pages.
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
     * @throws DocletAbortException
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
    public static void generate(ConfigurationImpl configuration,
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
                                ClassTree classtree)  {
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
        ClassUseMapper mapper = new ClassUseMapper(configuration.root, classtree);
22159
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 20613
diff changeset
   162
        for (ClassDoc aClass : configuration.root.classes()) {
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 8841
diff changeset
   163
            // 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
   164
            // 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
   165
            // 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
   166
            // 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
   167
            if (!(configuration.nodeprecated &&
25454
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 24297
diff changeset
   168
                  configuration.utils.isDeprecated(aClass.containingPackage())))
22159
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 20613
diff changeset
   169
                ClassUseWriter.generate(configuration, mapper, aClass);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
        }
22159
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 20613
diff changeset
   171
        for (PackageDoc pkg : configuration.packages) {
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 8841
diff changeset
   172
            // 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
   173
            // as deprecated, do not generate the package-use page.
25454
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 24297
diff changeset
   174
            if (!(configuration.nodeprecated && configuration.utils.isDeprecated(pkg)))
22159
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 20613
diff changeset
   175
                PackageUseWriter.generate(configuration, mapper, pkg);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   179
    private Map<String,List<ProgramElementDoc>> pkgDivide(Map<String,? extends List<? extends ProgramElementDoc>> classMap) {
22163
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 22159
diff changeset
   180
        Map<String,List<ProgramElementDoc>> map = new HashMap<>();
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   181
        List<? extends ProgramElementDoc> list= classMap.get(classdoc.qualifiedName());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
        if (list != null) {
25454
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 24297
diff changeset
   183
            Collections.sort(list, utils.makeComparatorForClassUse());
22159
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 20613
diff changeset
   184
            for (ProgramElementDoc doc : list) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
                PackageDoc pkg = doc.containingPackage();
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
                pkgSet.add(pkg);
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   187
                List<ProgramElementDoc> inPkg = map.get(pkg.name());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
                if (inPkg == null) {
22163
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 22159
diff changeset
   189
                    inPkg = new ArrayList<>();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
                    map.put(pkg.name(), inPkg);
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
                inPkg.add(doc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
        return map;
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
     * Generate a class page.
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
    public static void generate(ConfigurationImpl configuration,
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
                                ClassUseMapper mapper, ClassDoc classdoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
        ClassUseWriter clsgen;
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
   204
        DocPath path = DocPath.forPackage(classdoc)
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
   205
                .resolve(DocPaths.CLASS_USE)
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
   206
                .resolve(DocPath.forName(classdoc));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
        try {
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
            clsgen = new ClassUseWriter(configuration,
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
   209
                                        mapper, path,
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
   210
                                        classdoc);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
            clsgen.generateClassUseFile();
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
            clsgen.close();
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
        } catch (IOException exc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
            configuration.standardmessage.
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
                error("doclet.exception_encountered",
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
   216
                      exc.toString(), path.getPath());
19667
fdfce85627a9 8001669: javadoc internal DocletAbortException should set cause when appropriate
jjg
parents: 19512
diff changeset
   217
            throw new DocletAbortException(exc);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   222
     * Generate the class use list.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
    protected void generateClassUseFile() throws IOException {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   225
        Content body = getClassUseHeader();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   226
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   227
        div.addStyle(HtmlStyle.classUseContainer);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
        if (pkgSet.size() > 0) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   229
            addClassUse(div);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
        } else {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   231
            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
   232
                    classdoc.qualifiedName()));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   234
        body.addContent(div);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   235
        addNavLinks(false, body);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   236
        addBottom(body);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   237
        printHtmlDocument(null, true, body);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
7614
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
     * Add the class use documentation.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   242
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   243
     * @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
   244
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   245
    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
   246
        HtmlTree ul = new HtmlTree(HtmlTag.UL);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   247
        ul.addStyle(HtmlStyle.blockList);
24221
2376793dd33b 8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents: 24220
diff changeset
   248
        if (configuration.packages.size() > 1) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   249
            addPackageList(ul);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   250
            addPackageAnnotationList(ul);
10
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
        addClassList(ul);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   253
        contentTree.addContent(ul);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
7614
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
     * 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
   258
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   259
     * @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
   260
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   261
    protected void addPackageList(Content contentTree) throws IOException {
20613
ab4801a53abb 8008164: Invisible table captions in javadoc-generated html
bpatel
parents: 19667
diff changeset
   262
        Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, useTableSummary,
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   263
                getTableCaption(configuration.getResource(
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   264
                "doclet.ClassUse_Packages.that.use.0",
17561
9f3505f35da9 8011651: simplify LinkInfoImpl API
jjg
parents: 17559
diff changeset
   265
                getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   266
                )))));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   267
        table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   268
        Content tbody = new HtmlTree(HtmlTag.TBODY);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   269
        Iterator<PackageDoc> it = pkgSet.iterator();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   270
        for (int i = 0; it.hasNext(); i++) {
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
   271
            PackageDoc pkg = it.next();
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   272
            HtmlTree tr = new HtmlTree(HtmlTag.TR);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   273
            if (i % 2 == 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   274
                tr.addStyle(HtmlStyle.altColor);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   275
            } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   276
                tr.addStyle(HtmlStyle.rowColor);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   277
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   278
            addPackageUse(pkg, tr);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   279
            tbody.addContent(tr);
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
        table.addContent(tbody);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   282
        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
   283
        contentTree.addContent(li);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
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
     * Add the package annotation list.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   288
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   289
     * @param contentTree the content tree to which the package annotation list will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   291
    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
   292
        if ((!classdoc.isAnnotationType()) ||
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   293
                pkgToPackageAnnotations == null ||
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14358
diff changeset
   294
                pkgToPackageAnnotations.isEmpty()) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   295
            return;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   296
        }
20613
ab4801a53abb 8008164: Invisible table captions in javadoc-generated html
bpatel
parents: 19667
diff changeset
   297
        Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, useTableSummary,
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   298
                getTableCaption(configuration.getResource(
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   299
                "doclet.ClassUse_PackageAnnotation",
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14358
diff changeset
   300
                getLink(new LinkInfoImpl(configuration,
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   301
                        LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)))));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   302
        table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   303
        Content tbody = new HtmlTree(HtmlTag.TBODY);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   304
        Iterator<PackageDoc> it = pkgToPackageAnnotations.iterator();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   305
        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
   306
            PackageDoc pkg = it.next();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   307
            HtmlTree tr = new HtmlTree(HtmlTag.TR);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   308
            if (i % 2 == 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   309
                tr.addStyle(HtmlStyle.altColor);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   310
            } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   311
                tr.addStyle(HtmlStyle.rowColor);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   312
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   313
            Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   314
                    getPackageLink(pkg, new StringContent(pkg.name())));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   315
            tr.addContent(tdFirst);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   316
            HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   317
            tdLast.addStyle(HtmlStyle.colLast);
8841
b4422fa4f2e6 7006178: findbugs high priority issues in new javadoc
bpatel
parents: 7681
diff changeset
   318
            addSummaryComment(pkg, tdLast);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   319
            tr.addContent(tdLast);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   320
            tbody.addContent(tr);
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
        table.addContent(tbody);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   323
        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
   324
        contentTree.addContent(li);
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
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
     * 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
   329
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   330
     * @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
   331
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   332
    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
   333
        HtmlTree ul = new HtmlTree(HtmlTag.UL);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   334
        ul.addStyle(HtmlStyle.blockList);
22159
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 20613
diff changeset
   335
        for (PackageDoc pkg : pkgSet) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   336
            Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name()));
17563
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 17562
diff changeset
   337
            Content link = getResource("doclet.ClassUse_Uses.of.0.in.1",
22159
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 20613
diff changeset
   338
                                       getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER,
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 20613
diff changeset
   339
                                                                classdoc)),
25454
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 24297
diff changeset
   340
                                       getPackageLink(pkg, utils.getPackageName(pkg)));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   341
            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
   342
            li.addContent(heading);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   343
            addClassUse(pkg, li);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   344
            ul.addContent(li);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   345
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   346
        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
   347
        contentTree.addContent(li);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   348
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   349
06bc494ca11e Initial load
duke
parents:
diff changeset
   350
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   351
     * Add the package use information.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   352
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   353
     * @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
   354
     * @param contentTree the content tree to which the package use information will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   355
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   356
    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
   357
        Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
25454
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 24297
diff changeset
   358
                getHyperLink(pkg.name(), new StringContent(utils.getPackageName(pkg))));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   359
        contentTree.addContent(tdFirst);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   360
        HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   361
        tdLast.addStyle(HtmlStyle.colLast);
8841
b4422fa4f2e6 7006178: findbugs high priority issues in new javadoc
bpatel
parents: 7681
diff changeset
   362
        addSummaryComment(pkg, tdLast);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   363
        contentTree.addContent(tdLast);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   364
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   365
06bc494ca11e Initial load
duke
parents:
diff changeset
   366
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   367
     * Add the class use information.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   368
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   369
     * @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
   370
     * @param contentTree the content tree to which the class use information will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   371
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   372
    protected void addClassUse(PackageDoc pkg, Content contentTree) throws IOException {
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   373
        Content classLink = getLink(new LinkInfoImpl(configuration,
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   374
            LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc));
25454
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 24297
diff changeset
   375
        Content pkgLink = getPackageLink(pkg, utils.getPackageName(pkg));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   376
        classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   377
                configuration.getResource("doclet.ClassUse_Annotation", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   378
                pkgLink), classUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   379
        classSubWriter.addUseInfo(pkgToClassTypeParameter.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   380
                configuration.getResource("doclet.ClassUse_TypeParameter", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   381
                pkgLink), classUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   382
        classSubWriter.addUseInfo(pkgToSubclass.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   383
                configuration.getResource("doclet.ClassUse_Subclass", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   384
                pkgLink), subclassUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   385
        classSubWriter.addUseInfo(pkgToSubinterface.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   386
                configuration.getResource("doclet.ClassUse_Subinterface", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   387
                pkgLink), subinterfaceUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   388
        classSubWriter.addUseInfo(pkgToImplementingClass.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   389
                configuration.getResource("doclet.ClassUse_ImplementingClass", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   390
                pkgLink), classUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   391
        fieldSubWriter.addUseInfo(pkgToField.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   392
                configuration.getResource("doclet.ClassUse_Field", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   393
                pkgLink), fieldUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   394
        fieldSubWriter.addUseInfo(pkgToFieldAnnotations.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   395
                configuration.getResource("doclet.ClassUse_FieldAnnotations", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   396
                pkgLink), fieldUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   397
        fieldSubWriter.addUseInfo(pkgToFieldTypeParameter.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   398
                configuration.getResource("doclet.ClassUse_FieldTypeParameter", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   399
                pkgLink), fieldUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   400
        methodSubWriter.addUseInfo(pkgToMethodAnnotations.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   401
                configuration.getResource("doclet.ClassUse_MethodAnnotations", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   402
                pkgLink), methodUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   403
        methodSubWriter.addUseInfo(pkgToMethodParameterAnnotations.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   404
                configuration.getResource("doclet.ClassUse_MethodParameterAnnotations", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   405
                pkgLink), methodUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   406
        methodSubWriter.addUseInfo(pkgToMethodTypeParameter.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   407
                configuration.getResource("doclet.ClassUse_MethodTypeParameter", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   408
                pkgLink), methodUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   409
        methodSubWriter.addUseInfo(pkgToMethodReturn.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   410
                configuration.getResource("doclet.ClassUse_MethodReturn", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   411
                pkgLink), methodUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   412
        methodSubWriter.addUseInfo(pkgToMethodReturnTypeParameter.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   413
                configuration.getResource("doclet.ClassUse_MethodReturnTypeParameter", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   414
                pkgLink), methodUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   415
        methodSubWriter.addUseInfo(pkgToMethodArgs.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   416
                configuration.getResource("doclet.ClassUse_MethodArgs", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   417
                pkgLink), methodUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   418
        methodSubWriter.addUseInfo(pkgToMethodArgTypeParameter.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   419
                configuration.getResource("doclet.ClassUse_MethodArgsTypeParameters", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   420
                pkgLink), methodUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   421
        methodSubWriter.addUseInfo(pkgToMethodThrows.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   422
                configuration.getResource("doclet.ClassUse_MethodThrows", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   423
                pkgLink), methodUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   424
        constrSubWriter.addUseInfo(pkgToConstructorAnnotations.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   425
                configuration.getResource("doclet.ClassUse_ConstructorAnnotations", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   426
                pkgLink), constructorUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   427
        constrSubWriter.addUseInfo(pkgToConstructorParameterAnnotations.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   428
                configuration.getResource("doclet.ClassUse_ConstructorParameterAnnotations", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   429
                pkgLink), constructorUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   430
        constrSubWriter.addUseInfo(pkgToConstructorArgs.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   431
                configuration.getResource("doclet.ClassUse_ConstructorArgs", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   432
                pkgLink), constructorUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   433
        constrSubWriter.addUseInfo(pkgToConstructorArgTypeParameter.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   434
                configuration.getResource("doclet.ClassUse_ConstructorArgsTypeParameters", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   435
                pkgLink), constructorUseTableSummary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   436
        constrSubWriter.addUseInfo(pkgToConstructorThrows.get(pkg.name()),
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17569
diff changeset
   437
                configuration.getResource("doclet.ClassUse_ConstructorThrows", classLink,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   438
                pkgLink), constructorUseTableSummary, contentTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   439
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   440
06bc494ca11e Initial load
duke
parents:
diff changeset
   441
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   442
     * 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
   443
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   444
     * @return a content tree representing the class use header
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   445
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   446
    protected Content getClassUseHeader() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   447
        String cltype = configuration.getText(classdoc.isInterface()?
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   448
            "doclet.Interface":"doclet.Class");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   449
        String clname = classdoc.qualifiedName();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   450
        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
   451
                cltype, clname);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   452
        Content bodyTree = getBody(true, getWindowTitle(title));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   453
        addTop(bodyTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   454
        addNavLinks(true, bodyTree);
17562
c84f1d7fa11d 8011662: Remove single instance of resource with HTML from doclet resource bundle
jjg
parents: 17561
diff changeset
   455
        ContentBuilder headContent = new ContentBuilder();
c84f1d7fa11d 8011662: Remove single instance of resource with HTML from doclet resource bundle
jjg
parents: 17561
diff changeset
   456
        headContent.addContent(getResource("doclet.ClassUse_Title", cltype));
c84f1d7fa11d 8011662: Remove single instance of resource with HTML from doclet resource bundle
jjg
parents: 17561
diff changeset
   457
        headContent.addContent(new HtmlTree(HtmlTag.BR));
c84f1d7fa11d 8011662: Remove single instance of resource with HTML from doclet resource bundle
jjg
parents: 17561
diff changeset
   458
        headContent.addContent(clname);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   459
        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
   460
                true, HtmlStyle.title, headContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   461
        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
   462
        bodyTree.addContent(div);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   463
        return bodyTree;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   464
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   465
06bc494ca11e Initial load
duke
parents:
diff changeset
   466
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   467
     * Get this package link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   468
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   469
     * @return a content tree for the package link
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   470
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   471
    protected Content getNavLinkPackage() {
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
   472
        Content linkContent =
14358
9eda9239cba0 8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents: 14357
diff changeset
   473
                getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_SUMMARY), packageLabel);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   474
        Content li = HtmlTree.LI(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   475
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   476
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   477
06bc494ca11e Initial load
duke
parents:
diff changeset
   478
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   479
     * Get class page link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   480
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   481
     * @return a content tree for the class page link
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   482
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   483
    protected Content getNavLinkClass() {
17559
87c28ee29329 8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents: 17558
diff changeset
   484
        Content linkContent = getLink(new LinkInfoImpl(
17561
9f3505f35da9 8011651: simplify LinkInfoImpl API
jjg
parents: 17559
diff changeset
   485
                configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)
9f3505f35da9 8011651: simplify LinkInfoImpl API
jjg
parents: 17559
diff changeset
   486
                .label(configuration.getText("doclet.Class")));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   487
        Content li = HtmlTree.LI(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   488
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   489
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   490
06bc494ca11e Initial load
duke
parents:
diff changeset
   491
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   492
     * Get the use link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   493
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   494
     * @return a content tree for the use link
10
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
    protected Content getNavLinkClassUse() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   497
        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
   498
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   499
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   500
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   501
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   502
     * Get the tree link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   503
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   504
     * @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
   505
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   506
    protected Content getNavLinkTree() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   507
        Content linkContent = classdoc.containingPackage().isIncluded() ?
14358
9eda9239cba0 8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents: 14357
diff changeset
   508
            getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_TREE), treeLabel) :
9eda9239cba0 8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents: 14357
diff changeset
   509
            getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), treeLabel);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   510
        Content li = HtmlTree.LI(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   511
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   512
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   513
}