langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java
author ksrini
Wed, 15 Mar 2017 06:30:33 -0700
changeset 44293 2f47b2c16612
parent 42831 feff6f296019
child 44564 4e1df2513486
permissions -rw-r--r--
8176778: javadoc does not produce summary pages for aggregated modules Reviewed-by: bpatel, jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     1
/*
44293
2f47b2c16612 8176778: javadoc does not produce summary pages for aggregated modules
ksrini
parents: 42831
diff changeset
     2
 * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     4
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    10
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    15
 * accompanied this code).
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    16
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    20
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    23
 * questions.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    24
 */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    25
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    26
package jdk.javadoc.internal.doclets.formats.html;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    27
44293
2f47b2c16612 8176778: javadoc does not produce summary pages for aggregated modules
ksrini
parents: 42831
diff changeset
    28
import java.util.Collections;
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    29
import java.util.EnumSet;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    30
import java.util.LinkedHashMap;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    31
import java.util.List;
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
    32
import java.util.Map;
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    33
import java.util.Set;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    34
import java.util.SortedSet;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    35
import java.util.TreeMap;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    36
import java.util.TreeSet;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    37
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    38
import javax.lang.model.element.Element;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    39
import javax.lang.model.element.ModuleElement;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    40
import javax.lang.model.element.PackageElement;
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
    41
import javax.lang.model.element.TypeElement;
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    42
import javax.lang.model.util.ElementFilter;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    43
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    44
import com.sun.source.doctree.DocTree;
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    45
import jdk.javadoc.doclet.DocletEnvironment.ModuleMode;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    46
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    47
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    48
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    49
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    50
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    51
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
    52
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    53
import jdk.javadoc.internal.doclets.toolkit.Content;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    54
import jdk.javadoc.internal.doclets.toolkit.ModuleSummaryWriter;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    55
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    56
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    57
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    58
import jdk.javadoc.internal.doclets.toolkit.util.ModulePackageTypes;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    59
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    60
/**
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    61
 * Class to generate file for each module contents in the right-hand frame. This will list all the
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    62
 * required modules, packages and service types for the module. A click on any of the links will update
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    63
 * the frame with the clicked element page.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    64
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    65
 *  <p><b>This is NOT part of any supported API.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    66
 *  If you write code that depends on this, you do so at your own risk.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    67
 *  This code and its internal interfaces are subject to change or
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    68
 *  deletion without notice.</b>
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    69
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    70
 * @author Bhavesh Patel
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    71
 */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    72
public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryWriter {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    73
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    74
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    75
     * The prev module name in the alpha-order list.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    76
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    77
    protected ModuleElement prevModule;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    78
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    79
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    80
     * The next module name in the alpha-order list.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    81
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    82
    protected ModuleElement nextModule;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    83
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    84
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    85
     * The module being documented.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    86
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    87
    protected ModuleElement mdle;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    88
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    89
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    90
     * The module mode for this javadoc run. It can be set to "api" or "all".
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    91
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    92
    private final ModuleMode moduleMode;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    93
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    94
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    95
     * Map of module elements and modifiers required by this module.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    96
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    97
    private final Map<ModuleElement, Content> requires
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    98
            = new TreeMap<>(utils.makeModuleComparator());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
    99
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   100
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   101
     * Map of additional modules and modifiers, transitive closure, required by this module.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   102
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   103
    private final Map<ModuleElement, Content> additionalModules
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   104
            = new TreeMap<>(utils.makeModuleComparator());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   105
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   106
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   107
     * Map of packages exported by this module and the modules it's been exported to.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   108
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   109
    private final Map<PackageElement, SortedSet<ModuleElement>> exportedPackages
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   110
            = new TreeMap<>(utils.makePackageComparator());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   111
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   112
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   113
     * Map of opened packages by this module and the modules it's been opened to.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   114
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   115
    private final Map<PackageElement, SortedSet<ModuleElement>> openedPackages
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   116
            = new TreeMap<>(utils.makePackageComparator());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   117
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   118
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   119
     * Set of concealed packages of this module.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   120
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   121
    private final SortedSet<PackageElement> concealedPackages = new TreeSet<>(utils.makePackageComparator());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   122
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   123
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   124
     * Map of additional modules (transitive closure) and its exported packages.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   125
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   126
    private final Map<ModuleElement, SortedSet<PackageElement>> additionalPackages
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   127
            = new TreeMap<>(utils.makeModuleComparator());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   128
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   129
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   130
     * Map of additional modules (transitive closure) and its open packages.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   131
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   132
    private final Map<ModuleElement, SortedSet<PackageElement>> additionalOpenPackages
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   133
            = new TreeMap<>(utils.makeModuleComparator());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   134
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   135
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   136
     * Set of services used by the module.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   137
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   138
    private final SortedSet<TypeElement> uses
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   139
            = new TreeSet<>(utils.makeAllClassesComparator());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   140
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   141
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   142
     * Map of services used by the module and specified using @uses javadoc tag, and description.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   143
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   144
    private final Map<TypeElement, Content> usesTrees
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   145
            = new TreeMap<>(utils.makeAllClassesComparator());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   146
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   147
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   148
     * Map of services provided by this module, and set of its implementations.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   149
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   150
    private final Map<TypeElement, SortedSet<TypeElement>> provides
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   151
            = new TreeMap<>(utils.makeAllClassesComparator());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   152
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   153
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   154
     * Map of services provided by the module and specified using @provides javadoc tag, and
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   155
     * description.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   156
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   157
    private final Map<TypeElement, Content> providesTrees
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   158
            = new TreeMap<>(utils.makeAllClassesComparator());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   159
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   160
    private int packageTypesOr = 0;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   161
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   162
    protected Set<ModulePackageTypes> modulePackageTypes = EnumSet.noneOf(ModulePackageTypes.class);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   163
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   164
    protected Map<String, Integer> typeMap = new LinkedHashMap<>();
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   165
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   166
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   167
     * The HTML tree for main tag.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   168
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   169
    protected HtmlTree mainTree = HtmlTree.MAIN();
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   170
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   171
    /**
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   172
     * The HTML tree for section tag.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   173
     */
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   174
    protected HtmlTree sectionTree = HtmlTree.SECTION();
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   175
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   176
    /**
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   177
     * Constructor to construct ModuleWriter object and to generate "moduleName-summary.html" file.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   178
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   179
     * @param configuration the configuration of the doclet.
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   180
     * @param mdle        Module under consideration.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   181
     * @param prevModule   Previous module in the sorted array.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   182
     * @param nextModule   Next module in the sorted array.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   183
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   184
    public ModuleWriterImpl(ConfigurationImpl configuration,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   185
            ModuleElement mdle, ModuleElement prevModule, ModuleElement nextModule) {
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   186
        super(configuration, DocPaths.moduleSummary(mdle));
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   187
        this.prevModule = prevModule;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   188
        this.nextModule = nextModule;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   189
        this.mdle = mdle;
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   190
        this.moduleMode = configuration.docEnv.getModuleMode();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   191
        computeModulesData();
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   192
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   193
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   194
    /**
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   195
     * Get the module header.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   196
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   197
     * @param heading the heading for the section
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   198
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   199
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   200
    public Content getModuleHeader(String heading) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   201
        HtmlTree bodyTree = getBody(true, getWindowTitle(mdle.getQualifiedName().toString()));
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   202
        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   203
                ? HtmlTree.HEADER()
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   204
                : bodyTree;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   205
        addTop(htmlTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   206
        addNavLinks(true, htmlTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   207
        if (configuration.allowTag(HtmlTag.HEADER)) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   208
            bodyTree.addContent(htmlTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   209
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   210
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   211
        div.addStyle(HtmlStyle.header);
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   212
        Content annotationContent = new HtmlTree(HtmlTag.P);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   213
        addAnnotationInfo(mdle, annotationContent);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   214
        div.addContent(annotationContent);
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   215
        Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   216
                HtmlStyle.title, contents.moduleLabel);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   217
        tHeading.addContent(Contents.SPACE);
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   218
        Content moduleHead = new RawHtml(heading);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   219
        tHeading.addContent(moduleHead);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   220
        div.addContent(tHeading);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   221
        if (configuration.allowTag(HtmlTag.MAIN)) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   222
            mainTree.addContent(div);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   223
        } else {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   224
            bodyTree.addContent(div);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   225
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   226
        return bodyTree;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   227
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   228
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   229
    /**
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   230
     * Get the content header.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   231
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   232
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   233
    public Content getContentHeader() {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   234
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   235
        div.addStyle(HtmlStyle.contentContainer);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   236
        return div;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   237
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   238
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   239
    /**
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   240
     * Get the summary section header.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   241
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   242
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   243
    public Content getSummaryHeader() {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   244
        HtmlTree li = new HtmlTree(HtmlTag.LI);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   245
        li.addStyle(HtmlStyle.blockList);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   246
        return li;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   247
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   248
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   249
    /**
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   250
     * Get the summary tree.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   251
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   252
     * @param summaryContentTree the content tree to be added to the summary tree.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   253
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   254
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   255
    public Content getSummaryTree(Content summaryContentTree) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   256
        HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, summaryContentTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   257
        return ul;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   258
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   259
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   260
    /**
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   261
     * Compute the modules data that will be displayed in various tables on the module summary page.
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   262
     */
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   263
    public void computeModulesData() {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   264
        CommentHelper ch = utils.getCommentHelper(mdle);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   265
        // Get module dependencies using the module's transitive closure.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   266
        Map<ModuleElement, String> dependentModules = utils.getDependentModules(mdle);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   267
        // Add all dependent modules to additional modules set. We will remove the modules,
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   268
        // listed using the requires directive, from this set to come up with the table of additional
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   269
        // required modules.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   270
        dependentModules.forEach((module, mod) -> {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   271
            if (shouldDocument(module)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   272
                additionalModules.put(module, new StringContent(mod));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   273
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   274
        });
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   275
        (ElementFilter.requiresIn(mdle.getDirectives())).forEach((directive) -> {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   276
            ModuleElement m = directive.getDependency();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   277
            if (shouldDocument(m)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   278
                if (moduleMode == ModuleMode.ALL || directive.isTransitive()) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   279
                    requires.put(m, new StringContent(utils.getModifiers(directive)));
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   280
            } else {
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   281
                // For api mode, just keep the public requires in dependentModules for display of
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   282
                    // additional packages in the "Packages" section.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   283
                    dependentModules.remove(m);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   284
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   285
                additionalModules.remove(m);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   286
        }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   287
        });
44293
2f47b2c16612 8176778: javadoc does not produce summary pages for aggregated modules
ksrini
parents: 42831
diff changeset
   288
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   289
        // Get all packages for the module and put it in the concealed packages set.
44293
2f47b2c16612 8176778: javadoc does not produce summary pages for aggregated modules
ksrini
parents: 42831
diff changeset
   290
        utils.getModulePackageMap().getOrDefault(mdle, Collections.emptySet()).forEach((pkg) -> {
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   291
            if (shouldDocument(pkg)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   292
                concealedPackages.add(pkg);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   293
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   294
        });
44293
2f47b2c16612 8176778: javadoc does not produce summary pages for aggregated modules
ksrini
parents: 42831
diff changeset
   295
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   296
        // Get all exported packages for the module using the exports directive for the module.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   297
        (ElementFilter.exportsIn(mdle.getDirectives())).forEach((directive) -> {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   298
            PackageElement p = directive.getPackage();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   299
            if (shouldDocument(p)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   300
                SortedSet<ModuleElement> mdleList = new TreeSet<>(utils.makeModuleComparator());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   301
                List<? extends ModuleElement> targetMdles = directive.getTargetModules();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   302
                if (targetMdles != null) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   303
                    mdleList.addAll(targetMdles);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   304
                }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   305
                // Qualified exports should not be displayed in the api mode. So if mdleList is empty,
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   306
                // its exported to all modules and hence can be added.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   307
                if (moduleMode == ModuleMode.ALL || mdleList.isEmpty()) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   308
                    exportedPackages.put(p, mdleList);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   309
                }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   310
                concealedPackages.remove(p);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   311
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   312
        });
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   313
        // Get all opened packages for the module using the opens directive for the module.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   314
        (ElementFilter.opensIn(mdle.getDirectives())).forEach((directive) -> {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   315
            PackageElement p = directive.getPackage();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   316
            if (shouldDocument(p)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   317
                SortedSet<ModuleElement> mdleList = new TreeSet<>(utils.makeModuleComparator());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   318
                List<? extends ModuleElement> targetMdles = directive.getTargetModules();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   319
                if (targetMdles != null) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   320
                    mdleList.addAll(targetMdles);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   321
                }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   322
                // Qualified opens should not be displayed in the api mode. So if mdleList is empty,
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   323
                // it's opened to all modules and hence can be added.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   324
                if (moduleMode == ModuleMode.ALL || mdleList.isEmpty()) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   325
                    openedPackages.put(p, mdleList);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   326
                }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   327
                concealedPackages.remove(p);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   328
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   329
        });
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   330
        // Remove all the exported and opened packages so we have just the concealed packages now.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   331
        concealedPackages.removeAll(exportedPackages.keySet());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   332
        concealedPackages.removeAll(openedPackages.keySet());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   333
        // Get all the exported and opened packages, for the transitive closure of the module, to be displayed in
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   334
        // the additional packages tables.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   335
        dependentModules.forEach((module, mod) -> {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   336
            SortedSet<PackageElement> pkgList = new TreeSet<>(utils.makePackageComparator());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   337
            (ElementFilter.exportsIn(module.getDirectives())).forEach((directive) -> {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   338
                PackageElement pkg = directive.getPackage();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   339
                if (shouldDocument(pkg)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   340
                    pkgList.add(pkg);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   341
                }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   342
            });
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   343
            // If none of the transitive modules have exported packages to be displayed, we should not be
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   344
            // displaying the table and so it should not be added to the map.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   345
            if (!pkgList.isEmpty()) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   346
                additionalPackages.put(module, pkgList);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   347
            }
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   348
            SortedSet<PackageElement> openPkgList = new TreeSet<>(utils.makePackageComparator());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   349
            (ElementFilter.opensIn(module.getDirectives())).forEach((directive) -> {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   350
                PackageElement pkg = directive.getPackage();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   351
                if (shouldDocument(pkg)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   352
                    openPkgList.add(pkg);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   353
                }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   354
            });
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   355
            // If none of the transitive modules have opened packages to be displayed, we should not be
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   356
            // displaying the table and so it should not be added to the map.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   357
            if (!openPkgList.isEmpty()) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   358
                additionalOpenPackages.put(module, openPkgList);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   359
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   360
        });
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   361
        // Get all the services listed as uses directive.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   362
        (ElementFilter.usesIn(mdle.getDirectives())).forEach((directive) -> {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   363
            TypeElement u = directive.getService();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   364
            if (shouldDocument(u)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   365
                uses.add(u);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   366
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   367
        });
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   368
        // Get all the services and implementations listed as provides directive.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   369
        (ElementFilter.providesIn(mdle.getDirectives())).forEach((directive) -> {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   370
            TypeElement u = directive.getService();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   371
            if (shouldDocument(u)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   372
                List<? extends TypeElement> implList = directive.getImplementations();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   373
                SortedSet<TypeElement> implSet = new TreeSet<>(utils.makeAllClassesComparator());
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   374
                implSet.addAll(implList);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   375
                provides.put(u, implSet);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   376
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   377
        });
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   378
        // Generate the map of all services listed using @provides, and the description.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   379
        (utils.getBlockTags(mdle, DocTree.Kind.PROVIDES)).forEach((tree) -> {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   380
            TypeElement t = ch.getServiceType(configuration, tree);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   381
            if (t != null) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   382
                providesTrees.put(t, commentTagsToContent(tree, mdle, ch.getDescription(configuration, tree), false));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   383
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   384
        });
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   385
        // Generate the map of all services listed using @uses, and the description.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   386
        (utils.getBlockTags(mdle, DocTree.Kind.USES)).forEach((tree) -> {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   387
            TypeElement t = ch.getServiceType(configuration, tree);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   388
            if (t != null) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   389
                usesTrees.put(t, commentTagsToContent(tree, mdle, ch.getDescription(configuration, tree), false));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   390
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   391
        });
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   392
    }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   393
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   394
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   395
     * Returns true if the element should be documented on the module summary page.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   396
     *
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   397
     * @param element the element to be checked
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   398
     * @return true if the element should be documented
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   399
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   400
    public boolean shouldDocument(Element element) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   401
        return (moduleMode == ModuleMode.ALL || utils.isIncluded(element));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   402
    }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   403
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   404
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   405
     * Returns true if there are elements to be displayed.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   406
     *
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   407
     * @param section set of elements
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   408
     * @return true if there are elements to be displayed
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   409
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   410
    public boolean display(SortedSet<? extends Element> section) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   411
        return section != null && !section.isEmpty();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   412
    }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   413
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   414
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   415
     * Returns true if there are elements to be displayed.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   416
     *
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   417
     * @param section map of elements.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   418
     * @return true if there are elements to be displayed
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   419
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   420
    public boolean display(Map<? extends Element, ?> section) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   421
        return section != null && !section.isEmpty();
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   422
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   423
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   424
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   425
     * Add the summary header.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   426
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   427
     * @param startMarker the marker comment
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   428
     * @param markerAnchor the marker anchor for the section
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   429
     * @param heading the heading for the section
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   430
     * @param htmltree the content tree to which the information is added
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   431
     */
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   432
    public void addSummaryHeader(Content startMarker, SectionName markerAnchor, Content heading, Content htmltree) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   433
        htmltree.addContent(startMarker);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   434
        htmltree.addContent(getMarkerAnchor(markerAnchor));
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   435
        htmltree.addContent(HtmlTree.HEADING(HtmlTag.H3, heading));
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   436
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   437
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   438
    /**
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   439
     * Get table header.
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   440
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   441
     * @param text the table caption
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   442
     * @param tableSummary the summary for the table
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   443
     * @param tableStyle the table style
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   444
     * @param tableHeader the table header
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   445
     * @return a content object
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   446
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   447
    public Content getTableHeader(String text, String tableSummary, HtmlStyle tableStyle,
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   448
            List<String> tableHeader) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   449
        return getTableHeader(getTableCaption(new RawHtml(text)), tableSummary, tableStyle, tableHeader);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   450
    }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   451
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   452
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   453
     * Get table header.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   454
     *
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   455
     * @param caption the table caption
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   456
     * @param tableSummary the summary for the table
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   457
     * @param tableStyle the table style
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   458
     * @param tableHeader the table header
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   459
     * @return a content object
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   460
     */
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   461
    public Content getTableHeader(Content caption, String tableSummary, HtmlStyle tableStyle,
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   462
            List<String> tableHeader) {
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   463
        Content table = (configuration.isOutputHtml5())
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   464
                ? HtmlTree.TABLE(tableStyle, caption)
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   465
                : HtmlTree.TABLE(tableStyle, tableSummary, caption);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   466
        table.addContent(getSummaryTableHeader(tableHeader, "col"));
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   467
        return table;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   468
    }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   469
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   470
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   471
     * {@inheritDoc}
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   472
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   473
    public void addModulesSummary(Content summaryContentTree) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   474
        if (display(requires) || display(additionalModules)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   475
            HtmlTree li = new HtmlTree(HtmlTag.LI);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   476
            li.addStyle(HtmlStyle.blockList);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   477
            addSummaryHeader(HtmlConstants.START_OF_MODULES_SUMMARY, SectionName.MODULES,
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   478
                    contents.navModules, li);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   479
            if (display(requires)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   480
            String text = configuration.getText("doclet.Requires_Summary");
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   481
            String tableSummary = configuration.getText("doclet.Member_Table_Summary",
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   482
                    configuration.getText("doclet.Requires_Summary"),
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   483
                    configuration.getText("doclet.modules"));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   484
                Content table = getTableHeader(text, tableSummary, HtmlStyle.requiresSummary, requiresTableHeader);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   485
                Content tbody = new HtmlTree(HtmlTag.TBODY);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   486
                addModulesList(requires, tbody);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   487
                table.addContent(tbody);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   488
                li.addContent(table);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   489
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   490
            // Display additional modules table in both "api" and "all" mode.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   491
            if (display(additionalModules)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   492
                String amrText = configuration.getText("doclet.Additional_Modules_Required_Summary");
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   493
                String amrTableSummary = configuration.getText("doclet.Member_Table_Summary",
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   494
                        configuration.getText("doclet.Additional_Modules_Required_Summary"),
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   495
                        configuration.getText("doclet.modules"));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   496
                Content amrTable = getTableHeader(amrText, amrTableSummary, HtmlStyle.requiresSummary, requiresTableHeader);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   497
                Content amrTbody = new HtmlTree(HtmlTag.TBODY);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   498
                addModulesList(additionalModules, amrTbody);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   499
                amrTable.addContent(amrTbody);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   500
                li.addContent(amrTable);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   501
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   502
            HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   503
            summaryContentTree.addContent(ul);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   504
        }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   505
    }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   506
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   507
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   508
     * Add the list of modules.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   509
     *
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   510
     * @param mdleMap map of modules and modifiers
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   511
     * @param tbody the content tree to which the list will be added
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   512
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   513
    public void addModulesList(Map<ModuleElement, Content> mdleMap, Content tbody) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   514
        boolean altColor = true;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   515
        for (ModuleElement m : mdleMap.keySet()) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   516
            Content tdModifiers = HtmlTree.TD(HtmlStyle.colFirst, mdleMap.get(m));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   517
            Content moduleLinkContent = getModuleLink(m, new StringContent(m.getQualifiedName()));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   518
            Content thModule = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colSecond, moduleLinkContent);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   519
            HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   520
            tdSummary.addStyle(HtmlStyle.colLast);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   521
            addSummaryComment(m, tdSummary);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   522
            HtmlTree tr = HtmlTree.TR(tdModifiers);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   523
            tr.addContent(thModule);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   524
            tr.addContent(tdSummary);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   525
            tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   526
            tbody.addContent(tr);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   527
            altColor = !altColor;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   528
        }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   529
    }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   530
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   531
    public void addPackagesSummary(Content summaryContentTree) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   532
        if (display(exportedPackages) || display(openedPackages) || display(concealedPackages)
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   533
                || display(additionalPackages) || display(additionalOpenPackages)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   534
            HtmlTree li = new HtmlTree(HtmlTag.LI);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   535
            li.addStyle(HtmlStyle.blockList);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   536
            addSummaryHeader(HtmlConstants.START_OF_PACKAGES_SUMMARY, SectionName.PACKAGES,
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   537
                    contents.navPackages, li);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   538
            String tableSummary = configuration.getText("doclet.Member_Table_Summary",
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   539
                    configuration.getText("doclet.Packages_Summary"),
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   540
                    configuration.getText("doclet.packages"));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   541
            if (display(exportedPackages) || display(openedPackages) || display(concealedPackages)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   542
                addPackageSummary(tableSummary, li);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   543
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   544
            if (display(additionalPackages)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   545
                String aepText = configuration.getText("doclet.Additional_Exported_Packages_Summary");
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   546
                String aepTableSummary = configuration.getText("doclet.Additional_Packages_Table_Summary",
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   547
                        configuration.getText("doclet.Additional_Exported_Packages_Summary"),
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   548
                        configuration.getText("doclet.modules"),
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   549
                        configuration.getText("doclet.packages"));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   550
                Content aepTable = getTableHeader(aepText, aepTableSummary, HtmlStyle.packagesSummary,
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   551
                        additionalPackagesTableHeader);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   552
                Content aepTbody = new HtmlTree(HtmlTag.TBODY);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   553
                addAdditionalPackages(aepTbody, additionalPackages);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   554
                aepTable.addContent(aepTbody);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   555
                li.addContent(aepTable);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   556
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   557
            if (display(additionalOpenPackages)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   558
                String aopText = configuration.getText("doclet.Additional_Opened_Packages_Summary");
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   559
                String aopTableSummary = configuration.getText("doclet.Additional_Packages_Table_Summary",
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   560
                        configuration.getText("doclet.Additional_Opened_Packages_Summary"),
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   561
                        configuration.getText("doclet.modules"),
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   562
                        configuration.getText("doclet.packages"));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   563
                Content aopTable = getTableHeader(aopText, aopTableSummary, HtmlStyle.packagesSummary,
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   564
                        additionalPackagesTableHeader);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   565
                Content aopTbody = new HtmlTree(HtmlTag.TBODY);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   566
                addAdditionalPackages(aopTbody, additionalOpenPackages);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   567
                aopTable.addContent(aopTbody);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   568
                li.addContent(aopTable);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   569
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   570
            HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   571
            summaryContentTree.addContent(ul);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   572
        }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   573
    }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   574
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   575
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   576
     * Add the package summary for the module.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   577
     *
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   578
     * @param tableSummary
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   579
     * @param li
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   580
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   581
    public void addPackageSummary(String tableSummary, HtmlTree li) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   582
        Content caption;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   583
        Content tbody = getPackageTableRows();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   584
        if (showTabs()) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   585
            caption = getTableCaption();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   586
            generateTableTabTypesScript(typeMap, modulePackageTypes, "packages");
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   587
        } else {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   588
            ModulePackageTypes type = modulePackageTypes.iterator().next();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   589
            caption = getTableCaption(configuration.getContent(type.tableTabs().resourceKey()));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   590
        }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   591
        Content table = getTableHeader(caption, tableSummary, HtmlStyle.packagesSummary, exportedPackagesTableHeader);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   592
        table.addContent(tbody);
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   593
        li.addContent(table);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   594
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   595
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   596
    /**
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   597
     * Returns true if the table tabs needs to be displayed.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   598
     *
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   599
     * @return true if the tabs should be displayed
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   600
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   601
    public boolean showTabs() {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   602
        int value;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   603
        for (ModulePackageTypes type : EnumSet.allOf(ModulePackageTypes.class)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   604
            value = type.tableTabs().value();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   605
            if ((value & packageTypesOr) == value) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   606
                modulePackageTypes.add(type);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   607
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   608
        }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   609
        boolean showTabs = modulePackageTypes.size() > 1;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   610
        if (showTabs) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   611
            modulePackageTypes.add(ModulePackageTypes.ALL);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   612
        }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   613
        return showTabs;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   614
    }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   615
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   616
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   617
     * Get the summary table caption.
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   618
     *
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   619
     * @return the caption for the summary table
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   620
     */
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   621
    public Content getTableCaption() {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   622
        Content tabbedCaption = new HtmlTree(HtmlTag.CAPTION);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   623
        for (ModulePackageTypes type : modulePackageTypes) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   624
            Content captionSpan;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   625
            Content span;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   626
            if (type.tableTabs().isDefaultTab()) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   627
                captionSpan = HtmlTree.SPAN(configuration.getContent(type.tableTabs().resourceKey()));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   628
                span = HtmlTree.SPAN(type.tableTabs().tabId(),
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   629
                        HtmlStyle.activeTableTab, captionSpan);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   630
            } else {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   631
                captionSpan = HtmlTree.SPAN(getPackageTypeLinks(type));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   632
                span = HtmlTree.SPAN(type.tableTabs().tabId(),
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   633
                        HtmlStyle.tableTab, captionSpan);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   634
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   635
            Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, Contents.SPACE);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   636
            span.addContent(tabSpan);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   637
            tabbedCaption.addContent(span);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   638
        }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   639
        return tabbedCaption;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   640
    }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   641
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   642
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   643
     * Get the package type links for the table caption.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   644
     *
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   645
     * @param packageType the package type to be displayed as link
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   646
     * @return the content tree for the package type link
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   647
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   648
    public Content getPackageTypeLinks(ModulePackageTypes packageType) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   649
        String jsShow = "javascript:showPkgs(" + packageType.tableTabs().value() + ");";
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   650
        HtmlTree link = HtmlTree.A(jsShow, configuration.getContent(packageType.tableTabs().resourceKey()));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   651
        return link;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   652
    }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   653
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   654
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   655
     * Get the package table rows.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   656
     *
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   657
     * @return a content object
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   658
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   659
    public Content getPackageTableRows() {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   660
        Content tbody = new HtmlTree(HtmlTag.TBODY);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   661
        boolean altColor = true;
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   662
        int counter = 0;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   663
        counter = addPackageTableRows(tbody, counter, ModulePackageTypes.EXPORTED, exportedPackages);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   664
        counter = addPackageTableRows(tbody, counter, ModulePackageTypes.OPENED, openedPackages);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   665
        // Show concealed packages only in "all" mode.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   666
        if (moduleMode == ModuleMode.ALL) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   667
            for (PackageElement pkg : concealedPackages) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   668
                Content pkgLinkContent = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg)));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   669
                Content thPackage = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, pkgLinkContent);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   670
                HtmlTree tdModules = new HtmlTree(HtmlTag.TD);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   671
                tdModules.addStyle(HtmlStyle.colSecond);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   672
                tdModules.addContent(configuration.getText("doclet.None"));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   673
        HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   674
        tdSummary.addStyle(HtmlStyle.colLast);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   675
                addSummaryComment(pkg, tdSummary);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   676
        HtmlTree tr = HtmlTree.TR(thPackage);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   677
                tr.addContent(tdModules);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   678
        tr.addContent(tdSummary);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   679
        tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   680
                int pkgType = ModulePackageTypes.CONCEALED.tableTabs().value();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   681
                packageTypesOr = packageTypesOr | pkgType;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   682
                String tableId = "i" + counter;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   683
                counter++;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   684
                typeMap.put(tableId, pkgType);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   685
                tr.addAttr(HtmlAttr.ID, tableId);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   686
        tbody.addContent(tr);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   687
                altColor = !altColor;
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   688
            }
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   689
        }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   690
        return tbody;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   691
    }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   692
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   693
    public int addPackageTableRows(Content tbody, int counter, ModulePackageTypes pType,
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   694
            Map<PackageElement,SortedSet<ModuleElement>> ap) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   695
        boolean altColor = true;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   696
        for (Map.Entry<PackageElement, SortedSet<ModuleElement>> entry : ap.entrySet()) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   697
            PackageElement pkg = entry.getKey();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   698
            SortedSet<ModuleElement> mdleList = entry.getValue();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   699
            Content pkgLinkContent = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg)));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   700
            Content thPackage = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, pkgLinkContent);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   701
            HtmlTree tr = HtmlTree.TR(thPackage);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   702
            if (moduleMode == ModuleMode.ALL) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   703
                HtmlTree tdModules = new HtmlTree(HtmlTag.TD);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   704
                tdModules.addStyle(HtmlStyle.colSecond);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   705
                if (!mdleList.isEmpty()) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   706
                    int sep = 0;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   707
                    for (ModuleElement m : mdleList) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   708
                        if (sep > 0) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   709
                            tdModules.addContent(new HtmlTree(HtmlTag.BR));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   710
                        }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   711
                        tdModules.addContent(getModuleLink(m, new StringContent(m.getQualifiedName())));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   712
                        sep++;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   713
                    }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   714
                } else {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   715
                    tdModules.addContent(configuration.getText("doclet.All_Modules"));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   716
                }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   717
                tr.addContent(tdModules);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   718
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   719
            HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   720
            tdSummary.addStyle(HtmlStyle.colLast);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   721
            addSummaryComment(pkg, tdSummary);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   722
            tr.addContent(tdSummary);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   723
            tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   724
            int pkgType = pType.tableTabs().value();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   725
            packageTypesOr = packageTypesOr | pkgType;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   726
            String tableId = "i" + counter;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   727
            counter++;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   728
            typeMap.put(tableId, pkgType);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   729
            tr.addAttr(HtmlAttr.ID, tableId);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   730
            tbody.addContent(tr);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   731
            altColor = !altColor;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   732
        }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   733
        return counter;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   734
    }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   735
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   736
    /**
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   737
     * Add the additional packages for the module being documented.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   738
     *
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   739
     * @param tbody the content tree to which the table will be added
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   740
     * @param ap additional packages to be added
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   741
     */
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   742
    public void addAdditionalPackages(Content tbody, Map<ModuleElement, SortedSet<PackageElement>> ap) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   743
        boolean altColor = true;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   744
        for (Map.Entry<ModuleElement, SortedSet<PackageElement>> entry : ap.entrySet()) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   745
            ModuleElement m = entry.getKey();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   746
            SortedSet<PackageElement> pkgList = entry.getValue();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   747
            Content moduleLinkContent = getModuleLink(m, new StringContent(m.getQualifiedName()));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   748
            Content thModule = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, moduleLinkContent);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   749
            HtmlTree tdPackages = new HtmlTree(HtmlTag.TD);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   750
            tdPackages.addStyle(HtmlStyle.colLast);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   751
            String sep = "";
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   752
            for (PackageElement pkg : pkgList) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   753
                tdPackages.addContent(sep);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   754
                tdPackages.addContent(getPackageLink(pkg, new StringContent(utils.getPackageName(pkg))));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   755
                sep = " ";
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   756
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   757
            HtmlTree tr = HtmlTree.TR(thModule);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   758
            tr.addContent(tdPackages);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   759
            tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   760
            tbody.addContent(tr);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   761
            altColor = !altColor;
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   762
        }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   763
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   764
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   765
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   766
     * {@inheritDoc}
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   767
     */
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   768
    public void addServicesSummary(Content summaryContentTree) {
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   769
        if (display(uses) || display(provides)) {
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   770
            HtmlTree li = new HtmlTree(HtmlTag.LI);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   771
            li.addStyle(HtmlStyle.blockList);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   772
            addSummaryHeader(HtmlConstants.START_OF_SERVICES_SUMMARY, SectionName.SERVICES,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   773
                    contents.navServices, li);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   774
            String text;
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   775
            String tableSummary;
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   776
            if (display(uses)) {
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   777
                text = configuration.getText("doclet.Uses_Summary");
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   778
                tableSummary = configuration.getText("doclet.Member_Table_Summary",
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   779
                        configuration.getText("doclet.Uses_Summary"),
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   780
                        configuration.getText("doclet.types"));
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   781
                Content table = getTableHeader(text, tableSummary, HtmlStyle.usesSummary, usesTableHeader);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   782
                Content tbody = new HtmlTree(HtmlTag.TBODY);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   783
                addUsesList(tbody);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   784
                if (!tbody.isEmpty()) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   785
                    table.addContent(tbody);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   786
                    li.addContent(table);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   787
            }
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   788
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   789
            if (display(provides)) {
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   790
                text = configuration.getText("doclet.Provides_Summary");
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   791
                tableSummary = configuration.getText("doclet.Member_Table_Summary",
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   792
                        configuration.getText("doclet.Provides_Summary"),
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   793
                        configuration.getText("doclet.types"));
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   794
                Content table = getTableHeader(text, tableSummary, HtmlStyle.providesSummary, providesTableHeader);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   795
                Content tbody = new HtmlTree(HtmlTag.TBODY);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   796
                addProvidesList(tbody);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   797
                if (!tbody.isEmpty()) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   798
                    table.addContent(tbody);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   799
                    li.addContent(table);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   800
                }
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   801
            }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   802
            HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   803
            summaryContentTree.addContent(ul);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   804
        }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   805
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   806
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   807
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   808
     * Add the uses list for the module.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   809
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   810
     * @param tbody the content tree to which the directive will be added
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   811
     */
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   812
    public void addUsesList(Content tbody) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   813
        boolean altColor = true;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   814
        Content typeLinkContent;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   815
        Content thType;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   816
        HtmlTree tdSummary;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   817
        Content description;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   818
        for (TypeElement t : uses) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   819
            // For each uses directive in the module declaration, if we are in the "api" mode and
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   820
            // if there are service types listed using @uses javadoc tag, check if the service type in
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   821
            // the uses directive is specified using the @uses tag. If not, we do not display the
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   822
            // service type in the "api" mode.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   823
            if (moduleMode == ModuleMode.API && display(usesTrees) && !usesTrees.containsKey(t)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   824
                continue;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   825
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   826
            typeLinkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE, t));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   827
            thType = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, typeLinkContent);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   828
            tdSummary = new HtmlTree(HtmlTag.TD);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   829
        tdSummary.addStyle(HtmlStyle.colLast);
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   830
            if (display(usesTrees)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   831
                description = usesTrees.get(t);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   832
                if (description != null) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   833
                    tdSummary.addContent(description);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   834
                }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   835
            }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   836
            addSummaryComment(t, tdSummary);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   837
            HtmlTree tr = HtmlTree.TR(thType);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   838
        tr.addContent(tdSummary);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   839
        tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   840
        tbody.addContent(tr);
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   841
            altColor = !altColor;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   842
        }
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   843
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   844
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   845
    /**
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   846
     * Add the provides list for the module.
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   847
     *
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   848
     * @param tbody the content tree to which the directive will be added
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   849
     */
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   850
    public void addProvidesList(Content tbody) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   851
        boolean altColor = true;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   852
        TypeElement srv;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   853
        SortedSet<TypeElement> implSet;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   854
        Content description;
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   855
        for (Map.Entry<TypeElement, SortedSet<TypeElement>> entry : provides.entrySet()) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   856
            srv = entry.getKey();
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   857
            // For each provides directive in the module declaration, if we are in the "api" mode and
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   858
            // if there are service types listed using @provides javadoc tag, check if the service type in
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   859
            // the provides directive is specified using the @provides tag. If not, we do not display the
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   860
            // service type in the "api" mode.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   861
            if (moduleMode == ModuleMode.API && display(providesTrees) && !providesTrees.containsKey(srv)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   862
                continue;
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   863
    }
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   864
            implSet = entry.getValue();
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   865
            Content srvLinkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE, srv));
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   866
            HtmlTree thType = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, srvLinkContent);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   867
            HtmlTree tdDesc = new HtmlTree(HtmlTag.TD);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   868
            tdDesc.addStyle(HtmlStyle.colLast);
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   869
            if (display(providesTrees)) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   870
                description = providesTrees.get(srv);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   871
                if (description != null) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   872
                    tdDesc.addContent(description);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   873
                }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   874
            }
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   875
            addSummaryComment(srv, tdDesc);
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   876
            // Only display the implementation details in the "all" mode.
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   877
            if (moduleMode == ModuleMode.ALL && !implSet.isEmpty()) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   878
                tdDesc.addContent(new HtmlTree(HtmlTag.BR));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   879
                tdDesc.addContent("(");
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   880
                HtmlTree implSpan = HtmlTree.SPAN(HtmlStyle.implementationLabel, contents.implementation);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   881
                tdDesc.addContent(implSpan);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   882
                tdDesc.addContent(Contents.SPACE);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   883
                String sep = "";
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   884
                for (TypeElement impl : implSet) {
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   885
                    tdDesc.addContent(sep);
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   886
                    tdDesc.addContent(getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE, impl)));
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   887
                    sep = ", ";
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   888
                }
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   889
                tdDesc.addContent(")");
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   890
            }
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   891
            HtmlTree tr = HtmlTree.TR(thType);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   892
            tr.addContent(tdDesc);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   893
            tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   894
            tbody.addContent(tr);
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   895
            altColor = !altColor;
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   896
        }
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   897
    }
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   898
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   899
    /**
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   900
     * Add the module deprecation information to the documentation tree.
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   901
     *
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   902
     * @param div the content tree to which the deprecation information will be added
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   903
     */
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   904
    public void addDeprecationInfo(Content div) {
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   905
        List<? extends DocTree> deprs = utils.getBlockTags(mdle, DocTree.Kind.DEPRECATED);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   906
        if (utils.isDeprecated(mdle)) {
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   907
            CommentHelper ch = utils.getCommentHelper(mdle);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   908
            HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   909
            deprDiv.addStyle(HtmlStyle.deprecatedContent);
42816
3638773ff1b0 8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents: 42407
diff changeset
   910
            Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(mdle));
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   911
            deprDiv.addContent(deprPhrase);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   912
            if (!deprs.isEmpty()) {
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   913
                List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0));
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   914
                if (!commentTags.isEmpty()) {
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   915
                    addInlineDeprecatedComment(mdle, deprs.get(0), deprDiv);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   916
                }
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   917
            }
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   918
            div.addContent(deprDiv);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   919
        }
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   920
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   921
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   922
    /**
37747
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   923
     * {@inheritDoc}
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   924
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   925
    @Override
37747
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   926
    public void addModuleDescription(Content moduleContentTree) {
41452
ddaef4bba083 8165991: Fix DocTreeFactory newDocCommentTree
ksrini
parents: 41157
diff changeset
   927
        if (!utils.getFullBody(mdle).isEmpty()) {
37747
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   928
            Content tree = configuration.allowTag(HtmlTag.SECTION) ? HtmlTree.SECTION() : moduleContentTree;
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   929
            addDeprecationInfo(tree);
37747
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   930
            tree.addContent(HtmlConstants.START_OF_MODULE_DESCRIPTION);
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   931
            tree.addContent(getMarkerAnchor(SectionName.MODULE_DESCRIPTION));
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   932
            addInlineComment(mdle, tree);
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   933
            if (configuration.allowTag(HtmlTag.SECTION)) {
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   934
                moduleContentTree.addContent(tree);
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   935
            }
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   936
        }
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   937
    }
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   938
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   939
    /**
38911
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   940
     * {@inheritDoc}
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   941
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   942
    @Override
38911
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   943
    public void addModuleTags(Content moduleContentTree) {
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   944
        Content tree = (configuration.allowTag(HtmlTag.SECTION))
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   945
                ? HtmlTree.SECTION()
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   946
                : moduleContentTree;
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   947
        addTagsInfo(mdle, tree);
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   948
        if (configuration.allowTag(HtmlTag.SECTION)) {
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   949
            moduleContentTree.addContent(tree);
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   950
        }
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   951
    }
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   952
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   953
    /**
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   954
     * Add summary details to the navigation bar.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   955
     *
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   956
     * @param subDiv the content tree to which the summary detail links will be added
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   957
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   958
    @Override
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   959
    protected void addSummaryDetailLinks(Content subDiv) {
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   960
        Content div = HtmlTree.DIV(getNavSummaryLinks());
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   961
        subDiv.addContent(div);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   962
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   963
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   964
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   965
     * Get summary links for navigation bar.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   966
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   967
     * @return the content tree for the navigation summary links
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   968
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   969
    protected Content getNavSummaryLinks() {
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   970
        Content li = HtmlTree.LI(contents.moduleSubNavLabel);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   971
        li.addContent(Contents.SPACE);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   972
        Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   973
        Content liNav = new HtmlTree(HtmlTag.LI);
41452
ddaef4bba083 8165991: Fix DocTreeFactory newDocCommentTree
ksrini
parents: 41157
diff changeset
   974
        liNav.addContent(!utils.getFullBody(mdle).isEmpty() && !configuration.nocomment
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   975
                ? getHyperLink(SectionName.MODULE_DESCRIPTION, contents.navModuleDescription)
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   976
                : contents.navModuleDescription);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   977
        addNavGap(liNav);
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   978
        liNav.addContent((display(requires) || display(additionalModules))
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   979
                ? getHyperLink(SectionName.MODULES, contents.navModules)
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   980
                : contents.navModules);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   981
        addNavGap(liNav);
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   982
        liNav.addContent((display(exportedPackages) || display(openedPackages) || display(concealedPackages)
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   983
                || display(additionalPackages) || display(additionalOpenPackages))
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   984
                ? getHyperLink(SectionName.PACKAGES, contents.navPackages)
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   985
                : contents.navPackages);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   986
        addNavGap(liNav);
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   987
        liNav.addContent((display(uses) || (moduleMode == ModuleMode.API && display(usesTrees))
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
   988
                || display(provides) || (moduleMode == ModuleMode.API && display(providesTrees)))
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   989
                ? getHyperLink(SectionName.SERVICES, contents.navServices)
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   990
                : contents.navServices);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   991
        ulNav.addContent(liNav);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   992
        return ulNav;
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   993
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   994
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   995
    /**
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   996
     * {@inheritDoc}
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   997
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   998
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   999
    public void addModuleContent(Content contentTree, Content moduleContentTree) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1000
        if (configuration.allowTag(HtmlTag.MAIN)) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1001
            mainTree.addContent(moduleContentTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1002
            contentTree.addContent(mainTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1003
        } else {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1004
            contentTree.addContent(moduleContentTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1005
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1006
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1007
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1008
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1009
     * {@inheritDoc}
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1010
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
  1011
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1012
    public void addModuleFooter(Content contentTree) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1013
        Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1014
                ? HtmlTree.FOOTER()
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1015
                : contentTree;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1016
        addNavLinks(false, htmlTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1017
        addBottom(htmlTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1018
        if (configuration.allowTag(HtmlTag.FOOTER)) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1019
            contentTree.addContent(htmlTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1020
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1021
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1022
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1023
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1024
     * {@inheritDoc}
42831
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
  1025
     *
feff6f296019 8160196: Module summary page should display information based on "api" or "detail" mode.
bpatel
parents: 42816
diff changeset
  1026
     * @throws jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1027
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
  1028
    @Override
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
  1029
    public void printDocument(Content contentTree) throws DocFileIOException {
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1030
        printHtmlDocument(configuration.metakeywords.getMetaKeywordsForModule(mdle),
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1031
                true, contentTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1032
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1033
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1034
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1035
     * Add the module package deprecation information to the documentation tree.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1036
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1037
     * @param li the content tree to which the deprecation information will be added
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1038
     * @param pkg the PackageDoc that is added
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1039
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1040
    public void addPackageDeprecationInfo(Content li, PackageElement pkg) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1041
        List<? extends DocTree> deprs;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1042
        if (utils.isDeprecated(pkg)) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1043
            deprs = utils.getDeprecatedTrees(pkg);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1044
            HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1045
            deprDiv.addStyle(HtmlStyle.deprecatedContent);
42816
3638773ff1b0 8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents: 42407
diff changeset
  1046
            Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(pkg));
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1047
            deprDiv.addContent(deprPhrase);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1048
            if (!deprs.isEmpty()) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1049
                CommentHelper ch = utils.getCommentHelper(pkg);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1050
                List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0));
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1051
                if (!commentTags.isEmpty()) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1052
                    addInlineDeprecatedComment(pkg, deprs.get(0), deprDiv);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1053
                }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1054
            }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1055
            li.addContent(deprDiv);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1056
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1057
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1058
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1059
    /**
37943
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 37747
diff changeset
  1060
     * Get this module link.
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 37747
diff changeset
  1061
     *
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 37747
diff changeset
  1062
     * @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: 37747
diff changeset
  1063
     */
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 37747
diff changeset
  1064
    @Override
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 37747
diff changeset
  1065
    protected Content getNavLinkModule() {
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
  1066
        Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.moduleLabel);
37943
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 37747
diff changeset
  1067
        return li;
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 37747
diff changeset
  1068
    }
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 37747
diff changeset
  1069
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 37747
diff changeset
  1070
    /**
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1071
     * Get "PREV MODULE" link in the navigation bar.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1072
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1073
     * @return a content tree for the previous link
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1074
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
  1075
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1076
    public Content getNavLinkPrevious() {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1077
        Content li;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1078
        if (prevModule == null) {
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
  1079
            li = HtmlTree.LI(contents.prevModuleLabel);
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1080
        } else {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1081
            li = HtmlTree.LI(getHyperLink(pathToRoot.resolve(DocPaths.moduleSummary(
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
  1082
                    prevModule)), contents.prevModuleLabel, "", ""));
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1083
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1084
        return li;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1085
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1086
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1087
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1088
     * Get "NEXT MODULE" link in the navigation bar.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1089
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1090
     * @return a content tree for the next link
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1091
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
  1092
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1093
    public Content getNavLinkNext() {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1094
        Content li;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1095
        if (nextModule == null) {
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
  1096
            li = HtmlTree.LI(contents.nextModuleLabel);
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1097
        } else {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1098
            li = HtmlTree.LI(getHyperLink(pathToRoot.resolve(DocPaths.moduleSummary(
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
  1099
                    nextModule)), contents.nextModuleLabel, "", ""));
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1100
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1101
        return li;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1102
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
  1103
}