src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java
author jjg
Fri, 13 Jul 2018 13:00:36 -0700
changeset 51091 a602706ccaaa
parent 51018 591c34a66d41
child 51092 3b5fd72147c9
permissions -rw-r--r--
8207213: The help-doc.html generated by the doclet is incomplete Reviewed-by: hannesw
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47850
diff changeset
     2
 * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1787
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1787
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1787
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1787
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1787
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    26
package jdk.javadoc.internal.doclets.formats.html;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    28
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    29
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    30
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    31
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
49551
0d4786e42471 8196200: Implement a navigation builder in javadoc
bpatel
parents: 48747
diff changeset
    32
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
0d4786e42471 8196200: Implement a navigation builder in javadoc
bpatel
parents: 48747
diff changeset
    33
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    34
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    35
import jdk.javadoc.internal.doclets.toolkit.Content;
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
    36
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    37
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    38
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    39
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 * Generate the Help File for the generated API documentation. The help file
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 * contents are helpful for browsing the generated documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    45
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    46
 *  If you write code that depends on this, you do so at your own risk.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    47
 *  This code and its internal interfaces are subject to change or
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    48
 *  deletion without notice.</b>
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    49
 *
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
 * @author Atul M Dambalkar
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
public class HelpWriter extends HtmlDocletWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    54
    HtmlTree mainTree = HtmlTree.MAIN();
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    55
49551
0d4786e42471 8196200: Implement a navigation builder in javadoc
bpatel
parents: 48747
diff changeset
    56
    private final Navigation navBar;
0d4786e42471 8196200: Implement a navigation builder in javadoc
bpatel
parents: 48747
diff changeset
    57
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
     * Constructor to construct HelpWriter object.
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47850
diff changeset
    60
     * @param configuration the configuration
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
     * @param filename File to be generated.
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
     */
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 40587
diff changeset
    63
    public HelpWriter(HtmlConfiguration configuration,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
    64
                      DocPath filename) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
        super(configuration, filename);
49551
0d4786e42471 8196200: Implement a navigation builder in javadoc
bpatel
parents: 48747
diff changeset
    66
        this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.HELP, path);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
     * Construct the HelpWriter object and then use it to generate the help
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
     * file. The name of the generated file is "help-doc.html". The help file
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
     * will get generated if and only if "-helpfile" and "-nohelp" is not used
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
     * on the command line.
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
    74
     *
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47850
diff changeset
    75
     * @param configuration the configuration
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
    76
     * @throws DocFileIOException if there is a problem while generating the documentation
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
     */
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 40587
diff changeset
    78
    public static void generate(HtmlConfiguration configuration) throws DocFileIOException {
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
    79
        DocPath filename = DocPaths.HELP_DOC;
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
    80
        HelpWriter helpgen = new HelpWriter(configuration, filename);
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
    81
        helpgen.generateHelpFile();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
     * Generate the help file contents.
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
    86
     *
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
    87
     * @throws DocFileIOException if there is a problem while generating the documentation
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40500
diff changeset
    89
    protected void generateHelpFile() throws DocFileIOException {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    90
        String title = configuration.getText("doclet.Window_Help_title");
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    91
        HtmlTree body = getBody(true, getWindowTitle(title));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    92
        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    93
                ? HtmlTree.HEADER()
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    94
                : body;
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    95
        addTop(htmlTree);
49551
0d4786e42471 8196200: Implement a navigation builder in javadoc
bpatel
parents: 48747
diff changeset
    96
        navBar.setUserHeader(getUserHeaderFooter(true));
0d4786e42471 8196200: Implement a navigation builder in javadoc
bpatel
parents: 48747
diff changeset
    97
        htmlTree.addContent(navBar.getContent(true));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    98
        if (configuration.allowTag(HtmlTag.HEADER)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    99
            body.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   100
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   101
        addHelpFileContents(body);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   102
        if (configuration.allowTag(HtmlTag.FOOTER)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   103
            htmlTree = HtmlTree.FOOTER();
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   104
        }
49551
0d4786e42471 8196200: Implement a navigation builder in javadoc
bpatel
parents: 48747
diff changeset
   105
        navBar.setUserFooter(getUserHeaderFooter(false));
0d4786e42471 8196200: Implement a navigation builder in javadoc
bpatel
parents: 48747
diff changeset
   106
        htmlTree.addContent(navBar.getContent(false));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   107
        addBottom(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   108
        if (configuration.allowTag(HtmlTag.FOOTER)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   109
            body.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   110
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   111
        printHtmlDocument(null, true, body);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   115
     * Add the help file contents from the resource file to the content tree. While adding the
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
     * help file contents it also keeps track of user options. If "-notree"
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   117
     * is used, then the "overview-tree.html" will not get added and hence
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   118
     * help information also will not get added.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   119
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   120
     * @param contentTree the content tree to which the help file contents will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   122
    protected void addHelpFileContents(Content contentTree) {
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   123
        // Heading
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   124
        Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, HtmlStyle.title,
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   125
                contents.getContent("doclet.help.main_heading"));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   126
        Content div = HtmlTree.DIV(HtmlStyle.header, heading);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   127
        Content intro = HtmlTree.DIV(HtmlStyle.subTitle,
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   128
                contents.getContent("doclet.help.intro"));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   129
        div.addContent(intro);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   130
        if (configuration.allowTag(HtmlTag.MAIN)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   131
            mainTree.addContent(div);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   132
        } else {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   133
            contentTree.addContent(div);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   134
        }
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   135
        HtmlTree htmlTree;
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   136
        HtmlTree ul = new HtmlTree(HtmlTag.UL);
47846
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47216
diff changeset
   137
        ul.setStyle(HtmlStyle.blockList);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   138
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   139
        // Overview
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
        if (configuration.createoverview) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   141
            Content overviewHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   142
                contents.overviewLabel);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   143
            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   144
                    ? HtmlTree.SECTION(overviewHeading)
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   145
                    : HtmlTree.LI(HtmlStyle.blockList, overviewHeading);
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   146
            String overviewKey = configuration.showModules
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   147
                    ? "doclet.help.overview.modules.body"
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   148
                    : "doclet.help.overview.packages.body";
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   149
            Content overviewLink = links.createLink(
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   150
                    DocPaths.overviewSummary(configuration.frames),
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   151
                    resources.getText("doclet.Overview"));
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   152
            Content overviewBody = contents.getContent(overviewKey, overviewLink);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   153
            Content overviewPara = HtmlTree.P(overviewBody);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   154
            htmlTree.addContent(overviewPara);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   155
            if (configuration.allowTag(HtmlTag.SECTION)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   156
                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   157
            } else {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   158
                ul.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   159
            }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
        }
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   161
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   162
        // Module
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   163
        if (configuration.showModules) {
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   164
            Content moduleHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   165
                    contents.moduleLabel);
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   166
            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   167
                    ? HtmlTree.SECTION(moduleHead)
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   168
                    : HtmlTree.LI(HtmlStyle.blockList, moduleHead);
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   169
            Content moduleIntro = contents.getContent("doclet.help.module.intro");
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   170
            Content modulePara = HtmlTree.P(moduleIntro);
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   171
            htmlTree.addContent(modulePara);
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   172
            HtmlTree ulModule = new HtmlTree(HtmlTag.UL);
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   173
            ulModule.addContent(HtmlTree.LI(contents.packagesLabel));
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   174
            ulModule.addContent(HtmlTree.LI(contents.modulesLabel));
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   175
            ulModule.addContent(HtmlTree.LI(contents.servicesLabel));
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   176
            htmlTree.addContent(ulModule);
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   177
            if (configuration.allowTag(HtmlTag.SECTION)) {
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   178
                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   179
            } else {
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   180
                ul.addContent(htmlTree);
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   181
            }
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   182
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   183
        }
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   184
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   185
        // Package
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   186
        Content packageHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   187
                contents.packageLabel);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   188
        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   189
                ? HtmlTree.SECTION(packageHead)
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   190
                : HtmlTree.LI(HtmlStyle.blockList, packageHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   191
        Content packageIntro = contents.getContent("doclet.help.package.intro");
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   192
        Content packagePara = HtmlTree.P(packageIntro);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   193
        htmlTree.addContent(packagePara);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   194
        HtmlTree ulPackage = new HtmlTree(HtmlTag.UL);
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   195
        ulPackage.addContent(HtmlTree.LI(contents.interfaces));
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   196
        ulPackage.addContent(HtmlTree.LI(contents.classes));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   197
        ulPackage.addContent(HtmlTree.LI(contents.enums));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   198
        ulPackage.addContent(HtmlTree.LI(contents.exceptions));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   199
        ulPackage.addContent(HtmlTree.LI(contents.errors));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   200
        ulPackage.addContent(HtmlTree.LI(contents.annotationTypes));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   201
        htmlTree.addContent(ulPackage);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   202
        if (configuration.allowTag(HtmlTag.SECTION)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   203
            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   204
        } else {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   205
            ul.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   206
        }
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   207
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   208
        // Class/interface
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   209
        Content classHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   210
                contents.getContent("doclet.help.class_interface.head"));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   211
        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   212
                ? HtmlTree.SECTION(classHead)
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   213
                : HtmlTree.LI(HtmlStyle.blockList, classHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   214
        Content classIntro = contents.getContent("doclet.help.class_interface.intro");
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   215
        Content classPara = HtmlTree.P(classIntro);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   216
        htmlTree.addContent(classPara);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   217
        HtmlTree ul1 = new HtmlTree(HtmlTag.UL);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   218
        ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.inheritance_diagram")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   219
        ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.subclasses")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   220
        ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.subinterfaces")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   221
        ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.implementations")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   222
        ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.declaration")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   223
        ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.description")));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   224
        htmlTree.addContent(ul1);
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   225
        htmlTree.addContent(new HtmlTree(HtmlTag.BR));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   226
        HtmlTree ul2 = new HtmlTree(HtmlTag.UL);
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   227
        ul2.addContent(HtmlTree.LI(contents.nestedClassSummary));
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   228
        ul2.addContent(HtmlTree.LI(contents.fieldSummaryLabel));
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   229
        ul2.addContent(HtmlTree.LI(contents.propertySummaryLabel));
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   230
        ul2.addContent(HtmlTree.LI(contents.constructorSummaryLabel));
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   231
        ul2.addContent(HtmlTree.LI(contents.methodSummary));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   232
        htmlTree.addContent(ul2);
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   233
        htmlTree.addContent(new HtmlTree(HtmlTag.BR));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   234
        HtmlTree ul3 = new HtmlTree(HtmlTag.UL);
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   235
        ul3.addContent(HtmlTree.LI(contents.fieldDetailsLabel));
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   236
        ul3.addContent(HtmlTree.LI(contents.propertyDetailsLabel));
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   237
        ul3.addContent(HtmlTree.LI(contents.constructorDetailsLabel));
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   238
        ul3.addContent(HtmlTree.LI(contents.methodDetailLabel));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   239
        htmlTree.addContent(ul3);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   240
        Content classSummary = contents.getContent("doclet.help.class_interface.summary");
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   241
        Content para = HtmlTree.P(classSummary);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   242
        htmlTree.addContent(para);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   243
        if (configuration.allowTag(HtmlTag.SECTION)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   244
            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   245
        } else {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   246
            ul.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   247
        }
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   248
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   249
        // Annotation Types
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   250
        Content aHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   251
                contents.annotationType);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   252
        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   253
                ? HtmlTree.SECTION(aHead)
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   254
                : HtmlTree.LI(HtmlStyle.blockList, aHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   255
        Content aIntro = contents.getContent("doclet.help.annotation_type.intro");
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   256
        Content aPara = HtmlTree.P(aIntro);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   257
        htmlTree.addContent(aPara);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   258
        HtmlTree aul = new HtmlTree(HtmlTag.UL);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   259
        aul.addContent(HtmlTree.LI(contents.getContent("doclet.help.annotation_type.declaration")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   260
        aul.addContent(HtmlTree.LI(contents.getContent("doclet.help.annotation_type.description")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   261
        aul.addContent(HtmlTree.LI(contents.annotateTypeRequiredMemberSummaryLabel));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   262
        aul.addContent(HtmlTree.LI(contents.annotateTypeOptionalMemberSummaryLabel));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   263
        aul.addContent(HtmlTree.LI(contents.annotationTypeMemberDetail));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   264
        htmlTree.addContent(aul);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   265
        if (configuration.allowTag(HtmlTag.SECTION)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   266
            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   267
        } else {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   268
            ul.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   269
        }
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   270
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   271
        // Enums
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   272
        Content enumHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.enum_);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   273
        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   274
                ? HtmlTree.SECTION(enumHead)
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   275
                : HtmlTree.LI(HtmlStyle.blockList, enumHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   276
        Content eIntro = contents.getContent("doclet.help.enum.intro");
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   277
        Content enumPara = HtmlTree.P(eIntro);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   278
        htmlTree.addContent(enumPara);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   279
        HtmlTree eul = new HtmlTree(HtmlTag.UL);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   280
        eul.addContent(HtmlTree.LI(contents.getContent("doclet.help.enum.declaration")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   281
        eul.addContent(HtmlTree.LI(contents.getContent("doclet.help.enum.definition")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   282
        eul.addContent(HtmlTree.LI(contents.enumConstantSummary));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   283
        eul.addContent(HtmlTree.LI(contents.enumConstantDetailLabel));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   284
        htmlTree.addContent(eul);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   285
        if (configuration.allowTag(HtmlTag.SECTION)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   286
            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   287
        } else {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   288
            ul.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   289
        }
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   290
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   291
        // Class Use
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
        if (configuration.classuse) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   293
            Content useHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   294
                    contents.getContent("doclet.help.use.head"));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   295
            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   296
                    ? HtmlTree.SECTION(useHead)
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   297
                    : HtmlTree.LI(HtmlStyle.blockList, useHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   298
            Content useBody = contents.getContent("doclet.help.use.body");
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   299
            Content usePara = HtmlTree.P(useBody);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   300
            htmlTree.addContent(usePara);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   301
            if (configuration.allowTag(HtmlTag.SECTION)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   302
                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   303
            } else {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   304
                ul.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   305
            }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
        }
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   307
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   308
        // Tree
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   309
        if (configuration.createtree) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   310
            Content treeHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   311
                    contents.getContent("doclet.help.tree.head"));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   312
            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   313
                    ? HtmlTree.SECTION(treeHead)
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   314
                    : HtmlTree.LI(HtmlStyle.blockList, treeHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   315
            Content treeIntro = contents.getContent("doclet.help.tree.intro",
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47850
diff changeset
   316
                    links.createLink(DocPaths.OVERVIEW_TREE,
17563
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 14357
diff changeset
   317
                    configuration.getText("doclet.Class_Hierarchy")),
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 14357
diff changeset
   318
                    HtmlTree.CODE(new StringContent("java.lang.Object")));
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   319
            Content treePara = HtmlTree.P(treeIntro);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   320
            htmlTree.addContent(treePara);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   321
            HtmlTree tul = new HtmlTree(HtmlTag.UL);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   322
            tul.addContent(HtmlTree.LI(contents.getContent("doclet.help.tree.overview")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   323
            tul.addContent(HtmlTree.LI(contents.getContent("doclet.help.tree.package")));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   324
            htmlTree.addContent(tul);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   325
            if (configuration.allowTag(HtmlTag.SECTION)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   326
                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   327
            } else {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   328
                ul.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   329
            }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   330
        }
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   331
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   332
        // Deprecated
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   333
        if (!(configuration.nodeprecatedlist || configuration.nodeprecated)) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   334
            Content dHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   335
                    contents.deprecatedAPI);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   336
            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   337
                    ? HtmlTree.SECTION(dHead)
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   338
                    : HtmlTree.LI(HtmlStyle.blockList, dHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   339
            Content deprBody = contents.getContent("doclet.help.deprecated.body",
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47850
diff changeset
   340
                    links.createLink(DocPaths.DEPRECATED_LIST,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   341
                    configuration.getText("doclet.Deprecated_API")));
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   342
            Content dPara = HtmlTree.P(deprBody);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   343
            htmlTree.addContent(dPara);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   344
            if (configuration.allowTag(HtmlTag.SECTION)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   345
                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   346
            } else {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   347
                ul.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   348
            }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   349
        }
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   350
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   351
        // Index
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   352
        if (configuration.createindex) {
17563
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 14357
diff changeset
   353
            Content indexlink;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   354
            if (configuration.splitindex) {
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47850
diff changeset
   355
                indexlink = links.createLink(DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)),
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   356
                        configuration.getText("doclet.Index"));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   357
            } else {
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47850
diff changeset
   358
                indexlink = links.createLink(DocPaths.INDEX_ALL,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   359
                        configuration.getText("doclet.Index"));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   360
            }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   361
            Content indexHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   362
                    contents.getContent("doclet.help.index.head"));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   363
            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   364
                    ? HtmlTree.SECTION(indexHead)
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   365
                    : HtmlTree.LI(HtmlStyle.blockList, indexHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   366
            Content indexBody = contents.getContent("doclet.help.index.body", indexlink);
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   367
            Content indexPara = HtmlTree.P(indexBody);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   368
            htmlTree.addContent(indexPara);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   369
            if (configuration.allowTag(HtmlTag.SECTION)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   370
                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   371
            } else {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   372
                ul.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   373
            }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   374
        }
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   375
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   376
        // Frames
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   377
        if (configuration.frames) {
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   378
            Content frameHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   379
                    contents.getContent("doclet.help.frames.head"));
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   380
            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   381
                    ? HtmlTree.SECTION(frameHead)
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   382
                    : HtmlTree.LI(HtmlStyle.blockList, frameHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   383
            Content framesBody = contents.getContent("doclet.help.frames.body");
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   384
            Content framePara = HtmlTree.P(framesBody);
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   385
            htmlTree.addContent(framePara);
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   386
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   387
            if (configuration.allowTag(HtmlTag.SECTION)) {
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   388
                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   389
            } else {
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   390
                ul.addContent(htmlTree);
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   391
            }
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   392
        }
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   393
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   394
        // All Classes
8848
3f1b154379d6 4743537: Help doesn't say what "All Classes" and other links really mean
bpatel
parents: 7681
diff changeset
   395
        Content allclassesHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   396
                contents.allClassesLabel);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   397
        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   398
                ? HtmlTree.SECTION(allclassesHead)
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   399
                : HtmlTree.LI(HtmlStyle.blockList, allclassesHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   400
        Content allClassesBody = contents.getContent("doclet.help.all_classes.body",
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47850
diff changeset
   401
                links.createLink(DocPaths.AllClasses(configuration.frames),
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   402
                resources.getText("doclet.All_Classes")));
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   403
        Content allclassesPara = HtmlTree.P(allClassesBody);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   404
        htmlTree.addContent(allclassesPara);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   405
        if (configuration.allowTag(HtmlTag.SECTION)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   406
            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   407
        } else {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   408
            ul.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   409
        }
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   410
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   411
        // Serialized Form
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   412
        Content sHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   413
                contents.serializedForm);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   414
        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   415
                ? HtmlTree.SECTION(sHead)
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   416
                : HtmlTree.LI(HtmlStyle.blockList, sHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   417
        Content serialBody = contents.getContent("doclet.help.serial_form.body");
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   418
        Content serialPara = HtmlTree.P(serialBody);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   419
        htmlTree.addContent(serialPara);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   420
        if (configuration.allowTag(HtmlTag.SECTION)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   421
            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   422
        } else {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   423
            ul.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   424
        }
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   425
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   426
        // Constant Field Values
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   427
        Content constHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   428
                contents.constantsSummaryTitle);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   429
        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   430
                ? HtmlTree.SECTION(constHead)
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   431
                : HtmlTree.LI(HtmlStyle.blockList, constHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   432
        Content constantsBody = contents.getContent("doclet.help.constants.body",
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47850
diff changeset
   433
                links.createLink(DocPaths.CONSTANT_VALUES,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   434
                resources.getText("doclet.Constants_Summary")));
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   435
        Content constPara = HtmlTree.P(constantsBody);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   436
        htmlTree.addContent(constPara);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   437
        if (configuration.allowTag(HtmlTag.SECTION)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   438
            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   439
        } else {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   440
            ul.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   441
        }
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   442
51091
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   443
        // Search
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   444
        Content searchHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   445
                contents.getContent("doclet.help.search.head"));
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   446
        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   447
                ? HtmlTree.SECTION(searchHead)
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   448
                : HtmlTree.LI(HtmlStyle.blockList, searchHead);
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   449
        Content searchBody = contents.getContent("doclet.help.search.body");
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   450
        Content searchPara = HtmlTree.P(searchBody);
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   451
        htmlTree.addContent(searchPara);
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   452
        if (configuration.allowTag(HtmlTag.SECTION)) {
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   453
            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   454
        } else {
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   455
            ul.addContent(htmlTree);
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   456
        }
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   457
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   458
        Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul);
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   459
        divContent.addContent(new HtmlTree(HtmlTag.HR));
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   460
        Content footnote = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase,
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   461
                contents.getContent("doclet.help.footnote"));
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   462
        divContent.addContent(footnote);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   463
        if (configuration.allowTag(HtmlTag.MAIN)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   464
            mainTree.addContent(divContent);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   465
            contentTree.addContent(mainTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   466
        } else {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   467
            contentTree.addContent(divContent);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   468
        }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   469
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   470
}