langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java
author alanb
Thu, 01 Dec 2016 09:02:42 +0000
changeset 42407 f3702cff2933
parent 41452 ddaef4bba083
child 42816 3638773ff1b0
permissions -rw-r--r--
8169069: Module system implementation refresh (11/2016) Reviewed-by: mcimadamore, jjg, mchung, anazarov Contributed-by: jonathan.gibbons@oracle.com, jan.lahoda@oracle.com, alan.bateman@oracle.com, mandy.chung@oracle.com, bhavesh.x.patel@oracle.com, andrey.x.nazarov@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     1
/*
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     2
 * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
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
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
    28
import java.util.ArrayList;
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
    29
import java.util.EnumMap;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    30
import java.util.List;
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
    31
import java.util.Map;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    32
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    33
import javax.lang.model.element.ModuleElement;
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
    34
import javax.lang.model.element.ModuleElement.DirectiveKind;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    35
import javax.lang.model.element.PackageElement;
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
    36
import javax.lang.model.element.TypeElement;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    37
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    38
import com.sun.source.doctree.DocTree;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    39
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    40
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    41
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    42
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    43
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
    44
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    45
import jdk.javadoc.internal.doclets.toolkit.Content;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    46
import jdk.javadoc.internal.doclets.toolkit.ModuleSummaryWriter;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    47
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    48
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    49
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    50
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    51
/**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    52
 * Class to generate file for each module contents in the right-hand
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    53
 * frame. This will list all the packages and Class Kinds in the module. A click on any
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    54
 * class-kind will update the frame with the clicked class-kind page. A click on any
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    55
 * package will update the frame with the clicked module package page.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    56
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    57
 *  <p><b>This is NOT part of any supported API.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    58
 *  If you write code that depends on this, you do so at your own risk.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    59
 *  This code and its internal interfaces are subject to change or
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    60
 *  deletion without notice.</b>
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    61
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    62
 * @author Bhavesh Patel
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    63
 */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    64
public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryWriter {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    65
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    66
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    67
     * The prev module name in the alpha-order list.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    68
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    69
    protected ModuleElement prevModule;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    70
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    71
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    72
     * The next module name in the alpha-order list.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    73
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    74
    protected ModuleElement nextModule;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    75
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    76
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    77
     * The module being documented.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    78
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    79
    protected ModuleElement mdle;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    80
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
    81
    private final Map<ModuleElement.DirectiveKind, List<ModuleElement.Directive>> directiveMap
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
    82
            = new EnumMap<>(ModuleElement.DirectiveKind.class);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
    83
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    84
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    85
     * The HTML tree for main tag.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    86
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    87
    protected HtmlTree mainTree = HtmlTree.MAIN();
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    88
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    89
    /**
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
    90
     * The HTML tree for section tag.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
    91
     */
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
    92
    protected HtmlTree sectionTree = HtmlTree.SECTION();
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
    93
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
    94
    /**
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    95
     * Constructor to construct ModuleWriter object and to generate
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    96
     * "moduleName-summary.html" file.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    97
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    98
     * @param configuration the configuration of the doclet.
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
    99
     * @param mdle        Module under consideration.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   100
     * @param prevModule   Previous module in the sorted array.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   101
     * @param nextModule   Next module in the sorted array.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   102
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   103
    public ModuleWriterImpl(ConfigurationImpl configuration,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   104
            ModuleElement mdle, ModuleElement prevModule, ModuleElement nextModule) {
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   105
        super(configuration, DocPaths.moduleSummary(mdle));
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   106
        this.prevModule = prevModule;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   107
        this.nextModule = nextModule;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   108
        this.mdle = mdle;
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   109
        generateDirectiveMap();
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   110
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   111
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   112
    /**
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   113
     * Get the module header.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   114
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   115
     * @param heading the heading for the section
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   116
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   117
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   118
    public Content getModuleHeader(String heading) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   119
        HtmlTree bodyTree = getBody(true, getWindowTitle(mdle.getQualifiedName().toString()));
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   120
        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   121
                ? HtmlTree.HEADER()
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   122
                : bodyTree;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   123
        addTop(htmlTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   124
        addNavLinks(true, htmlTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   125
        if (configuration.allowTag(HtmlTag.HEADER)) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   126
            bodyTree.addContent(htmlTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   127
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   128
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   129
        div.addStyle(HtmlStyle.header);
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   130
        Content annotationContent = new HtmlTree(HtmlTag.P);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   131
        addAnnotationInfo(mdle, annotationContent);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   132
        div.addContent(annotationContent);
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   133
        Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   134
                HtmlStyle.title, contents.moduleLabel);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   135
        tHeading.addContent(Contents.SPACE);
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   136
        Content moduleHead = new RawHtml(heading);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   137
        tHeading.addContent(moduleHead);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   138
        div.addContent(tHeading);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   139
        if (configuration.allowTag(HtmlTag.MAIN)) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   140
            mainTree.addContent(div);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   141
        } else {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   142
            bodyTree.addContent(div);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   143
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   144
        return bodyTree;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   145
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   146
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   147
    /**
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   148
     * Get the content header.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   149
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   150
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   151
    public Content getContentHeader() {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   152
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   153
        div.addStyle(HtmlStyle.contentContainer);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   154
        return div;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   155
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   156
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   157
    /**
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   158
     * Get the summary section header.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   159
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   160
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   161
    public Content getSummaryHeader() {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   162
        HtmlTree li = new HtmlTree(HtmlTag.LI);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   163
        li.addStyle(HtmlStyle.blockList);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   164
        return li;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   165
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   166
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   167
    /**
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   168
     * Get the summary tree.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   169
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   170
     * @param summaryContentTree the content tree to be added to the summary tree.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   171
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   172
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   173
    public Content getSummaryTree(Content summaryContentTree) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   174
        HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, summaryContentTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   175
        return ul;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   176
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   177
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   178
    /**
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   179
     * Generate the directive map for the directives on the module.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   180
     */
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   181
    public void generateDirectiveMap() {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   182
        for (ModuleElement.Directive d : mdle.getDirectives()) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   183
            if (directiveMap.containsKey(d.getKind())) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   184
                List<ModuleElement.Directive> dir = directiveMap.get(d.getKind());
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   185
                dir.add(d);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   186
                directiveMap.put(d.getKind(), dir);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   187
            } else {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   188
                List<ModuleElement.Directive> dir = new ArrayList<>();
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   189
                dir.add(d);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   190
                directiveMap.put(d.getKind(), dir);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   191
            }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   192
        }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   193
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   194
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   195
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   196
     * Add the summary header.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   197
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   198
     * @param startMarker the marker comment
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   199
     * @param markerAnchor the marker anchor for the section
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   200
     * @param heading the heading for the section
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   201
     * @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
   202
     */
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   203
    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
   204
        htmltree.addContent(startMarker);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   205
        htmltree.addContent(getMarkerAnchor(markerAnchor));
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   206
        htmltree.addContent(HtmlTree.HEADING(HtmlTag.H3, heading));
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   207
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   208
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   209
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   210
     * Add the summary for the module.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   211
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   212
     * @param text the table caption
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   213
     * @param tableSummary the summary for the table
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   214
     * @param htmltree the content tree to which the table will be added
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   215
     * @param tableStyle the table style
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   216
     * @param tableHeader the table header
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   217
     * @param dirs the list of module directives
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   218
     */
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   219
    public void addSummary(String text, String tableSummary, Content htmltree, HtmlStyle tableStyle,
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   220
            List<String> tableHeader, List<ModuleElement.Directive> dirs) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   221
        Content table = (configuration.isOutputHtml5())
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   222
                ? HtmlTree.TABLE(tableStyle, getTableCaption(new RawHtml(text)))
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   223
                : HtmlTree.TABLE(tableStyle, tableSummary, getTableCaption(new RawHtml(text)));
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   224
        table.addContent(getSummaryTableHeader(tableHeader, "col"));
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   225
        Content tbody = new HtmlTree(HtmlTag.TBODY);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   226
        addList(dirs, tbody);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   227
        table.addContent(tbody);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   228
        htmltree.addContent(table);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   229
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   230
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   231
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   232
     * Add the list of directives for the module.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   233
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   234
     * @param dirs the list of module directives
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   235
     * @param tbody the content tree to which the list is added
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   236
     */
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   237
    public void addList(List<ModuleElement.Directive> dirs, Content tbody) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   238
        boolean altColor = true;
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   239
        for (ModuleElement.Directive direct : dirs) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   240
            DirectiveKind kind = direct.getKind();
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   241
            switch (kind) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   242
                case REQUIRES:
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   243
                    addRequiresList((ModuleElement.RequiresDirective) direct, tbody, altColor);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   244
                    break;
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   245
                case EXPORTS:
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   246
                    addExportedPackagesList((ModuleElement.ExportsDirective) direct, tbody, altColor);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   247
                    break;
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   248
                case OPENS:
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   249
                    //XXX ignore for now
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   250
                    break;
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   251
                case USES:
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   252
                    addUsesList((ModuleElement.UsesDirective) direct, tbody, altColor);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   253
                    break;
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   254
                case PROVIDES:
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   255
                    addProvidesList((ModuleElement.ProvidesDirective) direct, tbody, altColor);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   256
                    break;
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   257
                default:
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   258
                    throw new AssertionError("unknown directive kind: " + kind);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   259
            }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   260
            altColor = !altColor;
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   261
        }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   262
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   263
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   264
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   265
     * {@inheritDoc}
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   266
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   267
    @Override
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   268
    public void addModulesSummary(Content summaryContentTree) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   269
        List<ModuleElement.Directive> dirs = directiveMap.get(DirectiveKind.REQUIRES);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   270
        if (dirs != null && !dirs.isEmpty()) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   271
            HtmlTree li = new HtmlTree(HtmlTag.LI);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   272
            li.addStyle(HtmlStyle.blockList);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   273
            addSummaryHeader(HtmlConstants.START_OF_MODULES_SUMMARY, SectionName.MODULES,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   274
                    contents.navModules, li);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   275
            String text = configuration.getText("doclet.Requires_Summary");
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   276
            String tableSummary = configuration.getText("doclet.Member_Table_Summary",
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   277
                    configuration.getText("doclet.Requires_Summary"),
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   278
                    configuration.getText("doclet.modules"));
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   279
            addRequiresSummary(text, tableSummary, dirs, li);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   280
            HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   281
            summaryContentTree.addContent(ul);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   282
        }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   283
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   284
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   285
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   286
     * Add the requires summary for the module.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   287
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   288
     * @param text the table caption
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   289
     * @param tableSummary the summary for the table
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   290
     * @param dirs the list of module directives
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   291
     * @param htmltree the content tree to which the table will be added
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   292
     */
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   293
    public void addRequiresSummary(String text, String tableSummary, List<ModuleElement.Directive> dirs,
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   294
            Content htmltree) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   295
        addSummary(text, tableSummary, htmltree, HtmlStyle.requiresSummary, requiresTableHeader, dirs);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   296
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   297
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   298
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   299
     * Add the requires directive list for the module.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   300
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   301
     * @param direct the requires directive
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   302
     * @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
   303
     * @param altColor true if altColor style should be used or false if rowColor style should be used
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   304
     */
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   305
    public void addRequiresList(ModuleElement.RequiresDirective direct, Content tbody, boolean altColor) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   306
        ModuleElement m = direct.getDependency();
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   307
        Content moduleLinkContent = getModuleLink(m, new StringContent(m.getQualifiedName().toString()));
41157
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   308
        Content thPackage = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, moduleLinkContent);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   309
        HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   310
        tdSummary.addStyle(HtmlStyle.colLast);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   311
        addSummaryComment(m, tdSummary);
41157
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   312
        HtmlTree tr = HtmlTree.TR(thPackage);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   313
        tr.addContent(tdSummary);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   314
        tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   315
        tbody.addContent(tr);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   316
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   317
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   318
    /**
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   319
     * {@inheritDoc}
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   320
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   321
    @Override
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   322
    public void addPackagesSummary(Content summaryContentTree) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   323
        List<ModuleElement.Directive> dirs = directiveMap.get(DirectiveKind.EXPORTS);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   324
        if (dirs != null && !dirs.isEmpty()) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   325
            HtmlTree li = new HtmlTree(HtmlTag.LI);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   326
            li.addStyle(HtmlStyle.blockList);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   327
            addSummaryHeader(HtmlConstants.START_OF_PACKAGES_SUMMARY, SectionName.PACKAGES,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   328
                    contents.navPackages, li);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   329
            String text = configuration.getText("doclet.Exported_Packages_Summary");
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   330
            String tableSummary = configuration.getText("doclet.Member_Table_Summary",
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   331
                    configuration.getText("doclet.Exported_Packages_Summary"),
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   332
                    configuration.getText("doclet.packages"));
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   333
            addExportedPackagesSummary(text, tableSummary, dirs, li);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   334
            HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   335
            summaryContentTree.addContent(ul);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   336
        }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   337
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   338
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   339
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   340
     * Add the exported packages summary for the module.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   341
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   342
     * @param text the table caption
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   343
     * @param tableSummary the summary for the table
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   344
     * @param dirs the list of module directives
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   345
     * @param htmltree the content tree to which the table will be added
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   346
     */
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   347
    public void addExportedPackagesSummary(String text, String tableSummary, List<ModuleElement.Directive> dirs,
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   348
            Content htmltree) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   349
        addSummary(text, tableSummary, htmltree, HtmlStyle.packagesSummary, exportedPackagesTableHeader, dirs);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   350
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   351
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   352
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   353
     * Add the exported packages list for the module.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   354
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   355
     * @param direct the requires directive
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   356
     * @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
   357
     * @param altColor true if altColor style should be used or false if rowColor style should be used
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   358
     */
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   359
    public void addExportedPackagesList(ModuleElement.ExportsDirective direct, Content tbody, boolean altColor) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   360
        PackageElement pkg = direct.getPackage();
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   361
        Content pkgLinkContent = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg)));
41157
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   362
        Content tdPackage = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, pkgLinkContent);
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   363
        HtmlTree thModules = new HtmlTree(HtmlTag.TD);
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   364
        thModules.addStyle(HtmlStyle.colSecond);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   365
        List<? extends ModuleElement> targetModules = direct.getTargetModules();
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   366
        if (targetModules != null) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   367
            List<? extends ModuleElement> mElements = direct.getTargetModules();
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   368
            for (int i = 0; i < mElements.size(); i++) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   369
                if (i > 0) {
41157
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   370
                    thModules.addContent(new HtmlTree(HtmlTag.BR));
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   371
                }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   372
                ModuleElement m = mElements.get(i);
41157
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   373
                thModules.addContent(new StringContent(m.getQualifiedName().toString()));
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   374
            }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   375
        } else {
41157
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   376
            thModules.addContent(configuration.getText("doclet.All_Modules"));
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   377
        }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   378
        HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   379
        tdSummary.addStyle(HtmlStyle.colLast);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   380
        addSummaryComment(pkg, tdSummary);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   381
        HtmlTree tr = HtmlTree.TR(tdPackage);
41157
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   382
        tr.addContent(thModules);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   383
        tr.addContent(tdSummary);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   384
        tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   385
        tbody.addContent(tr);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   386
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   387
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   388
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   389
     * {@inheritDoc}
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   390
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   391
    @Override
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   392
    public void addServicesSummary(Content summaryContentTree) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   393
        List<ModuleElement.Directive> usesDirs = directiveMap.get(DirectiveKind.USES);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   394
        List<ModuleElement.Directive> providesDirs = directiveMap.get(DirectiveKind.PROVIDES);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   395
        if ((usesDirs != null && !usesDirs.isEmpty()) || (providesDirs != null && !providesDirs.isEmpty())) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   396
            HtmlTree li = new HtmlTree(HtmlTag.LI);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   397
            li.addStyle(HtmlStyle.blockList);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   398
            addSummaryHeader(HtmlConstants.START_OF_SERVICES_SUMMARY, SectionName.SERVICES,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   399
                    contents.navServices, li);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   400
            String text;
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   401
            String tableSummary;
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   402
            if (usesDirs != null && !usesDirs.isEmpty()) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   403
                text = configuration.getText("doclet.Uses_Summary");
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   404
                tableSummary = configuration.getText("doclet.Member_Table_Summary",
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   405
                        configuration.getText("doclet.Uses_Summary"),
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   406
                        configuration.getText("doclet.types"));
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   407
                addUsesSummary(text, tableSummary, usesDirs, li);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   408
            }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   409
            if (providesDirs != null && !providesDirs.isEmpty()) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   410
                text = configuration.getText("doclet.Provides_Summary");
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   411
                tableSummary = configuration.getText("doclet.Member_Table_Summary",
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   412
                        configuration.getText("doclet.Provides_Summary"),
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   413
                        configuration.getText("doclet.types"));
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   414
                addProvidesSummary(text, tableSummary, providesDirs, li);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   415
            }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   416
            HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   417
            summaryContentTree.addContent(ul);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   418
        }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   419
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   420
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   421
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   422
     * Add the uses summary for the module.
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
     * @param text the table caption
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   425
     * @param tableSummary the summary for the table
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   426
     * @param dirs the list of module directives
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   427
     * @param htmltree the content tree to which the table will be added
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   428
     */
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   429
    public void addUsesSummary(String text, String tableSummary, List<ModuleElement.Directive> dirs,
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   430
            Content htmltree) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   431
        addSummary(text, tableSummary, htmltree, HtmlStyle.usesSummary, usesTableHeader, dirs);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   432
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   433
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   434
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   435
     * Add the uses list for the module.
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
     * @param direct the requires directive
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   438
     * @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
   439
     * @param altColor true if altColor style should be used or false if rowColor style should be used
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
    public void addUsesList(ModuleElement.UsesDirective direct, Content tbody, boolean altColor) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   442
        TypeElement type = direct.getService();
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   443
        Content typeLinkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE, type));
41157
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   444
        Content thPackage = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, typeLinkContent);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   445
        HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   446
        tdSummary.addStyle(HtmlStyle.colLast);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   447
        addSummaryComment(type, tdSummary);
41157
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 40587
diff changeset
   448
        HtmlTree tr = HtmlTree.TR(thPackage);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   449
        tr.addContent(tdSummary);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   450
        tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   451
        tbody.addContent(tr);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   452
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   453
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   454
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   455
     * Add the provides summary for the module.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   456
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   457
     * @param text the table caption
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   458
     * @param tableSummary the summary for the table
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   459
     * @param dirs the list of module directives
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   460
     * @param htmltree the content tree to which the table will be added
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   461
     */
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   462
    public void addProvidesSummary(String text, String tableSummary, List<ModuleElement.Directive> dirs,
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   463
            Content htmltree) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   464
        addSummary(text, tableSummary, htmltree, HtmlStyle.providesSummary, providesTableHeader, dirs);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   465
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   466
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   467
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   468
     * Add the exported packages list for the module.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   469
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   470
     * @param direct the requires directive
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   471
     * @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
   472
     * @param altColor true if altColor style should be used or false if rowColor style should be used
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   473
     */
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   474
    public void addProvidesList(ModuleElement.ProvidesDirective direct, Content tbody, boolean altColor) {
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   475
        List<? extends TypeElement> impls = direct.getImplementations();
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   476
        for (TypeElement impl : impls) {
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   477
            TypeElement srv = direct.getService();
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   478
            Content implLinkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE, impl));
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   479
            Content srvLinkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE, srv));
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   480
            HtmlTree thType = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, srvLinkContent);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   481
            thType.addContent(new HtmlTree(HtmlTag.BR));
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   482
            thType.addContent("(");
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   483
            HtmlTree implSpan = HtmlTree.SPAN(HtmlStyle.implementationLabel, contents.implementation);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   484
            thType.addContent(implSpan);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   485
            thType.addContent(Contents.SPACE);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   486
            thType.addContent(implLinkContent);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   487
            thType.addContent(")");
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   488
            HtmlTree tdDesc = new HtmlTree(HtmlTag.TD);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   489
            tdDesc.addStyle(HtmlStyle.colLast);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   490
            addSummaryComment(srv, tdDesc);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   491
            HtmlTree tr = HtmlTree.TR(thType);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   492
            tr.addContent(tdDesc);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   493
            tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   494
            tbody.addContent(tr);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   495
        }
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   496
    }
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   497
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   498
    /**
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   499
     * Add the module deprecation information to the documentation tree.
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   500
     *
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   501
     * @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
   502
     */
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   503
    public void addDeprecationInfo(Content div) {
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   504
        List<? extends DocTree> deprs = utils.getBlockTags(mdle, DocTree.Kind.DEPRECATED);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   505
        if (utils.isDeprecated(mdle)) {
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   506
            CommentHelper ch = utils.getCommentHelper(mdle);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   507
            HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   508
            deprDiv.addStyle(HtmlStyle.deprecatedContent);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   509
            Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, contents.deprecatedPhrase);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   510
            deprDiv.addContent(deprPhrase);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   511
            if (!deprs.isEmpty()) {
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   512
                List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0));
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   513
                if (!commentTags.isEmpty()) {
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   514
                    addInlineDeprecatedComment(mdle, deprs.get(0), deprDiv);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   515
                }
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   516
            }
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   517
            div.addContent(deprDiv);
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   518
        }
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   519
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   520
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   521
    /**
37747
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   522
     * {@inheritDoc}
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   523
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   524
    @Override
37747
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   525
    public void addModuleDescription(Content moduleContentTree) {
41452
ddaef4bba083 8165991: Fix DocTreeFactory newDocCommentTree
ksrini
parents: 41157
diff changeset
   526
        if (!utils.getFullBody(mdle).isEmpty()) {
37747
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   527
            Content tree = configuration.allowTag(HtmlTag.SECTION) ? HtmlTree.SECTION() : moduleContentTree;
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   528
            addDeprecationInfo(tree);
37747
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   529
            tree.addContent(HtmlConstants.START_OF_MODULE_DESCRIPTION);
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   530
            tree.addContent(getMarkerAnchor(SectionName.MODULE_DESCRIPTION));
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   531
            addInlineComment(mdle, tree);
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   532
            if (configuration.allowTag(HtmlTag.SECTION)) {
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   533
                moduleContentTree.addContent(tree);
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   534
            }
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   535
        }
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   536
    }
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   537
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
   538
    /**
38911
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   539
     * {@inheritDoc}
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   540
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   541
    @Override
38911
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   542
    public void addModuleTags(Content moduleContentTree) {
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   543
        Content tree = (configuration.allowTag(HtmlTag.SECTION))
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   544
                ? HtmlTree.SECTION()
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   545
                : moduleContentTree;
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   546
        addTagsInfo(mdle, tree);
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   547
        if (configuration.allowTag(HtmlTag.SECTION)) {
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   548
            moduleContentTree.addContent(tree);
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   549
        }
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   550
    }
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   551
48a00b5ee366 8156077: Support javadoc tags in module documentation
bpatel
parents: 37943
diff changeset
   552
    /**
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   553
     * Add summary details to the navigation bar.
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   554
     *
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   555
     * @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
   556
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   557
    @Override
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   558
    protected void addSummaryDetailLinks(Content subDiv) {
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   559
        Content div = HtmlTree.DIV(getNavSummaryLinks());
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   560
        subDiv.addContent(div);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   561
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   562
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   563
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   564
     * Get summary links for navigation bar.
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   565
     *
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   566
     * @return the content tree for the navigation summary links
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   567
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   568
    protected Content getNavSummaryLinks() {
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   569
        Content li = HtmlTree.LI(contents.moduleSubNavLabel);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   570
        li.addContent(Contents.SPACE);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   571
        Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   572
        Content liNav = new HtmlTree(HtmlTag.LI);
41452
ddaef4bba083 8165991: Fix DocTreeFactory newDocCommentTree
ksrini
parents: 41157
diff changeset
   573
        liNav.addContent(!utils.getFullBody(mdle).isEmpty() && !configuration.nocomment
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   574
                ? getHyperLink(SectionName.MODULE_DESCRIPTION, contents.navModuleDescription)
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   575
                : contents.navModuleDescription);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   576
        addNavGap(liNav);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   577
        liNav.addContent(showDirectives(DirectiveKind.REQUIRES)
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   578
                ? getHyperLink(SectionName.MODULES, contents.navModules)
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   579
                : contents.navModules);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   580
        addNavGap(liNav);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   581
        liNav.addContent(showDirectives(DirectiveKind.EXPORTS)
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   582
                ? getHyperLink(SectionName.PACKAGES, contents.navPackages)
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   583
                : contents.navPackages);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   584
        addNavGap(liNav);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   585
        liNav.addContent((showDirectives(DirectiveKind.USES) || showDirectives(DirectiveKind.PROVIDES))
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   586
                ? getHyperLink(SectionName.SERVICES, contents.navServices)
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   587
                : contents.navServices);
39670
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   588
        ulNav.addContent(liNav);
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   589
        return ulNav;
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   590
    }
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   591
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   592
    /**
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   593
     * Return true if the directive should be displayed.
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
     * @param dirKind the kind of directive for the module
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   596
     * @return true if the directive should be displayed
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   597
     */
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   598
    private boolean showDirectives(DirectiveKind dirKind) {
9d1eafbf29c6 8154261: Module summary page should display directives for the module
bpatel
parents: 38911
diff changeset
   599
        return directiveMap.get(dirKind) != null && !directiveMap.get(dirKind).isEmpty();
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   600
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   601
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   602
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   603
     * {@inheritDoc}
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   604
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   605
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   606
    public void addModuleContent(Content contentTree, Content moduleContentTree) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   607
        if (configuration.allowTag(HtmlTag.MAIN)) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   608
            mainTree.addContent(moduleContentTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   609
            contentTree.addContent(mainTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   610
        } else {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   611
            contentTree.addContent(moduleContentTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   612
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   613
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   614
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   615
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   616
     * {@inheritDoc}
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   617
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   618
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   619
    public void addModuleFooter(Content contentTree) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   620
        Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   621
                ? HtmlTree.FOOTER()
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   622
                : contentTree;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   623
        addNavLinks(false, htmlTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   624
        addBottom(htmlTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   625
        if (configuration.allowTag(HtmlTag.FOOTER)) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   626
            contentTree.addContent(htmlTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   627
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   628
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   629
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   630
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   631
     * {@inheritDoc}
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   632
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   633
    @Override
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   634
    public void printDocument(Content contentTree) throws DocFileIOException {
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   635
        printHtmlDocument(configuration.metakeywords.getMetaKeywordsForModule(mdle),
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   636
                true, contentTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   637
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   638
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   639
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   640
     * Add the module package deprecation information to the documentation tree.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   641
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   642
     * @param li the content tree to which the deprecation information will be added
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   643
     * @param pkg the PackageDoc that is added
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   644
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   645
    public void addPackageDeprecationInfo(Content li, PackageElement pkg) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   646
        List<? extends DocTree> deprs;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   647
        if (utils.isDeprecated(pkg)) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   648
            deprs = utils.getDeprecatedTrees(pkg);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   649
            HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   650
            deprDiv.addStyle(HtmlStyle.deprecatedContent);
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   651
            Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, contents.deprecatedPhrase);
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   652
            deprDiv.addContent(deprPhrase);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   653
            if (!deprs.isEmpty()) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   654
                CommentHelper ch = utils.getCommentHelper(pkg);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   655
                List<? extends DocTree> commentTags = ch.getDescription(configuration, deprs.get(0));
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   656
                if (!commentTags.isEmpty()) {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   657
                    addInlineDeprecatedComment(pkg, deprs.get(0), deprDiv);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   658
                }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   659
            }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   660
            li.addContent(deprDiv);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   661
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   662
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   663
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   664
    /**
37943
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 37747
diff changeset
   665
     * 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
   666
     *
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 37747
diff changeset
   667
     * @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
   668
     */
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 37747
diff changeset
   669
    @Override
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 37747
diff changeset
   670
    protected Content getNavLinkModule() {
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   671
        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
   672
        return li;
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 37747
diff changeset
   673
    }
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 37747
diff changeset
   674
2efb75c09230 8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents: 37747
diff changeset
   675
    /**
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   676
     * Get "PREV MODULE" link in the navigation bar.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   677
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   678
     * @return a content tree for the previous link
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   679
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   680
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   681
    public Content getNavLinkPrevious() {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   682
        Content li;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   683
        if (prevModule == null) {
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   684
            li = HtmlTree.LI(contents.prevModuleLabel);
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   685
        } else {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   686
            li = HtmlTree.LI(getHyperLink(pathToRoot.resolve(DocPaths.moduleSummary(
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   687
                    prevModule)), contents.prevModuleLabel, "", ""));
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   688
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   689
        return li;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   690
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   691
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   692
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   693
     * Get "NEXT MODULE" link in the navigation bar.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   694
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   695
     * @return a content tree for the next link
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   696
     */
42407
f3702cff2933 8169069: Module system implementation refresh (11/2016)
alanb
parents: 41452
diff changeset
   697
    @Override
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   698
    public Content getNavLinkNext() {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   699
        Content li;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   700
        if (nextModule == null) {
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   701
            li = HtmlTree.LI(contents.nextModuleLabel);
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   702
        } else {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   703
            li = HtmlTree.LI(getHyperLink(pathToRoot.resolve(DocPaths.moduleSummary(
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 39670
diff changeset
   704
                    nextModule)), contents.nextModuleLabel, "", ""));
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   705
        }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   706
        return li;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   707
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   708
}