langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
author jjg
Mon, 09 May 2016 16:52:15 -0700
changeset 37938 42baa89d2156
parent 36526 3b41f1c69604
child 38617 d93a7f64e231
permissions -rw-r--r--
8075703: jdk.javadoc module exports com.sun.tools.javadoc package which contains a lot of internal API. Reviewed-by: ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 29957
diff changeset
     2
 * Copyright (c) 1997, 2016, 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: 2216
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: 2216
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: 2216
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2216
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2216
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
package com.sun.tools.doclets.formats.html;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
    28
import java.util.*;
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
    29
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
    30
import com.sun.javadoc.*;
37938
42baa89d2156 8075703: jdk.javadoc module exports com.sun.tools.javadoc package which contains a lot of internal API.
jjg
parents: 36526
diff changeset
    31
import com.sun.tools.javadoc.main.RootDocImpl;
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 9083
diff changeset
    32
import com.sun.tools.doclets.formats.html.markup.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
import com.sun.tools.doclets.internal.toolkit.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
import com.sun.tools.doclets.internal.toolkit.builders.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
import com.sun.tools.doclets.internal.toolkit.taglets.*;
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 9083
diff changeset
    36
import com.sun.tools.doclets.internal.toolkit.util.*;
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
    37
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14358
diff changeset
    38
import java.io.IOException;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 * Generate the Class Information Page.
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    42
 *
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    43
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    44
 *  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
    45
 *  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
    46
 *  deletion without notice.</b>
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    47
 *
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
 * @see com.sun.javadoc.ClassDoc
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
 * @see java.util.Collections
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
 * @see java.util.List
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
 * @see java.util.ArrayList
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
 * @see java.util.HashMap
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
 * @author Atul M Dambalkar
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
 * @author Robert Field
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    56
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
public class ClassWriterImpl extends SubWriterHolderWriter
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
        implements ClassWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14358
diff changeset
    61
    protected final ClassDoc classDoc;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14358
diff changeset
    63
    protected final ClassTree classtree;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14358
diff changeset
    65
    protected final ClassDoc prev;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14358
diff changeset
    67
    protected final ClassDoc next;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
    /**
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14358
diff changeset
    70
     * @param configuration the configuration data for the doclet
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
     * @param classDoc the class being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
     * @param prevClass the previous class that was documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
     * @param nextClass the next class being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
     * @param classTree the class tree for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
     */
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14358
diff changeset
    76
    public ClassWriterImpl (ConfigurationImpl configuration, ClassDoc classDoc,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
            ClassDoc prevClass, ClassDoc nextClass, ClassTree classTree)
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14358
diff changeset
    78
            throws IOException {
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14358
diff changeset
    79
        super(configuration, DocPath.forClass(classDoc));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
        this.classDoc = classDoc;
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
        configuration.currentcd = classDoc;
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
        this.classtree = classTree;
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
        this.prev = prevClass;
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
        this.next = nextClass;
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    88
     * Get this package link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    89
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    90
     * @return a content tree for the package link
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    92
    protected Content getNavLinkPackage() {
14358
9eda9239cba0 8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents: 14357
diff changeset
    93
        Content linkContent = getHyperLink(DocPaths.PACKAGE_SUMMARY,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    94
                packageLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    95
        Content li = HtmlTree.LI(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    96
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   100
     * Get the class link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   101
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   102
     * @return a content tree for the class link
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   104
    protected Content getNavLinkClass() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   105
        Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, classLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   106
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   107
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   108
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   109
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   110
     * Get the class use link.
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
     * @return a content tree for the class use link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   113
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   114
    protected Content getNavLinkClassUse() {
14358
9eda9239cba0 8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents: 14357
diff changeset
   115
        Content linkContent = getHyperLink(DocPaths.CLASS_USE.resolve(filename), useLabel);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   116
        Content li = HtmlTree.LI(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   117
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   121
     * Get link to previous class.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   122
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   123
     * @return a content tree for the previous class link
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   125
    public Content getNavLinkPrevious() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   126
        Content li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   127
        if (prev != null) {
17559
87c28ee29329 8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents: 17558
diff changeset
   128
            Content prevLink = getLink(new LinkInfoImpl(configuration,
17561
9f3505f35da9 8011651: simplify LinkInfoImpl API
jjg
parents: 17559
diff changeset
   129
                    LinkInfoImpl.Kind.CLASS, prev)
19907
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 19667
diff changeset
   130
                    .label(prevclassLabel).strong(true));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   131
            li = HtmlTree.LI(prevLink);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   132
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   133
        else
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   134
            li = HtmlTree.LI(prevclassLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   135
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   139
     * Get link to next class.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   140
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   141
     * @return a content tree for the next class link
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   143
    public Content getNavLinkNext() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   144
        Content li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   145
        if (next != null) {
17559
87c28ee29329 8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents: 17558
diff changeset
   146
            Content nextLink = getLink(new LinkInfoImpl(configuration,
17561
9f3505f35da9 8011651: simplify LinkInfoImpl API
jjg
parents: 17559
diff changeset
   147
                    LinkInfoImpl.Kind.CLASS, next)
19907
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 19667
diff changeset
   148
                    .label(nextclassLabel).strong(true));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   149
            li = HtmlTree.LI(nextLink);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   151
        else
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   152
            li = HtmlTree.LI(nextclassLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   153
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   159
    public Content getHeader(String header) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
        String pkgname = (classDoc.containingPackage() != null)?
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
            classDoc.containingPackage().name(): "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
        String clname = classDoc.name();
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   163
        HtmlTree bodyTree = getBody(true, getWindowTitle(clname));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   164
        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   165
                ? HtmlTree.HEADER()
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   166
                : bodyTree;
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   167
        addTop(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   168
        addNavLinks(true, htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   169
        if (configuration.allowTag(HtmlTag.HEADER)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   170
            bodyTree.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   171
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   172
        bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   173
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   174
        div.addStyle(HtmlStyle.header);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
        if (pkgname.length() > 0) {
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 29957
diff changeset
   176
            Content classPackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInClass, packageLabel);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 29957
diff changeset
   177
            Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classPackageLabel);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 29957
diff changeset
   178
            pkgNameDiv.addContent(getSpace());
3b41f1c69604 8142968: Module System implementation
alanb
parents: 29957
diff changeset
   179
            Content pkgNameContent = getTargetPackageLink(classDoc.containingPackage(),
3b41f1c69604 8142968: Module System implementation
alanb
parents: 29957
diff changeset
   180
                    "classFrame", new StringContent(pkgname));
3b41f1c69604 8142968: Module System implementation
alanb
parents: 29957
diff changeset
   181
            pkgNameDiv.addContent(pkgNameContent);
9068
6697b4cbba1d 7010342: End tag for element P is not open for few html files generated using new javadoc
bpatel
parents: 7681
diff changeset
   182
            div.addContent(pkgNameDiv);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
        }
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14358
diff changeset
   184
        LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
17561
9f3505f35da9 8011651: simplify LinkInfoImpl API
jjg
parents: 17559
diff changeset
   185
                LinkInfoImpl.Kind.CLASS_HEADER, classDoc);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
        //Let's not link to ourselves in the header.
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
        linkInfo.linkToSelf = false;
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   188
        Content headerContent = new StringContent(header);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   189
        Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   190
                HtmlStyle.title, headerContent);
17559
87c28ee29329 8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents: 17558
diff changeset
   191
        heading.addContent(getTypeParameterLinks(linkInfo));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   192
        div.addContent(heading);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   193
        if (configuration.allowTag(HtmlTag.MAIN)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   194
            mainTree.addContent(div);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   195
        } else {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   196
            bodyTree.addContent(div);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   197
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   198
        return bodyTree;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   199
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   200
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   201
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   202
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   203
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   204
    public Content getClassContentHeader() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   205
        return getContentHeader();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   206
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   207
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   208
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   209
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   210
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   211
    public void addFooter(Content contentTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   212
        contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   213
        Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   214
                ? HtmlTree.FOOTER()
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   215
                : contentTree;
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   216
        addNavLinks(false, htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   217
        addBottom(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   218
        if (configuration.allowTag(HtmlTag.FOOTER)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   219
            contentTree.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 26270
diff changeset
   220
        }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
     */
14265
4e8e488eeae0 8000666: javadoc should write directly to Writer instead of composing strings
jjg
parents: 14260
diff changeset
   226
    public void printDocument(Content contentTree) throws IOException {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   227
        printHtmlDocument(configuration.metakeywords.getMetaKeywords(classDoc),
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   228
                true, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   229
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   230
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   231
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   232
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   233
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   234
    public Content getClassInfoTreeHeader() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   235
        return getMemberTreeHeader();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   236
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   237
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   238
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   239
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   240
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   241
    public Content getClassInfo(Content classInfoTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   242
        return getMemberTree(HtmlStyle.description, classInfoTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   248
    public void addClassSignature(String modifiers, Content classInfoTree) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
        boolean isInterface = classDoc.isInterface();
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   250
        classInfoTree.addContent(new HtmlTree(HtmlTag.BR));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   251
        Content pre = new HtmlTree(HtmlTag.PRE);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   252
        addAnnotationInfo(classDoc, pre);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   253
        pre.addContent(modifiers);
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14358
diff changeset
   254
        LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
17561
9f3505f35da9 8011651: simplify LinkInfoImpl API
jjg
parents: 17559
diff changeset
   255
                LinkInfoImpl.Kind.CLASS_SIGNATURE, classDoc);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
        //Let's not link to ourselves in the signature.
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
        linkInfo.linkToSelf = false;
9083
63f3c4d2d992 7010344: Some of the html files do not have element <a> in right context.
bpatel
parents: 9068
diff changeset
   258
        Content className = new StringContent(classDoc.name());
17559
87c28ee29329 8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents: 17558
diff changeset
   259
        Content parameterLinks = getTypeParameterLinks(linkInfo);
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14358
diff changeset
   260
        if (configuration.linksource) {
9083
63f3c4d2d992 7010344: Some of the html files do not have element <a> in right context.
bpatel
parents: 9068
diff changeset
   261
            addSrcLink(classDoc, className, pre);
63f3c4d2d992 7010344: Some of the html files do not have element <a> in right context.
bpatel
parents: 9068
diff changeset
   262
            pre.addContent(parameterLinks);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
        } else {
21478
fa4c7cda1b41 8026567: Use meaningful style names for strong and italic styles.
bpatel
parents: 19907
diff changeset
   264
            Content span = HtmlTree.SPAN(HtmlStyle.typeNameLabel, className);
9083
63f3c4d2d992 7010344: Some of the html files do not have element <a> in right context.
bpatel
parents: 9068
diff changeset
   265
            span.addContent(parameterLinks);
63f3c4d2d992 7010344: Some of the html files do not have element <a> in right context.
bpatel
parents: 9068
diff changeset
   266
            pre.addContent(span);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
        if (!isInterface) {
25454
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 23799
diff changeset
   269
            Type superclass = utils.getFirstVisibleSuperClass(classDoc,
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14358
diff changeset
   270
                    configuration);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
            if (superclass != null) {
7641
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   272
                pre.addContent(DocletConstants.NL);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   273
                pre.addContent("extends ");
17559
87c28ee29329 8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents: 17558
diff changeset
   274
                Content link = getLink(new LinkInfoImpl(configuration,
17558
eee4ccf66cfd 8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents: 15723
diff changeset
   275
                        LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME,
17559
87c28ee29329 8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents: 17558
diff changeset
   276
                        superclass));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   277
                pre.addContent(link);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
        Type[] implIntfacs = classDoc.interfaceTypes();
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
        if (implIntfacs != null && implIntfacs.length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
            int counter = 0;
22159
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 21478
diff changeset
   283
            for (Type implType : implIntfacs) {
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 21478
diff changeset
   284
                ClassDoc classDoc = implType.asClassDoc();
25454
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 23799
diff changeset
   285
                if (!(classDoc.isPublic() || utils.isLinkable(classDoc, configuration))) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
                    continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
                if (counter == 0) {
7641
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   289
                    pre.addContent(DocletConstants.NL);
22159
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 21478
diff changeset
   290
                    pre.addContent(isInterface ? "extends " : "implements ");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
                } else {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   292
                    pre.addContent(", ");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
                }
17559
87c28ee29329 8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents: 17558
diff changeset
   294
                Content link = getLink(new LinkInfoImpl(configuration,
22159
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 21478
diff changeset
   295
                                                        LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME,
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 21478
diff changeset
   296
                                                        implType));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   297
                pre.addContent(link);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
                counter++;
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   301
        classInfoTree.addContent(pre);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   302
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   303
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   304
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   305
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   306
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   307
    public void addClassDescription(Content classInfoTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   308
        if(!configuration.nocomment) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   309
            // generate documentation for the class.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   310
            if (classDoc.inlineTags().length > 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   311
                addInlineComment(classDoc, classInfoTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   312
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   313
        }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   314
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
06bc494ca11e Initial load
duke
parents:
diff changeset
   316
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   317
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   318
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   319
    public void addClassTagInfo(Content classInfoTree) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   320
        if(!configuration.nocomment) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   321
            // Print Information about all the tags here
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   322
            addTagsInfo(classDoc, classInfoTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   323
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   324
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   325
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   326
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   327
     * Get the class hierarchy tree for the given class.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   328
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   329
     * @param type the class to print the hierarchy for
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   330
     * @return a content tree for class inheritence
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   331
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   332
    private Content getClassInheritenceTree(Type type) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   333
        Type sup;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   334
        HtmlTree classTreeUl = new HtmlTree(HtmlTag.UL);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   335
        classTreeUl.addStyle(HtmlStyle.inheritance);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   336
        Content liTree = null;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   337
        do {
25454
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 23799
diff changeset
   338
            sup = utils.getFirstVisibleSuperClass(
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   339
                    type instanceof ClassDoc ? (ClassDoc) type : type.asClassDoc(),
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14358
diff changeset
   340
                    configuration);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   341
            if (sup != null) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   342
                HtmlTree ul = new HtmlTree(HtmlTag.UL);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   343
                ul.addStyle(HtmlStyle.inheritance);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   344
                ul.addContent(getTreeForClassHelper(type));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   345
                if (liTree != null)
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   346
                    ul.addContent(liTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   347
                Content li = HtmlTree.LI(ul);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   348
                liTree = li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   349
                type = sup;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   350
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   351
            else
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   352
                classTreeUl.addContent(getTreeForClassHelper(type));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   353
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   354
        while (sup != null);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   355
        if (liTree != null)
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   356
            classTreeUl.addContent(liTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   357
        return classTreeUl;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   358
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   359
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   360
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   361
     * Get the class helper tree for the given class.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   362
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   363
     * @param type the class to print the helper for
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   364
     * @return a content tree for class helper
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   365
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   366
    private Content getTreeForClassHelper(Type type) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   367
        Content li = new HtmlTree(HtmlTag.LI);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   368
        if (type.equals(classDoc)) {
17559
87c28ee29329 8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents: 17558
diff changeset
   369
            Content typeParameters = getTypeParameterLinks(
17558
eee4ccf66cfd 8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents: 15723
diff changeset
   370
                    new LinkInfoImpl(configuration, LinkInfoImpl.Kind.TREE,
17561
9f3505f35da9 8011651: simplify LinkInfoImpl API
jjg
parents: 17559
diff changeset
   371
                    classDoc));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   372
            if (configuration.shouldExcludeQualifier(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   373
                    classDoc.containingPackage().name())) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   374
                li.addContent(type.asClassDoc().name());
17559
87c28ee29329 8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents: 17558
diff changeset
   375
                li.addContent(typeParameters);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   376
            } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   377
                li.addContent(type.asClassDoc().qualifiedName());
17559
87c28ee29329 8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents: 17558
diff changeset
   378
                li.addContent(typeParameters);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   379
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   380
        } else {
17559
87c28ee29329 8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents: 17558
diff changeset
   381
            Content link = getLink(new LinkInfoImpl(configuration,
17561
9f3505f35da9 8011651: simplify LinkInfoImpl API
jjg
parents: 17559
diff changeset
   382
                    LinkInfoImpl.Kind.CLASS_TREE_PARENT, type)
9f3505f35da9 8011651: simplify LinkInfoImpl API
jjg
parents: 17559
diff changeset
   383
                    .label(configuration.getClassName(type.asClassDoc())));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   384
            li.addContent(link);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   385
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   386
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   387
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   388
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   389
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   390
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   391
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   392
    public void addClassTree(Content classContentTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   393
        if (!classDoc.isClass()) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   394
            return;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   395
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   396
        classContentTree.addContent(getClassInheritenceTree(classDoc));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   397
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   398
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   399
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   400
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   401
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   402
    public void addTypeParamInfo(Content classInfoTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   403
        if (classDoc.typeParamTags().length > 0) {
17574
044c7e1e4d53 8012308: Remove TagletOutput in favor of direct use of Content
jjg
parents: 17567
diff changeset
   404
            Content typeParam = (new ParamTaglet()).getTagletOutput(classDoc,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   405
                    getTagletWriterInstance(false));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   406
            Content dl = HtmlTree.DL(typeParam);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   407
            classInfoTree.addContent(dl);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   408
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   409
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   410
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   411
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   412
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   413
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   414
    public void addSubClassInfo(Content classInfoTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   415
        if (classDoc.isClass()) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   416
            if (classDoc.qualifiedName().equals("java.lang.Object") ||
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   417
                    classDoc.qualifiedName().equals("org.omg.CORBA.Object")) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   418
                return;    // Don't generate the list, too huge
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   419
            }
26270
a3635e6d3d78 8050031: [javadoc] class-use pages have duplicates and missing entries
ksrini
parents: 25874
diff changeset
   420
            SortedSet<ClassDoc> subclasses = classtree.subs(classDoc, false);
a3635e6d3d78 8050031: [javadoc] class-use pages have duplicates and missing entries
ksrini
parents: 25874
diff changeset
   421
            if (!subclasses.isEmpty()) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   422
                Content label = getResource(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   423
                        "doclet.Subclasses");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   424
                Content dt = HtmlTree.DT(label);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   425
                Content dl = HtmlTree.DL(dt);
17558
eee4ccf66cfd 8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents: 15723
diff changeset
   426
                dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUBCLASSES,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   427
                        subclasses));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   428
                classInfoTree.addContent(dl);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   429
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   430
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   431
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   432
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   433
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   434
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   435
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   436
    public void addSubInterfacesInfo(Content classInfoTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   437
        if (classDoc.isInterface()) {
26270
a3635e6d3d78 8050031: [javadoc] class-use pages have duplicates and missing entries
ksrini
parents: 25874
diff changeset
   438
            SortedSet<ClassDoc> subInterfaces = classtree.allSubs(classDoc, false);
a3635e6d3d78 8050031: [javadoc] class-use pages have duplicates and missing entries
ksrini
parents: 25874
diff changeset
   439
            if (!subInterfaces.isEmpty()) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   440
                Content label = getResource(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   441
                        "doclet.Subinterfaces");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   442
                Content dt = HtmlTree.DT(label);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   443
                Content dl = HtmlTree.DL(dt);
17558
eee4ccf66cfd 8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents: 15723
diff changeset
   444
                dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUBINTERFACES,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   445
                        subInterfaces));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   446
                classInfoTree.addContent(dl);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   447
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   448
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   449
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   450
06bc494ca11e Initial load
duke
parents:
diff changeset
   451
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   452
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   453
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   454
    public void addInterfaceUsageInfo (Content classInfoTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   455
        if (! classDoc.isInterface()) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   456
            return;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   457
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   458
        if (classDoc.qualifiedName().equals("java.lang.Cloneable") ||
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   459
                classDoc.qualifiedName().equals("java.io.Serializable")) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   460
            return;   // Don't generate the list, too big
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   461
        }
26270
a3635e6d3d78 8050031: [javadoc] class-use pages have duplicates and missing entries
ksrini
parents: 25874
diff changeset
   462
        SortedSet<ClassDoc> implcl = classtree.implementingclasses(classDoc);
a3635e6d3d78 8050031: [javadoc] class-use pages have duplicates and missing entries
ksrini
parents: 25874
diff changeset
   463
        if (!implcl.isEmpty()) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   464
            Content label = getResource(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   465
                    "doclet.Implementing_Classes");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   466
            Content dt = HtmlTree.DT(label);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   467
            Content dl = HtmlTree.DL(dt);
17558
eee4ccf66cfd 8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents: 15723
diff changeset
   468
            dl.addContent(getClassLinks(LinkInfoImpl.Kind.IMPLEMENTED_CLASSES,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   469
                    implcl));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   470
            classInfoTree.addContent(dl);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   471
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   472
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   473
06bc494ca11e Initial load
duke
parents:
diff changeset
   474
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   475
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   476
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   477
    public void addImplementedInterfacesInfo(Content classInfoTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   478
        //NOTE:  we really should be using ClassDoc.interfaceTypes() here, but
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   479
        //       it doesn't walk up the tree like we want it to.
25454
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 23799
diff changeset
   480
        List<Type> interfaceArray = utils.getAllInterfaces(classDoc, configuration);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   481
        if (classDoc.isClass() && interfaceArray.size() > 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   482
            Content label = getResource(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   483
                    "doclet.All_Implemented_Interfaces");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   484
            Content dt = HtmlTree.DT(label);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   485
            Content dl = HtmlTree.DL(dt);
17558
eee4ccf66cfd 8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents: 15723
diff changeset
   486
            dl.addContent(getClassLinks(LinkInfoImpl.Kind.IMPLEMENTED_INTERFACES,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   487
                    interfaceArray));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   488
            classInfoTree.addContent(dl);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   489
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   490
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   491
06bc494ca11e Initial load
duke
parents:
diff changeset
   492
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   493
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   494
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   495
    public void addSuperInterfacesInfo(Content classInfoTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   496
        //NOTE:  we really should be using ClassDoc.interfaceTypes() here, but
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   497
        //       it doesn't walk up the tree like we want it to.
25454
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 23799
diff changeset
   498
        List<Type> interfaceArray = utils.getAllInterfaces(classDoc, configuration);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   499
        if (classDoc.isInterface() && interfaceArray.size() > 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   500
            Content label = getResource(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   501
                    "doclet.All_Superinterfaces");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   502
            Content dt = HtmlTree.DT(label);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   503
            Content dl = HtmlTree.DL(dt);
17558
eee4ccf66cfd 8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents: 15723
diff changeset
   504
            dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUPER_INTERFACES,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   505
                    interfaceArray));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   506
            classInfoTree.addContent(dl);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   507
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   508
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   509
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   510
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   511
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   512
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   513
    public void addNestedClassInfo(Content classInfoTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   514
        ClassDoc outerClass = classDoc.containingClass();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   515
        if (outerClass != null) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   516
            Content label;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   517
            if (outerClass.isInterface()) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   518
                label = getResource(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   519
                        "doclet.Enclosing_Interface");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   520
            } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   521
                label = getResource(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   522
                        "doclet.Enclosing_Class");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   523
            }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   524
            Content dt = HtmlTree.DT(label);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   525
            Content dl = HtmlTree.DL(dt);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   526
            Content dd = new HtmlTree(HtmlTag.DD);
17559
87c28ee29329 8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents: 17558
diff changeset
   527
            dd.addContent(getLink(new LinkInfoImpl(configuration,
17561
9f3505f35da9 8011651: simplify LinkInfoImpl API
jjg
parents: 17559
diff changeset
   528
                    LinkInfoImpl.Kind.CLASS, outerClass)));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   529
            dl.addContent(dd);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   530
            classInfoTree.addContent(dl);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   531
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   532
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   533
06bc494ca11e Initial load
duke
parents:
diff changeset
   534
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   535
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   536
     */
14965
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents: 14542
diff changeset
   537
    public void addFunctionalInterfaceInfo (Content classInfoTree) {
23799
daa645653200 8029143: javadoc standard doclet should add Functional Interface blurb when @FunctionalInterface annotation is present
bpatel
parents: 22159
diff changeset
   538
        if (isFunctionalInterface()) {
14965
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents: 14542
diff changeset
   539
            Content dt = HtmlTree.DT(getResource("doclet.Functional_Interface"));
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents: 14542
diff changeset
   540
            Content dl = HtmlTree.DL(dt);
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents: 14542
diff changeset
   541
            Content dd = new HtmlTree(HtmlTag.DD);
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents: 14542
diff changeset
   542
            dd.addContent(getResource("doclet.Functional_Interface_Message"));
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents: 14542
diff changeset
   543
            dl.addContent(dd);
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents: 14542
diff changeset
   544
            classInfoTree.addContent(dl);
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents: 14542
diff changeset
   545
        }
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents: 14542
diff changeset
   546
    }
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents: 14542
diff changeset
   547
23799
daa645653200 8029143: javadoc standard doclet should add Functional Interface blurb when @FunctionalInterface annotation is present
bpatel
parents: 22159
diff changeset
   548
    public boolean isFunctionalInterface() {
daa645653200 8029143: javadoc standard doclet should add Functional Interface blurb when @FunctionalInterface annotation is present
bpatel
parents: 22159
diff changeset
   549
        if (configuration.root instanceof RootDocImpl) {
daa645653200 8029143: javadoc standard doclet should add Functional Interface blurb when @FunctionalInterface annotation is present
bpatel
parents: 22159
diff changeset
   550
            RootDocImpl root = (RootDocImpl) configuration.root;
daa645653200 8029143: javadoc standard doclet should add Functional Interface blurb when @FunctionalInterface annotation is present
bpatel
parents: 22159
diff changeset
   551
            AnnotationDesc[] annotationDescList = classDoc.annotations();
daa645653200 8029143: javadoc standard doclet should add Functional Interface blurb when @FunctionalInterface annotation is present
bpatel
parents: 22159
diff changeset
   552
            for (AnnotationDesc annoDesc : annotationDescList) {
daa645653200 8029143: javadoc standard doclet should add Functional Interface blurb when @FunctionalInterface annotation is present
bpatel
parents: 22159
diff changeset
   553
                if (root.isFunctionalInterface(annoDesc)) {
daa645653200 8029143: javadoc standard doclet should add Functional Interface blurb when @FunctionalInterface annotation is present
bpatel
parents: 22159
diff changeset
   554
                    return true;
daa645653200 8029143: javadoc standard doclet should add Functional Interface blurb when @FunctionalInterface annotation is present
bpatel
parents: 22159
diff changeset
   555
                }
daa645653200 8029143: javadoc standard doclet should add Functional Interface blurb when @FunctionalInterface annotation is present
bpatel
parents: 22159
diff changeset
   556
            }
daa645653200 8029143: javadoc standard doclet should add Functional Interface blurb when @FunctionalInterface annotation is present
bpatel
parents: 22159
diff changeset
   557
        }
daa645653200 8029143: javadoc standard doclet should add Functional Interface blurb when @FunctionalInterface annotation is present
bpatel
parents: 22159
diff changeset
   558
        return false;
daa645653200 8029143: javadoc standard doclet should add Functional Interface blurb when @FunctionalInterface annotation is present
bpatel
parents: 22159
diff changeset
   559
    }
daa645653200 8029143: javadoc standard doclet should add Functional Interface blurb when @FunctionalInterface annotation is present
bpatel
parents: 22159
diff changeset
   560
14965
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents: 14542
diff changeset
   561
    /**
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents: 14542
diff changeset
   562
     * {@inheritDoc}
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents: 14542
diff changeset
   563
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   564
    public void addClassDeprecationInfo(Content classInfoTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   565
        Content hr = new HtmlTree(HtmlTag.HR);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   566
        classInfoTree.addContent(hr);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   567
        Tag[] deprs = classDoc.tags("deprecated");
25454
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 23799
diff changeset
   568
        if (utils.isDeprecated(classDoc)) {
21478
fa4c7cda1b41 8026567: Use meaningful style names for strong and italic styles.
bpatel
parents: 19907
diff changeset
   569
            Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
fa4c7cda1b41 8026567: Use meaningful style names for strong and italic styles.
bpatel
parents: 19907
diff changeset
   570
            Content div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   571
            if (deprs.length > 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   572
                Tag[] commentTags = deprs[0].inlineTags();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   573
                if (commentTags.length > 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   574
                    div.addContent(getSpace());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   575
                    addInlineDeprecatedComment(classDoc, deprs[0], div);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   576
                }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   577
            }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   578
            classInfoTree.addContent(div);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   579
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   580
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   581
06bc494ca11e Initial load
duke
parents:
diff changeset
   582
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   583
     * Get links to the given classes.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   584
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   585
     * @param context the id of the context where the link will be printed
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   586
     * @param list the list of classes
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   587
     * @return a content tree for the class list
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   588
     */
26270
a3635e6d3d78 8050031: [javadoc] class-use pages have duplicates and missing entries
ksrini
parents: 25874
diff changeset
   589
    private Content getClassLinks(LinkInfoImpl.Kind context, Collection<?> list) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   590
        Object[] typeList = list.toArray();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   591
        Content dd = new HtmlTree(HtmlTag.DD);
26270
a3635e6d3d78 8050031: [javadoc] class-use pages have duplicates and missing entries
ksrini
parents: 25874
diff changeset
   592
        boolean isFirst = true;
a3635e6d3d78 8050031: [javadoc] class-use pages have duplicates and missing entries
ksrini
parents: 25874
diff changeset
   593
        for (Object item : typeList) {
a3635e6d3d78 8050031: [javadoc] class-use pages have duplicates and missing entries
ksrini
parents: 25874
diff changeset
   594
            if (!isFirst) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   595
                Content separator = new StringContent(", ");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   596
                dd.addContent(separator);
26270
a3635e6d3d78 8050031: [javadoc] class-use pages have duplicates and missing entries
ksrini
parents: 25874
diff changeset
   597
            } else {
a3635e6d3d78 8050031: [javadoc] class-use pages have duplicates and missing entries
ksrini
parents: 25874
diff changeset
   598
                isFirst = false;
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   599
            }
26270
a3635e6d3d78 8050031: [javadoc] class-use pages have duplicates and missing entries
ksrini
parents: 25874
diff changeset
   600
a3635e6d3d78 8050031: [javadoc] class-use pages have duplicates and missing entries
ksrini
parents: 25874
diff changeset
   601
            if (item instanceof ClassDoc) {
a3635e6d3d78 8050031: [javadoc] class-use pages have duplicates and missing entries
ksrini
parents: 25874
diff changeset
   602
                Content link = getLink(new LinkInfoImpl(configuration, context, (ClassDoc)item));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   603
                dd.addContent(link);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   604
            } else {
26270
a3635e6d3d78 8050031: [javadoc] class-use pages have duplicates and missing entries
ksrini
parents: 25874
diff changeset
   605
                Content link = getLink(new LinkInfoImpl(configuration, context, (Type)item));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   606
                dd.addContent(link);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   607
            }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   608
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   609
        return dd;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   610
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   611
06bc494ca11e Initial load
duke
parents:
diff changeset
   612
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   613
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   614
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   615
    protected Content getNavLinkTree() {
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14265
diff changeset
   616
        Content treeLinkContent = getHyperLink(DocPaths.PACKAGE_TREE,
14358
9eda9239cba0 8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents: 14357
diff changeset
   617
                treeLabel, "", "");
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   618
        Content li = HtmlTree.LI(treeLinkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   619
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   620
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   621
06bc494ca11e Initial load
duke
parents:
diff changeset
   622
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   623
     * Add summary details to the navigation bar.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   624
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   625
     * @param subDiv the content tree to which the summary detail links will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   626
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   627
    protected void addSummaryDetailLinks(Content subDiv) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   628
        try {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   629
            Content div = HtmlTree.DIV(getNavSummaryLinks());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   630
            div.addContent(getNavDetailLinks());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   631
            subDiv.addContent(div);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   632
        } catch (Exception e) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   633
            e.printStackTrace();
19667
fdfce85627a9 8001669: javadoc internal DocletAbortException should set cause when appropriate
jjg
parents: 19253
diff changeset
   634
            throw new DocletAbortException(e);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   635
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   636
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   637
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   638
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   639
     * Get summary links for navigation bar.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   640
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   641
     * @return the content tree for the navigation summary links
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   642
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   643
    protected Content getNavSummaryLinks() throws Exception {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   644
        Content li = HtmlTree.LI(summaryLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   645
        li.addContent(getSpace());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   646
        Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   647
        MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   648
                configuration.getBuilderFactory().getMemberSummaryBuilder(this);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   649
        String[] navLinkLabels =  new String[] {
06bc494ca11e Initial load
duke
parents:
diff changeset
   650
            "doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor",
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   651
            "doclet.navMethod"
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   652
        };
06bc494ca11e Initial load
duke
parents:
diff changeset
   653
        for (int i = 0; i < navLinkLabels.length; i++ ) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   654
            Content liNav = new HtmlTree(HtmlTag.LI);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   655
            if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   656
                continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
   657
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   658
            if (i == VisibleMemberMap.CONSTRUCTORS && classDoc.isEnum()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   659
                continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
   660
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   661
            AbstractMemberWriter writer =
06bc494ca11e Initial load
duke
parents:
diff changeset
   662
                ((AbstractMemberWriter) memberSummaryBuilder.
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   663
                getMemberSummaryWriter(i));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   664
            if (writer == null) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   665
                liNav.addContent(getResource(navLinkLabels[i]));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   666
            } else {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   667
                writer.addNavSummaryLink(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   668
                        memberSummaryBuilder.members(i),
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   669
                        memberSummaryBuilder.getVisibleMemberMap(i), liNav);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   670
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   671
            if (i < navLinkLabels.length-1) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   672
                addNavGap(liNav);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   673
            }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   674
            ulNav.addContent(liNav);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   675
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   676
        return ulNav;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   677
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   678
06bc494ca11e Initial load
duke
parents:
diff changeset
   679
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   680
     * Get detail links for the navigation bar.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   681
     *
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   682
     * @return the content tree for the detail links
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   683
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   684
    protected Content getNavDetailLinks() throws Exception {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   685
        Content li = HtmlTree.LI(detailLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   686
        li.addContent(getSpace());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   687
        Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   688
        MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   689
                configuration.getBuilderFactory().getMemberSummaryBuilder(this);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   690
        String[] navLinkLabels =  new String[] {
06bc494ca11e Initial load
duke
parents:
diff changeset
   691
            "doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor",
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   692
            "doclet.navMethod"
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   693
        };
06bc494ca11e Initial load
duke
parents:
diff changeset
   694
        for (int i = 1; i < navLinkLabels.length; i++ ) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   695
            Content liNav = new HtmlTree(HtmlTag.LI);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   696
            AbstractMemberWriter writer =
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   697
                    ((AbstractMemberWriter) memberSummaryBuilder.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   698
                    getMemberSummaryWriter(i));
06bc494ca11e Initial load
duke
parents:
diff changeset
   699
            if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   700
                continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
   701
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   702
            if (i == VisibleMemberMap.CONSTRUCTORS && classDoc.isEnum()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   703
                continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
   704
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   705
            if (writer == null) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   706
                liNav.addContent(getResource(navLinkLabels[i]));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   707
            } else {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   708
                writer.addNavDetailLink(memberSummaryBuilder.members(i), liNav);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   709
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   710
            if (i < navLinkLabels.length - 1) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   711
                addNavGap(liNav);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   712
            }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   713
            ulNav.addContent(liNav);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   714
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   715
        return ulNav;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   716
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   717
06bc494ca11e Initial load
duke
parents:
diff changeset
   718
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   719
     * Add gap between navigation bar elements.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   720
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   721
     * @param liNav the content tree to which the gap will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   722
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   723
    protected void addNavGap(Content liNav) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   724
        liNav.addContent(getSpace());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   725
        liNav.addContent("|");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   726
        liNav.addContent(getSpace());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   727
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   728
06bc494ca11e Initial load
duke
parents:
diff changeset
   729
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   730
     * Return the classDoc being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   731
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   732
     * @return the classDoc being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   733
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   734
    public ClassDoc getClassDoc() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   735
        return classDoc;
06bc494ca11e Initial load
duke
parents:
diff changeset
   736
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   737
}