src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java
author pmuthuswamy
Wed, 30 Jan 2019 16:39:26 +0530
changeset 53562 0d9dee001667
parent 52644 43efb4ca6d6c
child 53863 d001808c57e8
permissions -rw-r--r--
8215577: Remove javadoc support for HTML 4 Reviewed-by: jjg, 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 {
52644
43efb4ca6d6c 8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents: 51092
diff changeset
    90
        String title = resources.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));
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
    92
        HtmlTree htmlTree = HtmlTree.HEADER();
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    93
        addTop(htmlTree);
49551
0d4786e42471 8196200: Implement a navigation builder in javadoc
bpatel
parents: 48747
diff changeset
    94
        navBar.setUserHeader(getUserHeaderFooter(true));
0d4786e42471 8196200: Implement a navigation builder in javadoc
bpatel
parents: 48747
diff changeset
    95
        htmlTree.addContent(navBar.getContent(true));
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
    96
        body.addContent(htmlTree);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    97
        addHelpFileContents(body);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
    98
        htmlTree = HtmlTree.FOOTER();
49551
0d4786e42471 8196200: Implement a navigation builder in javadoc
bpatel
parents: 48747
diff changeset
    99
        navBar.setUserFooter(getUserHeaderFooter(false));
0d4786e42471 8196200: Implement a navigation builder in javadoc
bpatel
parents: 48747
diff changeset
   100
        htmlTree.addContent(navBar.getContent(false));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   101
        addBottom(htmlTree);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   102
        body.addContent(htmlTree);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   103
        printHtmlDocument(null, true, body);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   107
     * Add the help file contents from the resource file to the content tree. While adding the
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
     * 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
   109
     * 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
   110
     * 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
   111
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   112
     * @param contentTree the content tree to which the help file contents will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   114
    protected void addHelpFileContents(Content contentTree) {
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   115
        // Heading
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   116
        Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, HtmlStyle.title,
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   117
                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
   118
        Content div = HtmlTree.DIV(HtmlStyle.header, heading);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   119
        Content intro = HtmlTree.DIV(HtmlStyle.subTitle,
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   120
                contents.getContent("doclet.help.intro"));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   121
        div.addContent(intro);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   122
        mainTree.addContent(div);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   123
        HtmlTree htmlTree;
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   124
        HtmlTree ul = new HtmlTree(HtmlTag.UL);
47846
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47216
diff changeset
   125
        ul.setStyle(HtmlStyle.blockList);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   126
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   127
        // Overview
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
        if (configuration.createoverview) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   129
            Content overviewHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   130
                contents.overviewLabel);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   131
            htmlTree = HtmlTree.SECTION(overviewHeading);
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   132
            String overviewKey = configuration.showModules
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   133
                    ? "doclet.help.overview.modules.body"
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   134
                    : "doclet.help.overview.packages.body";
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   135
            Content overviewLink = links.createLink(
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   136
                    DocPaths.overviewSummary(configuration.frames),
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   137
                    resources.getText("doclet.Overview"));
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   138
            Content overviewBody = contents.getContent(overviewKey, overviewLink);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   139
            Content overviewPara = HtmlTree.P(overviewBody);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   140
            htmlTree.addContent(overviewPara);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   141
            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
        }
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   143
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   144
        // Module
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   145
        if (configuration.showModules) {
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   146
            Content moduleHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   147
                    contents.moduleLabel);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   148
            htmlTree = HtmlTree.SECTION(moduleHead);
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   149
            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
   150
            Content modulePara = HtmlTree.P(moduleIntro);
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   151
            htmlTree.addContent(modulePara);
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   152
            HtmlTree ulModule = new HtmlTree(HtmlTag.UL);
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   153
            ulModule.addContent(HtmlTree.LI(contents.packagesLabel));
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   154
            ulModule.addContent(HtmlTree.LI(contents.modulesLabel));
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   155
            ulModule.addContent(HtmlTree.LI(contents.servicesLabel));
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   156
            htmlTree.addContent(ulModule);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   157
            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   158
        }
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   159
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   160
        // Package
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   161
        Content packageHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   162
                contents.packageLabel);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   163
        htmlTree = HtmlTree.SECTION(packageHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   164
        Content packageIntro = contents.getContent("doclet.help.package.intro");
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   165
        Content packagePara = HtmlTree.P(packageIntro);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   166
        htmlTree.addContent(packagePara);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   167
        HtmlTree ulPackage = new HtmlTree(HtmlTag.UL);
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   168
        ulPackage.addContent(HtmlTree.LI(contents.interfaces));
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   169
        ulPackage.addContent(HtmlTree.LI(contents.classes));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   170
        ulPackage.addContent(HtmlTree.LI(contents.enums));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   171
        ulPackage.addContent(HtmlTree.LI(contents.exceptions));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   172
        ulPackage.addContent(HtmlTree.LI(contents.errors));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   173
        ulPackage.addContent(HtmlTree.LI(contents.annotationTypes));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   174
        htmlTree.addContent(ulPackage);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   175
        ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   176
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   177
        // Class/interface
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   178
        Content classHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   179
                contents.getContent("doclet.help.class_interface.head"));
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   180
        htmlTree = HtmlTree.SECTION(classHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   181
        Content classIntro = contents.getContent("doclet.help.class_interface.intro");
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   182
        Content classPara = HtmlTree.P(classIntro);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   183
        htmlTree.addContent(classPara);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   184
        HtmlTree ul1 = new HtmlTree(HtmlTag.UL);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   185
        ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.inheritance_diagram")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   186
        ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.subclasses")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   187
        ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.subinterfaces")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   188
        ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.implementations")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   189
        ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.declaration")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   190
        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
   191
        htmlTree.addContent(ul1);
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   192
        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
   193
        HtmlTree ul2 = new HtmlTree(HtmlTag.UL);
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   194
        ul2.addContent(HtmlTree.LI(contents.nestedClassSummary));
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   195
        ul2.addContent(HtmlTree.LI(contents.fieldSummaryLabel));
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   196
        ul2.addContent(HtmlTree.LI(contents.propertySummaryLabel));
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   197
        ul2.addContent(HtmlTree.LI(contents.constructorSummaryLabel));
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   198
        ul2.addContent(HtmlTree.LI(contents.methodSummary));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   199
        htmlTree.addContent(ul2);
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   200
        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
   201
        HtmlTree ul3 = new HtmlTree(HtmlTag.UL);
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   202
        ul3.addContent(HtmlTree.LI(contents.fieldDetailsLabel));
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   203
        ul3.addContent(HtmlTree.LI(contents.propertyDetailsLabel));
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   204
        ul3.addContent(HtmlTree.LI(contents.constructorDetailsLabel));
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   205
        ul3.addContent(HtmlTree.LI(contents.methodDetailLabel));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   206
        htmlTree.addContent(ul3);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   207
        Content classSummary = contents.getContent("doclet.help.class_interface.summary");
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   208
        Content para = HtmlTree.P(classSummary);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   209
        htmlTree.addContent(para);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   210
        ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   211
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   212
        // Annotation Types
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   213
        Content aHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   214
                contents.annotationType);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   215
        htmlTree = HtmlTree.SECTION(aHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   216
        Content aIntro = contents.getContent("doclet.help.annotation_type.intro");
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   217
        Content aPara = HtmlTree.P(aIntro);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   218
        htmlTree.addContent(aPara);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   219
        HtmlTree aul = new HtmlTree(HtmlTag.UL);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   220
        aul.addContent(HtmlTree.LI(contents.getContent("doclet.help.annotation_type.declaration")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   221
        aul.addContent(HtmlTree.LI(contents.getContent("doclet.help.annotation_type.description")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   222
        aul.addContent(HtmlTree.LI(contents.annotateTypeRequiredMemberSummaryLabel));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   223
        aul.addContent(HtmlTree.LI(contents.annotateTypeOptionalMemberSummaryLabel));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   224
        aul.addContent(HtmlTree.LI(contents.annotationTypeMemberDetail));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   225
        htmlTree.addContent(aul);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   226
        ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   227
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   228
        // Enums
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   229
        Content enumHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.enum_);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   230
        htmlTree = HtmlTree.SECTION(enumHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   231
        Content eIntro = contents.getContent("doclet.help.enum.intro");
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   232
        Content enumPara = HtmlTree.P(eIntro);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   233
        htmlTree.addContent(enumPara);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   234
        HtmlTree eul = new HtmlTree(HtmlTag.UL);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   235
        eul.addContent(HtmlTree.LI(contents.getContent("doclet.help.enum.declaration")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   236
        eul.addContent(HtmlTree.LI(contents.getContent("doclet.help.enum.definition")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   237
        eul.addContent(HtmlTree.LI(contents.enumConstantSummary));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   238
        eul.addContent(HtmlTree.LI(contents.enumConstantDetailLabel));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   239
        htmlTree.addContent(eul);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   240
        ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   241
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   242
        // Class Use
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
        if (configuration.classuse) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   244
            Content useHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   245
                    contents.getContent("doclet.help.use.head"));
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   246
            htmlTree = HtmlTree.SECTION(useHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   247
            Content useBody = contents.getContent("doclet.help.use.body");
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   248
            Content usePara = HtmlTree.P(useBody);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   249
            htmlTree.addContent(usePara);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   250
            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
        }
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   252
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   253
        // Tree
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
        if (configuration.createtree) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   255
            Content treeHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   256
                    contents.getContent("doclet.help.tree.head"));
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   257
            htmlTree = HtmlTree.SECTION(treeHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   258
            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
   259
                    links.createLink(DocPaths.OVERVIEW_TREE,
52644
43efb4ca6d6c 8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents: 51092
diff changeset
   260
                    resources.getText("doclet.Class_Hierarchy")),
17563
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 14357
diff changeset
   261
                    HtmlTree.CODE(new StringContent("java.lang.Object")));
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   262
            Content treePara = HtmlTree.P(treeIntro);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   263
            htmlTree.addContent(treePara);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   264
            HtmlTree tul = new HtmlTree(HtmlTag.UL);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   265
            tul.addContent(HtmlTree.LI(contents.getContent("doclet.help.tree.overview")));
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   266
            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
   267
            htmlTree.addContent(tul);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   268
            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
10
06bc494ca11e Initial load
duke
parents:
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
        // Deprecated
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   272
        if (!(configuration.nodeprecatedlist || configuration.nodeprecated)) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   273
            Content dHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   274
                    contents.deprecatedAPI);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   275
            htmlTree = HtmlTree.SECTION(dHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   276
            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
   277
                    links.createLink(DocPaths.DEPRECATED_LIST,
52644
43efb4ca6d6c 8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents: 51092
diff changeset
   278
                    resources.getText("doclet.Deprecated_API")));
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   279
            Content dPara = HtmlTree.P(deprBody);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   280
            htmlTree.addContent(dPara);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   281
            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
        }
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   283
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   284
        // Index
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
        if (configuration.createindex) {
17563
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 14357
diff changeset
   286
            Content indexlink;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
            if (configuration.splitindex) {
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47850
diff changeset
   288
                indexlink = links.createLink(DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)),
52644
43efb4ca6d6c 8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents: 51092
diff changeset
   289
                        resources.getText("doclet.Index"));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
            } else {
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47850
diff changeset
   291
                indexlink = links.createLink(DocPaths.INDEX_ALL,
52644
43efb4ca6d6c 8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents: 51092
diff changeset
   292
                        resources.getText("doclet.Index"));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
            }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   294
            Content indexHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   295
                    contents.getContent("doclet.help.index.head"));
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   296
            htmlTree = HtmlTree.SECTION(indexHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   297
            Content indexBody = contents.getContent("doclet.help.index.body", indexlink);
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   298
            Content indexPara = HtmlTree.P(indexBody);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   299
            htmlTree.addContent(indexPara);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   300
            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
        }
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   302
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   303
        // Frames
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   304
        if (configuration.frames) {
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   305
            Content frameHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   306
                    contents.getContent("doclet.help.frames.head"));
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   307
            htmlTree = HtmlTree.SECTION(frameHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   308
            Content framesBody = contents.getContent("doclet.help.frames.body");
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   309
            Content framePara = HtmlTree.P(framesBody);
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   310
            htmlTree.addContent(framePara);
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   311
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   312
            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   313
        }
40500
f293dbb81a53 8162353: javadoc should provide a way to disable use of frames
jjg
parents: 40303
diff changeset
   314
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   315
        // Serialized Form
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   316
        Content sHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   317
                contents.serializedForm);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   318
        htmlTree = HtmlTree.SECTION(sHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   319
        Content serialBody = contents.getContent("doclet.help.serial_form.body");
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   320
        Content serialPara = HtmlTree.P(serialBody);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   321
        htmlTree.addContent(serialPara);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   322
        ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   323
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   324
        // Constant Field Values
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   325
        Content constHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   326
                contents.constantsSummaryTitle);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   327
        htmlTree = HtmlTree.SECTION(constHead);
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   328
        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
   329
                links.createLink(DocPaths.CONSTANT_VALUES,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   330
                resources.getText("doclet.Constants_Summary")));
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   331
        Content constPara = HtmlTree.P(constantsBody);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   332
        htmlTree.addContent(constPara);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   333
        ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   334
51091
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   335
        // Search
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   336
        Content searchHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   337
                contents.getContent("doclet.help.search.head"));
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   338
        htmlTree = HtmlTree.SECTION(searchHead);
51091
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   339
        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
   340
        Content searchPara = HtmlTree.P(searchBody);
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   341
        htmlTree.addContent(searchPara);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   342
        ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
51091
a602706ccaaa 8207213: The help-doc.html generated by the doclet is incomplete
jjg
parents: 51018
diff changeset
   343
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   344
        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
   345
        divContent.addContent(new HtmlTree(HtmlTag.HR));
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   346
        Content footnote = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase,
48747
f7aed48bbbdc 8196736: Refactor HelpWriter and properties
jjg
parents: 48654
diff changeset
   347
                contents.getContent("doclet.help.footnote"));
51018
591c34a66d41 8185740: The help-doc.html generated by the doclet is outdated
jjg
parents: 49551
diff changeset
   348
        divContent.addContent(footnote);
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   349
        mainTree.addContent(divContent);
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 52644
diff changeset
   350
        contentTree.addContent(mainTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   351
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   352
}