src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java
author jjg
Thu, 16 Nov 2017 15:01:45 -0800
changeset 47846 4e78aba768f0
parent 47216 71c04702a3d5
child 47850 4a28dc8a86c2
permissions -rw-r--r--
8190295: Introduce a new Table builder class Reviewed-by: bpatel, ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
40229
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
     1
/*
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 42277
diff changeset
     2
 * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
40229
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
     4
 *
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    10
 *
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    15
 * accompanied this code).
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    16
 *
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    20
 *
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    23
 * questions.
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    24
 */
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    25
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    26
package jdk.javadoc.internal.doclets.formats.html;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    27
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    28
import java.util.*;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    29
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    30
import javax.lang.model.element.ModuleElement;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    31
import javax.lang.model.element.PackageElement;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    32
import javax.lang.model.element.TypeElement;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    33
import javax.lang.model.util.ElementFilter;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    34
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    35
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    36
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    37
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    38
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    39
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    40
import jdk.javadoc.internal.doclets.toolkit.Content;
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
    41
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
40229
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    42
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    43
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    44
/**
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    45
 * Class to generate file for each module contents in the left-hand bottom
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    46
 * frame. This will list all the Class Kinds in the module. A click on any
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    47
 * class-kind will update the right-hand frame with the clicked class-kind page.
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    48
 *
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    49
 *  <p><b>This is NOT part of any supported API.
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    50
 *  If you write code that depends on this, you do so at your own risk.
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    51
 *  This code and its internal interfaces are subject to change or
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    52
 *  deletion without notice.</b>
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    53
 *
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    54
 * @author Bhavesh Patel
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    55
 */
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    56
public class ModuleFrameWriter extends HtmlDocletWriter {
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    57
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    58
    /**
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    59
     * The module being documented.
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    60
     */
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 40229
diff changeset
    61
    private final ModuleElement mdle;
40229
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    62
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    63
    /**
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    64
     * The classes to be documented.  Use this to filter out classes
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    65
     * that will not be documented.
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    66
     */
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    67
    private SortedSet<TypeElement> documentedClasses;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    68
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    69
    /**
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    70
     * Constructor to construct ModuleFrameWriter object and to generate
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    71
     * "module_name-type-frame.html" file. For example for module "java.base" this will generate file
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    72
     * "java.base-type-frame.html" file.
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    73
     *
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    74
     * @param configuration the configuration of the doclet.
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    75
     * @param moduleElement moduleElement under consideration.
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    76
     */
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 42277
diff changeset
    77
    public ModuleFrameWriter(HtmlConfiguration configuration, ModuleElement moduleElement) {
40229
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    78
        super(configuration, DocPaths.moduleTypeFrame(moduleElement));
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    79
        this.mdle = moduleElement;
42277
2668b0bc7ad7 8164316: Refine the Doclet APIs
ksrini
parents: 40587
diff changeset
    80
        if (configuration.getSpecifiedPackageElements().isEmpty()) {
40229
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    81
            documentedClasses = new TreeSet<>(utils.makeGeneralPurposeComparator());
42277
2668b0bc7ad7 8164316: Refine the Doclet APIs
ksrini
parents: 40587
diff changeset
    82
            documentedClasses.addAll(configuration.getIncludedTypeElements());
40229
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    83
        }
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    84
    }
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    85
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    86
    /**
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    87
     * Generate a module type summary page for the left-hand bottom frame.
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    88
     *
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    89
     * @param configuration the current configuration of the doclet.
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    90
     * @param moduleElement The package for which "module_name-type-frame.html" is to be generated.
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
    91
     * @throws DocFileIOException if there is a problem generating the module summary file
40229
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
    92
     */
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 42277
diff changeset
    93
    public static void generate(HtmlConfiguration configuration, ModuleElement moduleElement)
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
    94
            throws DocFileIOException {
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
    95
        ModuleFrameWriter mdlgen = new ModuleFrameWriter(configuration, moduleElement);
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
    96
        String mdlName = moduleElement.getQualifiedName().toString();
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
    97
        Content mdlLabel = new StringContent(mdlName);
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
    98
        HtmlTree body = mdlgen.getBody(false, mdlgen.getWindowTitle(mdlName));
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
    99
        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   100
                ? HtmlTree.MAIN()
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   101
                : body;
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   102
        Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar,
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   103
                mdlgen.getHyperLink(DocPaths.moduleSummary(moduleElement), mdlLabel, "", "classFrame"));
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   104
        htmlTree.addContent(heading);
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   105
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
47846
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47216
diff changeset
   106
        div.setStyle(HtmlStyle.indexContainer);
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   107
        mdlgen.addClassListing(div);
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   108
        htmlTree.addContent(div);
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   109
        if (configuration.allowTag(HtmlTag.MAIN)) {
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   110
            body.addContent(htmlTree);
40229
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   111
        }
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   112
        mdlgen.printHtmlDocument(
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   113
                configuration.metakeywords.getMetaKeywordsForModule(moduleElement), false, body);
40229
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   114
    }
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   115
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   116
    /**
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   117
     * Add class listing for all the classes in this module. Divide class
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   118
     * listing as per the class kind and generate separate listing for
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   119
     * Classes, Interfaces, Exceptions and Errors.
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   120
     *
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   121
     * @param contentTree the content tree to which the listing will be added
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   122
     */
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   123
    protected void addClassListing(HtmlTree contentTree) {
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   124
        List<PackageElement> packagesIn = ElementFilter.packagesIn(mdle.getEnclosedElements());
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   125
        SortedSet<TypeElement> interfaces = new TreeSet<>(utils.makeGeneralPurposeComparator());
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   126
        SortedSet<TypeElement> classes = new TreeSet<>(utils.makeGeneralPurposeComparator());
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   127
        SortedSet<TypeElement> enums = new TreeSet<>(utils.makeGeneralPurposeComparator());
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   128
        SortedSet<TypeElement> exceptions = new TreeSet<>(utils.makeGeneralPurposeComparator());
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   129
        SortedSet<TypeElement> errors = new TreeSet<>(utils.makeGeneralPurposeComparator());
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   130
        SortedSet<TypeElement> annotationTypes = new TreeSet<>(utils.makeGeneralPurposeComparator());
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   131
        for (PackageElement pkg : packagesIn) {
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   132
            if (utils.isIncluded(pkg)) {
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   133
                interfaces.addAll(utils.getInterfaces(pkg));
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   134
                classes.addAll(utils.getOrdinaryClasses(pkg));
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   135
                enums.addAll(utils.getEnums(pkg));
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   136
                exceptions.addAll(utils.getExceptions(pkg));
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   137
                errors.addAll(utils.getErrors(pkg));
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   138
                annotationTypes.addAll(utils.getAnnotationTypes(pkg));
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   139
            }
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   140
        }
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 40229
diff changeset
   141
        addClassKindListing(interfaces, contents.interfaces, contentTree);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 40229
diff changeset
   142
        addClassKindListing(classes, contents.classes, contentTree);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 40229
diff changeset
   143
        addClassKindListing(enums, contents.enums, contentTree);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 40229
diff changeset
   144
        addClassKindListing(exceptions, contents.exceptions, contentTree);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 40229
diff changeset
   145
        addClassKindListing(errors, contents.errors, contentTree);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 40229
diff changeset
   146
        addClassKindListing(annotationTypes, contents.annotationTypes, contentTree);
40229
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   147
    }
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   148
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   149
    /**
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   150
     * Add specific class kind listing. Also add label to the listing.
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   151
     *
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   152
     * @param list Iterable list of TypeElements
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   153
     * @param labelContent content tree of the label to be added
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   154
     * @param contentTree the content tree to which the class kind listing will be added
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   155
     */
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   156
    protected void addClassKindListing(Iterable<TypeElement> list, Content labelContent,
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   157
            HtmlTree contentTree) {
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   158
        SortedSet<TypeElement> tset = utils.filterOutPrivateClasses(list, configuration.javafx);
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   159
        if (!tset.isEmpty()) {
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   160
            boolean printedHeader = false;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   161
            HtmlTree htmlTree = (configuration.allowTag(HtmlTag.SECTION))
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   162
                    ? HtmlTree.SECTION()
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   163
                    : contentTree;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   164
            HtmlTree ul = new HtmlTree(HtmlTag.UL);
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   165
            ul.setTitle(labelContent);
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   166
            for (TypeElement typeElement : tset) {
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   167
                if (documentedClasses != null && !documentedClasses.contains(typeElement)) {
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   168
                    continue;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   169
                }
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   170
                if (!utils.isCoreClass(typeElement) || !configuration.isGeneratedDoc(typeElement)) {
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   171
                    continue;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   172
                }
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   173
                if (!printedHeader) {
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   174
                    Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   175
                            true, labelContent);
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   176
                    htmlTree.addContent(heading);
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   177
                    printedHeader = true;
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   178
                }
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   179
                Content arr_i_name = new StringContent(utils.getSimpleName(typeElement));
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   180
                if (utils.isInterface(typeElement)) {
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   181
                    arr_i_name = HtmlTree.SPAN(HtmlStyle.interfaceName, arr_i_name);
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   182
                }
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   183
                Content link = getLink(new LinkInfoImpl(configuration,
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   184
                        LinkInfoImpl.Kind.ALL_CLASSES_FRAME, typeElement).label(arr_i_name).target("classFrame"));
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   185
                Content li = HtmlTree.LI(link);
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   186
                ul.addContent(li);
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   187
            }
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   188
            htmlTree.addContent(ul);
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   189
            if (configuration.allowTag(HtmlTag.SECTION)) {
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   190
                contentTree.addContent(htmlTree);
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   191
            }
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   192
        }
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   193
    }
09f4478d07e5 8154817: Fix the click-through navigation for modules
bpatel
parents:
diff changeset
   194
}