langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
author ohair
Tue, 25 May 2010 15:54:51 -0700
changeset 5520 86e4b9a9da40
parent 2216 b124d5c924eb
child 7614 cfadc977ca75
permissions -rw-r--r--
6943119: Rebrand source copyright notices Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2216
diff changeset
     2
 * Copyright (c) 1997, 2005, 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.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
import com.sun.tools.doclets.internal.toolkit.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
import com.sun.tools.doclets.internal.toolkit.util.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
import com.sun.tools.doclets.internal.toolkit.builders.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
import com.sun.tools.doclets.internal.toolkit.taglets.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 * Generate the Class Information Page.
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * @see com.sun.javadoc.ClassDoc
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 * @see java.util.Collections
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 * @see java.util.List
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 * @see java.util.ArrayList
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 * @see java.util.HashMap
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 * @author Atul M Dambalkar
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 * @author Robert Field
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
public class ClassWriterImpl extends SubWriterHolderWriter
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
        implements ClassWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
    protected ClassDoc classDoc;
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
    protected ClassTree classtree;
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
    protected ClassDoc prev;
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
    protected ClassDoc next;
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
     * @param classDoc the class being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
     * @param prevClass the previous class that was documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
     * @param nextClass the next class being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
     * @param classTree the class tree for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
    public ClassWriterImpl (ClassDoc classDoc,
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
            ClassDoc prevClass, ClassDoc nextClass, ClassTree classTree)
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
    throws Exception {
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
        super(ConfigurationImpl.getInstance(),
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
              DirectoryManager.getDirectoryPath(classDoc.containingPackage()),
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
              classDoc.name() + ".html",
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
              DirectoryManager.getRelativePath(classDoc.containingPackage().name()));
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
        this.classDoc = classDoc;
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
        configuration.currentcd = classDoc;
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
        this.classtree = classTree;
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
        this.prev = prevClass;
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
        this.next = nextClass;
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
     * Print this package link
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
    protected void navLinkPackage() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
        navCellStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
        printHyperLink("package-summary.html", "",
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
            configuration.getText("doclet.Package"), true, "NavBarFont1");
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
     * Print class page indicator
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
    protected void navLinkClass() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
        navCellRevStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
        fontStyle("NavBarFont1Rev");
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
    94
        strongText("doclet.Class");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
        fontEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
     * Print class use link
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
    protected void navLinkClassUse() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
        navCellStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
        printHyperLink("class-use/" + filename, "",
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
                       configuration.getText("doclet.navClassUse"), true, "NavBarFont1");
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
     * Print previous package link
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
    protected void navLinkPrevious() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
        if (prev == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
            printText("doclet.Prev_Class");
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
            printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, prev, "",
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
                configuration.getText("doclet.Prev_Class"), true));
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
     * Print next package link
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
    protected void navLinkNext() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
        if (next == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
            printText("doclet.Next_Class");
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
            printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, next, "",
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
                configuration.getText("doclet.Next_Class"), true));
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
    public void writeHeader(String header) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
        String pkgname = (classDoc.containingPackage() != null)?
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
            classDoc.containingPackage().name(): "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
        String clname = classDoc.name();
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
        printHtmlHeader(clname,
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
            configuration.metakeywords.getMetaKeywords(classDoc), true);
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
        printTop();
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
        navLinks(true);
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
        hr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
        println("<!-- ======== START OF CLASS DATA ======== -->");
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
        h2();
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
        if (pkgname.length() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
            font("-1"); print(pkgname); fontEnd(); br();
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
        LinkInfoImpl linkInfo = new LinkInfoImpl( LinkInfoImpl.CONTEXT_CLASS_HEADER,
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
            classDoc, false);
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
        //Let's not link to ourselves in the header.
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
        linkInfo.linkToSelf = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
        print(header + getTypeParameterLinks(linkInfo));
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
        h2End();
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
    public void writeFooter() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
        println("<!-- ========= END OF CLASS DATA ========= -->");
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
        hr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
        navLinks(false);
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
        printBottom();
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
        printBodyHtmlEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
    public void writeClassSignature(String modifiers) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
        boolean isInterface = classDoc.isInterface();
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
        preNoNewLine();
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
        writeAnnotationInfo(classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
        print(modifiers);
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
        LinkInfoImpl linkInfo = new LinkInfoImpl(
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
            LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, classDoc, false);
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
        //Let's not link to ourselves in the signature.
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
        linkInfo.linkToSelf = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
        String name = classDoc.name() +
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
            getTypeParameterLinks(linkInfo);
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
        if (configuration().linksource) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
            printSrcLink(classDoc, name);
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
        } else {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   186
            strong(name);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
        if (!isInterface) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
            Type superclass = Util.getFirstVisibleSuperClass(classDoc,
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
                configuration());
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
            if (superclass != null) {
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   192
                println();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
                print("extends ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
                printLink(new LinkInfoImpl(
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
                    LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME,
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
                    superclass));
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
        Type[] implIntfacs = classDoc.interfaceTypes();
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
        if (implIntfacs != null && implIntfacs.length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
            int counter = 0;
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
            for (int i = 0; i < implIntfacs.length; i++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
                ClassDoc classDoc = implIntfacs[i].asClassDoc();
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
                if (! (classDoc.isPublic() ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
                    Util.isLinkable(classDoc, configuration()))) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
                    continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
                if (counter == 0) {
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   209
                    println();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
                    print(isInterface? "extends " : "implements ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
                } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
                    print(", ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
                printLink(new LinkInfoImpl(
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
                    LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME,
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
                    implIntfacs[i]));
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
                counter++;
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
        preEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
        p();
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
    public void writeClassDescription() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
        if(!configuration.nocomment) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
            // generate documentation for the class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
            if (classDoc.inlineTags().length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
                printInlineComment(classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
                p();
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
    public void writeClassTagInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
        if(!configuration.nocomment) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
            // Print Information about all the tags here
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
            printTags(classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
            hr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
            p();
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
            hr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
    public void writeClassDeprecationInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
        hr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
        Tag[] deprs = classDoc.tags("deprecated");
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
        if (Util.isDeprecated(classDoc)) {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   258
            strongText("doclet.Deprecated");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
            if (deprs.length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
                Tag[] commentTags = deprs[0].inlineTags();
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
                if (commentTags.length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
                    space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
                    printInlineDeprecatedComment(classDoc, deprs[0]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
            p();
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
     * Generate the indent and get the line image for the class tree.
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
     * For user accessibility, the image includes the alt attribute
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
     * "extended by".  (This method is not intended for a class
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
     * implementing an interface, where "implemented by" would be required.)
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
     * indent  integer indicating the number of spaces to indent
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
    private void writeStep(int indent) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
        print(spaces(4 * indent - 2));
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
        print("<IMG SRC=\"" + relativepathNoSlash + "/resources/inherit.gif\" " +
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
              "ALT=\"" + configuration.getText("doclet.extended_by") + " \">");
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
     * Print the class hierarchy tree for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
     * @param type the class to print the hierarchy for.
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
     * @return return the amount that should be indented in
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
     * the next level of the tree.
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
    private int writeTreeForClassHelper(Type type) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
        Type sup = Util.getFirstVisibleSuperClass(
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
            type instanceof ClassDoc ? (ClassDoc) type : type.asClassDoc(),
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
            configuration());
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
        int indent = 0;
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
        if (sup != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
            indent = writeTreeForClassHelper(sup);
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
            writeStep(indent);
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
        if (type.equals(classDoc)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
            String typeParameters = getTypeParameterLinks(
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
                new LinkInfoImpl(
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
                    LinkInfoImpl.CONTEXT_TREE,
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
                    classDoc, false));
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
            if (configuration.shouldExcludeQualifier(
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
                    classDoc.containingPackage().name())) {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   307
                strong(type.asClassDoc().name() + typeParameters);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   308
            } else {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   309
                strong(type.asClassDoc().qualifiedName() + typeParameters);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   310
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   311
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   312
            print(getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_TREE_PARENT,
06bc494ca11e Initial load
duke
parents:
diff changeset
   313
                    type instanceof ClassDoc ? (ClassDoc) type : type,
06bc494ca11e Initial load
duke
parents:
diff changeset
   314
                    configuration.getClassName(type.asClassDoc()), false)));
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   316
        println();
06bc494ca11e Initial load
duke
parents:
diff changeset
   317
        return indent + 1;
06bc494ca11e Initial load
duke
parents:
diff changeset
   318
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   319
06bc494ca11e Initial load
duke
parents:
diff changeset
   320
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   321
     * Print the class hierarchy tree for this class only.
06bc494ca11e Initial load
duke
parents:
diff changeset
   322
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   323
    public void writeClassTree() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   324
        if (! classDoc.isClass()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   325
            return;
06bc494ca11e Initial load
duke
parents:
diff changeset
   326
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   327
        pre();
06bc494ca11e Initial load
duke
parents:
diff changeset
   328
        writeTreeForClassHelper(classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   329
        preEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   330
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   331
06bc494ca11e Initial load
duke
parents:
diff changeset
   332
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   333
     * Write the type parameter information.
06bc494ca11e Initial load
duke
parents:
diff changeset
   334
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   335
    public void writeTypeParamInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   336
        if (classDoc.typeParamTags().length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   337
            dl();
06bc494ca11e Initial load
duke
parents:
diff changeset
   338
            dt();
06bc494ca11e Initial load
duke
parents:
diff changeset
   339
            TagletOutput output = (new ParamTaglet()).getTagletOutput(classDoc,
06bc494ca11e Initial load
duke
parents:
diff changeset
   340
                getTagletWriterInstance(false));
06bc494ca11e Initial load
duke
parents:
diff changeset
   341
            print(output.toString());
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   342
            dtEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   343
            dlEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   344
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   345
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   346
06bc494ca11e Initial load
duke
parents:
diff changeset
   347
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   348
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   349
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   350
    public void writeSubClassInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   351
        if (classDoc.isClass()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   352
            if (classDoc.qualifiedName().equals("java.lang.Object") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   353
                classDoc.qualifiedName().equals("org.omg.CORBA.Object")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   354
                return;    // Don't generate the list, too huge
06bc494ca11e Initial load
duke
parents:
diff changeset
   355
            }
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
   356
            List<ClassDoc> subclasses = classtree.subs(classDoc, false);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   357
            if (subclasses.size() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   358
                dl();
06bc494ca11e Initial load
duke
parents:
diff changeset
   359
                dt();
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   360
                strongText("doclet.Subclasses");
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   361
                dtEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   362
                writeClassLinks(LinkInfoImpl.CONTEXT_SUBCLASSES,
06bc494ca11e Initial load
duke
parents:
diff changeset
   363
                    subclasses);
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   364
                dlEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   365
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   366
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   367
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   368
06bc494ca11e Initial load
duke
parents:
diff changeset
   369
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   370
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   371
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   372
    public void writeSubInterfacesInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   373
        if (classDoc.isInterface()) {
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
   374
            List<ClassDoc> subInterfaces = classtree.allSubs(classDoc, false);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   375
            if (subInterfaces.size() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   376
                dl();
06bc494ca11e Initial load
duke
parents:
diff changeset
   377
                dt();
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   378
                strongText("doclet.Subinterfaces");
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   379
                dtEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   380
                writeClassLinks(LinkInfoImpl.CONTEXT_SUBINTERFACES,
06bc494ca11e Initial load
duke
parents:
diff changeset
   381
                    subInterfaces);
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   382
                dlEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   383
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   384
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   385
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   386
06bc494ca11e Initial load
duke
parents:
diff changeset
   387
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   388
     * If this is the interface which are the classes, that implement this?
06bc494ca11e Initial load
duke
parents:
diff changeset
   389
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   390
    public void writeInterfaceUsageInfo () {
06bc494ca11e Initial load
duke
parents:
diff changeset
   391
        if (! classDoc.isInterface()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   392
            return;
06bc494ca11e Initial load
duke
parents:
diff changeset
   393
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   394
        if (classDoc.qualifiedName().equals("java.lang.Cloneable") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   395
            classDoc.qualifiedName().equals("java.io.Serializable")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   396
            return;   // Don't generate the list, too big
06bc494ca11e Initial load
duke
parents:
diff changeset
   397
        }
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
   398
        List<ClassDoc> implcl = classtree.implementingclasses(classDoc);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   399
        if (implcl.size() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   400
            dl();
06bc494ca11e Initial load
duke
parents:
diff changeset
   401
            dt();
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   402
            strongText("doclet.Implementing_Classes");
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   403
            dtEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   404
            writeClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_CLASSES,
06bc494ca11e Initial load
duke
parents:
diff changeset
   405
                implcl);
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   406
            dlEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   407
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   408
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   409
06bc494ca11e Initial load
duke
parents:
diff changeset
   410
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   411
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   412
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   413
    public void writeImplementedInterfacesInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   414
        //NOTE:  we really should be using ClassDoc.interfaceTypes() here, but
06bc494ca11e Initial load
duke
parents:
diff changeset
   415
        //       it doesn't walk up the tree like we want it to.
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
   416
        List<Type> interfaceArray = Util.getAllInterfaces(classDoc, configuration);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   417
        if (classDoc.isClass() && interfaceArray.size() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   418
            dl();
06bc494ca11e Initial load
duke
parents:
diff changeset
   419
            dt();
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   420
            strongText("doclet.All_Implemented_Interfaces");
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   421
            dtEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   422
            writeClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_INTERFACES,
06bc494ca11e Initial load
duke
parents:
diff changeset
   423
                interfaceArray);
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   424
            dlEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   425
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   426
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   427
06bc494ca11e Initial load
duke
parents:
diff changeset
   428
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   429
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   430
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   431
    public void writeSuperInterfacesInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   432
        //NOTE:  we really should be using ClassDoc.interfaceTypes() here, but
06bc494ca11e Initial load
duke
parents:
diff changeset
   433
        //       it doesn't walk up the tree like we want it to.
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
   434
        List<Type> interfaceArray = Util.getAllInterfaces(classDoc, configuration);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   435
        if (classDoc.isInterface() && interfaceArray.size() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   436
            dl();
06bc494ca11e Initial load
duke
parents:
diff changeset
   437
            dt();
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   438
            strongText("doclet.All_Superinterfaces");
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   439
            dtEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   440
            writeClassLinks(LinkInfoImpl.CONTEXT_SUPER_INTERFACES,
06bc494ca11e Initial load
duke
parents:
diff changeset
   441
                interfaceArray);
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   442
            dlEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   443
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   444
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   445
06bc494ca11e Initial load
duke
parents:
diff changeset
   446
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   447
     * Generate links to the given classes.
06bc494ca11e Initial load
duke
parents:
diff changeset
   448
     */
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
   449
    private void writeClassLinks(int context, List<?> list) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   450
        Object[] typeList = list.toArray();
06bc494ca11e Initial load
duke
parents:
diff changeset
   451
        //Sort the list to be printed.
06bc494ca11e Initial load
duke
parents:
diff changeset
   452
        print(' ');
06bc494ca11e Initial load
duke
parents:
diff changeset
   453
        dd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   454
        for (int i = 0; i < list.size(); i++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   455
            if (i > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   456
                print(", ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   457
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   458
            if (typeList[i] instanceof ClassDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   459
                printLink(new LinkInfoImpl(context, (ClassDoc)(typeList[i])));
06bc494ca11e Initial load
duke
parents:
diff changeset
   460
06bc494ca11e Initial load
duke
parents:
diff changeset
   461
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   462
                printLink(new LinkInfoImpl(context, (Type)(typeList[i])));
06bc494ca11e Initial load
duke
parents:
diff changeset
   463
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   464
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   465
        ddEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   466
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   467
06bc494ca11e Initial load
duke
parents:
diff changeset
   468
    protected void navLinkTree() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   469
        navCellStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
   470
        printHyperLink("package-tree.html", "",
06bc494ca11e Initial load
duke
parents:
diff changeset
   471
            configuration.getText("doclet.Tree"), true, "NavBarFont1");
06bc494ca11e Initial load
duke
parents:
diff changeset
   472
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   473
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   474
06bc494ca11e Initial load
duke
parents:
diff changeset
   475
    protected void printSummaryDetailLinks() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   476
        try {
06bc494ca11e Initial load
duke
parents:
diff changeset
   477
            tr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   478
            tdVAlignClass("top", "NavBarCell3");
06bc494ca11e Initial load
duke
parents:
diff changeset
   479
            font("-2");
06bc494ca11e Initial load
duke
parents:
diff changeset
   480
            print("  ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   481
            navSummaryLinks();
06bc494ca11e Initial load
duke
parents:
diff changeset
   482
            fontEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   483
            tdEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   484
            tdVAlignClass("top", "NavBarCell3");
06bc494ca11e Initial load
duke
parents:
diff changeset
   485
            font("-2");
06bc494ca11e Initial load
duke
parents:
diff changeset
   486
            navDetailLinks();
06bc494ca11e Initial load
duke
parents:
diff changeset
   487
            fontEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   488
            tdEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   489
            trEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   490
        } catch (Exception e) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   491
            e.printStackTrace();
06bc494ca11e Initial load
duke
parents:
diff changeset
   492
            throw new DocletAbortException();
06bc494ca11e Initial load
duke
parents:
diff changeset
   493
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   494
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   495
06bc494ca11e Initial load
duke
parents:
diff changeset
   496
    protected void navSummaryLinks() throws Exception {
06bc494ca11e Initial load
duke
parents:
diff changeset
   497
        printText("doclet.Summary");
06bc494ca11e Initial load
duke
parents:
diff changeset
   498
        space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   499
        MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
06bc494ca11e Initial load
duke
parents:
diff changeset
   500
            configuration.getBuilderFactory().getMemberSummaryBuilder(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
   501
        String[] navLinkLabels =  new String[] {
06bc494ca11e Initial load
duke
parents:
diff changeset
   502
            "doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor",
06bc494ca11e Initial load
duke
parents:
diff changeset
   503
                "doclet.navMethod"
06bc494ca11e Initial load
duke
parents:
diff changeset
   504
        };
06bc494ca11e Initial load
duke
parents:
diff changeset
   505
        for (int i = 0; i < navLinkLabels.length; i++ ) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   506
            if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   507
                continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
   508
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   509
            if (i == VisibleMemberMap.CONSTRUCTORS && classDoc.isEnum()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   510
                continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
   511
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   512
            AbstractMemberWriter writer =
06bc494ca11e Initial load
duke
parents:
diff changeset
   513
                ((AbstractMemberWriter) memberSummaryBuilder.
06bc494ca11e Initial load
duke
parents:
diff changeset
   514
                    getMemberSummaryWriter(i));
06bc494ca11e Initial load
duke
parents:
diff changeset
   515
            if (writer == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   516
                printText(navLinkLabels[i]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   517
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   518
                writer.navSummaryLink(
06bc494ca11e Initial load
duke
parents:
diff changeset
   519
                    memberSummaryBuilder.members(i),
06bc494ca11e Initial load
duke
parents:
diff changeset
   520
                    memberSummaryBuilder.getVisibleMemberMap(i));
06bc494ca11e Initial load
duke
parents:
diff changeset
   521
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   522
            if (i < navLinkLabels.length-1) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   523
                navGap();
06bc494ca11e Initial load
duke
parents:
diff changeset
   524
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   525
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   526
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   527
06bc494ca11e Initial load
duke
parents:
diff changeset
   528
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   529
     * Method navDetailLinks
06bc494ca11e Initial load
duke
parents:
diff changeset
   530
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   531
     * @throws   Exception
06bc494ca11e Initial load
duke
parents:
diff changeset
   532
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   533
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   534
    protected void navDetailLinks() throws Exception {
06bc494ca11e Initial load
duke
parents:
diff changeset
   535
        printText("doclet.Detail");
06bc494ca11e Initial load
duke
parents:
diff changeset
   536
        space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   537
        MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
06bc494ca11e Initial load
duke
parents:
diff changeset
   538
            configuration.getBuilderFactory().getMemberSummaryBuilder(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
   539
        String[] navLinkLabels =  new String[] {
06bc494ca11e Initial load
duke
parents:
diff changeset
   540
            "doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor",
06bc494ca11e Initial load
duke
parents:
diff changeset
   541
                "doclet.navMethod"
06bc494ca11e Initial load
duke
parents:
diff changeset
   542
        };
06bc494ca11e Initial load
duke
parents:
diff changeset
   543
        for (int i = 1; i < navLinkLabels.length; i++ ) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   544
            AbstractMemberWriter writer =
06bc494ca11e Initial load
duke
parents:
diff changeset
   545
                ((AbstractMemberWriter) memberSummaryBuilder.
06bc494ca11e Initial load
duke
parents:
diff changeset
   546
                    getMemberSummaryWriter(i));
06bc494ca11e Initial load
duke
parents:
diff changeset
   547
            if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   548
                continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
   549
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   550
            if (i == VisibleMemberMap.CONSTRUCTORS && classDoc.isEnum()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   551
                continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
   552
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   553
            if (writer == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   554
                printText(navLinkLabels[i]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   555
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   556
                writer.navDetailLink(memberSummaryBuilder.members(i));
06bc494ca11e Initial load
duke
parents:
diff changeset
   557
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   558
            if (i < navLinkLabels.length - 1) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   559
                navGap();
06bc494ca11e Initial load
duke
parents:
diff changeset
   560
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   561
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   562
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   563
06bc494ca11e Initial load
duke
parents:
diff changeset
   564
    protected void navGap() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   565
        space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   566
        print('|');
06bc494ca11e Initial load
duke
parents:
diff changeset
   567
        space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   568
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   569
06bc494ca11e Initial load
duke
parents:
diff changeset
   570
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   571
     * If this is an inner class or interface, write the enclosing class or
06bc494ca11e Initial load
duke
parents:
diff changeset
   572
     * interface.
06bc494ca11e Initial load
duke
parents:
diff changeset
   573
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   574
    public void writeNestedClassInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   575
        ClassDoc outerClass = classDoc.containingClass();
06bc494ca11e Initial load
duke
parents:
diff changeset
   576
        if (outerClass != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   577
            dl();
06bc494ca11e Initial load
duke
parents:
diff changeset
   578
            dt();
06bc494ca11e Initial load
duke
parents:
diff changeset
   579
            if (outerClass.isInterface()) {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   580
                strongText("doclet.Enclosing_Interface");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   581
            } else {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   582
                strongText("doclet.Enclosing_Class");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   583
            }
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   584
            dtEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   585
            dd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   586
            printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, outerClass,
06bc494ca11e Initial load
duke
parents:
diff changeset
   587
                false));
06bc494ca11e Initial load
duke
parents:
diff changeset
   588
            ddEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   589
            dlEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   590
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   591
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   592
06bc494ca11e Initial load
duke
parents:
diff changeset
   593
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   594
     * Return the classDoc being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   595
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   596
     * @return the classDoc being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   597
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   598
    public ClassDoc getClassDoc() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   599
        return classDoc;
06bc494ca11e Initial load
duke
parents:
diff changeset
   600
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   601
06bc494ca11e Initial load
duke
parents:
diff changeset
   602
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   603
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   604
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   605
    public void completeMemberSummaryBuild() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   606
        p();
06bc494ca11e Initial load
duke
parents:
diff changeset
   607
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   608
}