src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 45417 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java@f7479ee8de69
child 47427 251676148c62
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 41157
diff changeset
     2
 * Copyright (c) 1998, 2017, 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
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    26
package jdk.javadoc.internal.doclets.formats.html;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
import java.util.*;
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 9606
diff changeset
    29
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    30
import javax.lang.model.element.PackageElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    31
import javax.lang.model.element.TypeElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    32
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    33
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    34
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    35
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    36
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    37
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    38
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    39
import jdk.javadoc.internal.doclets.toolkit.Content;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    40
import jdk.javadoc.internal.doclets.toolkit.util.ClassUseMapper;
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    41
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    42
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    43
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
 * Generate package usage information.
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    48
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    49
 *  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
    50
 *  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
    51
 *  deletion without notice.</b>
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    52
 *
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
 * @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
    54
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
public class PackageUseWriter extends SubWriterHolderWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    58
    final PackageElement packageElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    59
    final SortedMap<String, Set<TypeElement>> usingPackageToUsedClasses = new TreeMap<>();
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
    60
    protected HtmlTree mainTree = HtmlTree.MAIN();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
     * Constructor.
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
     * @param filename the file to be generated.
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
     */
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 41157
diff changeset
    67
    public PackageUseWriter(HtmlConfiguration configuration,
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
    68
                            ClassUseMapper mapper, DocPath filename,
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    69
                            PackageElement pkgElement) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    70
        super(configuration, DocPath.forPackage(pkgElement).resolve(filename));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    71
        this.packageElement = pkgElement;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
        // by examining all classes in this package, find what packages
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
        // use these classes - produce a map between using package and
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
        // used classes.
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    76
        for (TypeElement usedClass : utils.getEnclosedTypeElements(pkgElement)) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    77
            Set<TypeElement> usingClasses = mapper.classToClass.get(usedClass);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
            if (usingClasses != null) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    79
                for (TypeElement usingClass : usingClasses) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    80
                    PackageElement usingPackage = utils.containingPackage(usingClass);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    81
                    Set<TypeElement> usedClasses = usingPackageToUsedClasses
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    82
                            .get(utils.getPackageName(usingPackage));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
                    if (usedClasses == null) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    84
                        usedClasses = new TreeSet<>(utils.makeGeneralPurposeComparator());
25454
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 24221
diff changeset
    85
                        usingPackageToUsedClasses.put(utils.getPackageName(usingPackage),
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
                                                      usedClasses);
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
                    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
                    usedClasses.add(usedClass);
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
     * Generate a class page.
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
     * @param configuration the current configuration of the doclet.
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
     * @param mapper        the mapping of the class usage.
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    99
     * @param pkgElement    the package being documented.
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   100
     * @throws DocFileIOException if there is a problem generating the package use page
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
     */
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 41157
diff changeset
   102
    public static void generate(HtmlConfiguration configuration,
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   103
                                ClassUseMapper mapper, PackageElement pkgElement)
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   104
            throws DocFileIOException {
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
   105
        DocPath filename = DocPaths.PACKAGE_USE;
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   106
        PackageUseWriter pkgusegen = new PackageUseWriter(configuration, mapper, filename, pkgElement);
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   107
        pkgusegen.generatePackageUseFile();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   111
     * Generate the package use list.
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   112
     * @throws DocFileIOException if there is a problem generating the package use page
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   114
    protected void generatePackageUseFile() throws DocFileIOException {
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   115
        HtmlTree body = getPackageUseHeader();
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   116
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   117
        div.addStyle(HtmlStyle.contentContainer);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
        if (usingPackageToUsedClasses.isEmpty()) {
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 37943
diff changeset
   119
            div.addContent(contents.getContent("doclet.ClassUse_No.usage.of.0", utils.getPackageName(packageElement)));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
        } else {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   121
            addPackageUse(div);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
        }
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   123
        if (configuration.allowTag(HtmlTag.MAIN)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   124
            mainTree.addContent(div);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   125
            body.addContent(mainTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   126
        } else {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   127
            body.addContent(div);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   128
        }
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   129
        HtmlTree tree = (configuration.allowTag(HtmlTag.FOOTER))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   130
                ? HtmlTree.FOOTER()
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   131
                : body;
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   132
        addNavLinks(false, tree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   133
        addBottom(tree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   134
        if (configuration.allowTag(HtmlTag.FOOTER)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   135
            body.addContent(tree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   136
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   137
        printHtmlDocument(null, true, body);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   138
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   140
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   141
     * Add the package use information.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   142
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   143
     * @param contentTree the content tree to which the package use information will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   144
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   145
    protected void addPackageUse(Content contentTree) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   146
        HtmlTree ul = new HtmlTree(HtmlTag.UL);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   147
        ul.addStyle(HtmlStyle.blockList);
24221
2376793dd33b 8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents: 22163
diff changeset
   148
        if (configuration.packages.size() > 1) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   149
            addPackageList(ul);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   150
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   151
        addClassList(ul);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   152
        contentTree.addContent(ul);
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
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   156
     * Add the list of packages that use the given package.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   157
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   158
     * @param contentTree the content tree to which the package list will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   160
    protected void addPackageList(Content contentTree) {
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 37943
diff changeset
   161
        Content caption = getTableCaption(configuration.getContent(
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   162
                "doclet.ClassUse_Packages.that.use.0",
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   163
                getPackageLink(packageElement, utils.getPackageName(packageElement))));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   164
        Content table = (configuration.isOutputHtml5())
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   165
                ? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   166
                : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   167
        table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   168
        Content tbody = new HtmlTree(HtmlTag.TBODY);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   169
        boolean altColor = true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   170
        for (String pkgname: usingPackageToUsedClasses.keySet()) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   171
            PackageElement pkg = utils.elementUtils.getPackageElement(pkgname);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   172
            HtmlTree tr = new HtmlTree(HtmlTag.TR);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   173
            tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   174
            altColor = !altColor;
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   175
            addPackageUse(pkg, tr);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   176
            tbody.addContent(tr);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   178
        table.addContent(tbody);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   179
        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
   180
        contentTree.addContent(li);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   183
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   184
     * Add the list of classes that use the given package.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   185
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   186
     * @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
   187
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   188
    protected void addClassList(Content contentTree) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   189
        List<String> classTableHeader = Arrays.asList(
41157
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   190
                resources.getText("doclet.Class"), resources.getText("doclet.Description"));
22159
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 20613
diff changeset
   191
        for (String packageName : usingPackageToUsedClasses.keySet()) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   192
            PackageElement usingPackage = utils.elementUtils.getPackageElement(packageName);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   193
            HtmlTree li = new HtmlTree(HtmlTag.LI);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   194
            li.addStyle(HtmlStyle.blockList);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
            if (usingPackage != null) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   196
                li.addContent(getMarkerAnchor(utils.getPackageName(usingPackage)));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
            }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   198
            String tableSummary = configuration.getText("doclet.Use_Table_Summary",
22159
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 20613
diff changeset
   199
                                                        configuration.getText("doclet.classes"));
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 37943
diff changeset
   200
            Content caption = getTableCaption(configuration.getContent(
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   201
                    "doclet.ClassUse_Classes.in.0.used.by.1",
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   202
                    getPackageLink(packageElement, utils.getPackageName(packageElement)),
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   203
                    getPackageLink(usingPackage, utils.getPackageName(usingPackage))));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   204
            Content table = (configuration.isOutputHtml5())
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   205
                    ? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   206
                    : HtmlTree.TABLE(HtmlStyle.useSummary, tableSummary, caption);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   207
            table.addContent(getSummaryTableHeader(classTableHeader, "col"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   208
            Content tbody = new HtmlTree(HtmlTag.TBODY);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   209
            boolean altColor = true;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   210
            for (TypeElement te : usingPackageToUsedClasses.get(packageName)) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   211
                HtmlTree tr = new HtmlTree(HtmlTag.TR);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   212
                tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   213
                altColor = !altColor;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   214
                addClassRow(te, usingPackage, tr);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   215
                tbody.addContent(tr);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
            }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   217
            table.addContent(tbody);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   218
            li.addContent(table);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   219
            contentTree.addContent(li);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   223
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   224
     * Add a row for the class that uses the given package.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   225
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   226
     * @param usedClass the class that uses the given package
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   227
     * @param pkg  the package to which the class belongs
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   228
     * @param contentTree the content tree to which the row will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   229
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   230
    protected void addClassRow(TypeElement usedClass, PackageElement pkg,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   231
            Content contentTree) {
14358
9eda9239cba0 8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents: 14357
diff changeset
   232
        DocPath dp = pathString(usedClass,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   233
                DocPaths.CLASS_USE.resolve(DocPath.forName(utils, usedClass)));
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   234
        StringContent stringContent = new StringContent(utils.getSimpleName(usedClass));
41157
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   235
        Content thType = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   236
                getHyperLink(dp.fragment(getPackageAnchorName(pkg)), stringContent));
41157
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   237
        contentTree.addContent(thType);
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   238
        HtmlTree tdDesc = new HtmlTree(HtmlTag.TD);
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   239
        tdDesc.addStyle(HtmlStyle.colLast);
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   240
        addIndexComment(usedClass, tdDesc);
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   241
        contentTree.addContent(tdDesc);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   245
     * Add the package use information.
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
     * @param pkg the package that used the given package
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   248
     * @param contentTree the content tree to which the information will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   250
    protected void addPackageUse(PackageElement pkg, Content contentTree) {
41157
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   251
        Content thFirst = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst,
25454
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 24221
diff changeset
   252
                getHyperLink(utils.getPackageName(pkg),
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 24221
diff changeset
   253
                new StringContent(utils.getPackageName(pkg))));
41157
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   254
        contentTree.addContent(thFirst);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   255
        HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   256
        tdLast.addStyle(HtmlStyle.colLast);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   257
        if (pkg != null && !pkg.isUnnamed()) {
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 8841
diff changeset
   258
            addSummaryComment(pkg, tdLast);
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 8841
diff changeset
   259
        } else {
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 37943
diff changeset
   260
            tdLast.addContent(Contents.SPACE);
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 8841
diff changeset
   261
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   262
        contentTree.addContent(tdLast);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   266
     * Get the header for the package use listing.
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
     * @return a content tree representing the package use header
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
     */
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   270
    protected HtmlTree getPackageUseHeader() {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   271
        String packageText = configuration.getText("doclet.Package");
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   272
        String name = packageElement.isUnnamed() ? "" : utils.getPackageName(packageElement);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   273
        String title = configuration.getText("doclet.Window_ClassUse_Header", packageText, name);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   274
        HtmlTree bodyTree = getBody(true, getWindowTitle(title));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   275
        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   276
                ? HtmlTree.HEADER()
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   277
                : bodyTree;
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   278
        addTop(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   279
        addNavLinks(true, htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   280
        if (configuration.allowTag(HtmlTag.HEADER)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   281
            bodyTree.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   282
        }
17562
c84f1d7fa11d 8011662: Remove single instance of resource with HTML from doclet resource bundle
jjg
parents: 17559
diff changeset
   283
        ContentBuilder headContent = new ContentBuilder();
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 37943
diff changeset
   284
        headContent.addContent(contents.getContent("doclet.ClassUse_Title", packageText));
17562
c84f1d7fa11d 8011662: Remove single instance of resource with HTML from doclet resource bundle
jjg
parents: 17559
diff changeset
   285
        headContent.addContent(new HtmlTree(HtmlTag.BR));
c84f1d7fa11d 8011662: Remove single instance of resource with HTML from doclet resource bundle
jjg
parents: 17559
diff changeset
   286
        headContent.addContent(name);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   287
        Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   288
                HtmlStyle.title, headContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   289
        Content div = HtmlTree.DIV(HtmlStyle.header, heading);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   290
        if (configuration.allowTag(HtmlTag.MAIN)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   291
            mainTree.addContent(div);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   292
        } else {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   293
            bodyTree.addContent(div);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26900
diff changeset
   294
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   295
        return bodyTree;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
    /**
37943
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 35426
diff changeset
   299
     * Get the module link.
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 35426
diff changeset
   300
     *
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 35426
diff changeset
   301
     * @return a content tree for the module link
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 35426
diff changeset
   302
     */
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 35426
diff changeset
   303
    @Override
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 35426
diff changeset
   304
    protected Content getNavLinkModule() {
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 35426
diff changeset
   305
        Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement),
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 37943
diff changeset
   306
                contents.moduleLabel);
37943
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 35426
diff changeset
   307
        Content li = HtmlTree.LI(linkContent);
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 35426
diff changeset
   308
        return li;
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 35426
diff changeset
   309
    }
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 35426
diff changeset
   310
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 35426
diff changeset
   311
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   312
     * Get this package link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   313
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   314
     * @return a content tree for the package link
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   316
    @Override
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   317
    protected Content getNavLinkPackage() {
14358
9eda9239cba0 8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents: 14357
diff changeset
   318
        Content linkContent = getHyperLink(DocPaths.PACKAGE_SUMMARY,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 37943
diff changeset
   319
                contents.packageLabel);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   320
        Content li = HtmlTree.LI(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   321
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   322
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   323
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   324
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   325
     * Get the use link.
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
     * @return a content tree for the use link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   328
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   329
    @Override
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   330
    protected Content getNavLinkClassUse() {
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 37943
diff changeset
   331
        Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.useLabel);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   332
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   333
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   334
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   335
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   336
     * Get the tree link.
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
     * @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
   339
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   340
    @Override
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   341
    protected Content getNavLinkTree() {
14358
9eda9239cba0 8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents: 14357
diff changeset
   342
        Content linkContent = getHyperLink(DocPaths.PACKAGE_TREE,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 37943
diff changeset
   343
                contents.treeLabel);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   344
        Content li = HtmlTree.LI(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   345
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   346
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   347
}