langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
author mcimadamore
Tue, 13 Jan 2009 13:27:14 +0000
changeset 1789 7ac8c0815000
parent 1787 1aa079321cd2
child 2216 b124d5c924eb
permissions -rw-r--r--
6765045: Remove rawtypes warnings from langtools Summary: Removed all occurrences of rawtypes warnings from langtools Reviewed-by: jjg, bpatel
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
06bc494ca11e Initial load
duke
parents:
diff changeset
     2
 * Copyright 1997-2005 Sun Microsystems, Inc.  All Rights Reserved.
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
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
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
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
 * have any questions.
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
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
import com.sun.tools.doclets.internal.toolkit.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
import com.sun.tools.doclets.internal.toolkit.util.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
import com.sun.tools.doclets.internal.toolkit.builders.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
import com.sun.javadoc.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
import java.util.*;
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
        dl();
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
        dt();
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
        preNoNewLine();
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
        writeAnnotationInfo(classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
        print(modifiers);
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
        LinkInfoImpl linkInfo = new LinkInfoImpl(
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
            LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, classDoc, false);
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
        //Let's not link to ourselves in the signature.
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
        linkInfo.linkToSelf = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
        String name = classDoc.name() +
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
            getTypeParameterLinks(linkInfo);
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
        if (configuration().linksource) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
            printSrcLink(classDoc, name);
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
        } else {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   188
            strong(name);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
        if (!isInterface) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
            Type superclass = Util.getFirstVisibleSuperClass(classDoc,
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
                configuration());
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
            if (superclass != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
                dt();
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
                print("extends ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
                printLink(new LinkInfoImpl(
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
                    LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME,
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
                    superclass));
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
        Type[] implIntfacs = classDoc.interfaceTypes();
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
        if (implIntfacs != null && implIntfacs.length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
            int counter = 0;
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
            for (int i = 0; i < implIntfacs.length; i++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
                ClassDoc classDoc = implIntfacs[i].asClassDoc();
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
                if (! (classDoc.isPublic() ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
                    Util.isLinkable(classDoc, configuration()))) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
                    continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
                if (counter == 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
                    dt();
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
                    print(isInterface? "extends " : "implements ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
                } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
                    print(", ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
                printLink(new LinkInfoImpl(
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
                    LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME,
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
                    implIntfacs[i]));
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
                counter++;
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
        dlEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
        preEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
        p();
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
    public void writeClassDescription() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
        if(!configuration.nocomment) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
            // generate documentation for the class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
            if (classDoc.inlineTags().length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
                printInlineComment(classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
                p();
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
    public void writeClassTagInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
        if(!configuration.nocomment) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
            // Print Information about all the tags here
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
            printTags(classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
            hr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
            p();
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
            hr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
    public void writeClassDeprecationInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
        hr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
        Tag[] deprs = classDoc.tags("deprecated");
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
        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
   261
            strongText("doclet.Deprecated");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
            if (deprs.length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
                Tag[] commentTags = deprs[0].inlineTags();
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
                if (commentTags.length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
                    space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
                    printInlineDeprecatedComment(classDoc, deprs[0]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
            p();
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
     * Generate the indent and get the line image for the class tree.
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
     * For user accessibility, the image includes the alt attribute
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
     * "extended by".  (This method is not intended for a class
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
     * implementing an interface, where "implemented by" would be required.)
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
     * indent  integer indicating the number of spaces to indent
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
    private void writeStep(int indent) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
        print(spaces(4 * indent - 2));
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
        print("<IMG SRC=\"" + relativepathNoSlash + "/resources/inherit.gif\" " +
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
              "ALT=\"" + configuration.getText("doclet.extended_by") + " \">");
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
     * Print the class hierarchy tree for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
     * @param type the class to print the hierarchy for.
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
     * @return return the amount that should be indented in
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
     * the next level of the tree.
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
    private int writeTreeForClassHelper(Type type) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
        Type sup = Util.getFirstVisibleSuperClass(
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
            type instanceof ClassDoc ? (ClassDoc) type : type.asClassDoc(),
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
            configuration());
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
        int indent = 0;
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
        if (sup != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
            indent = writeTreeForClassHelper(sup);
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
            writeStep(indent);
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
        if (type.equals(classDoc)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
            String typeParameters = getTypeParameterLinks(
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
                new LinkInfoImpl(
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
                    LinkInfoImpl.CONTEXT_TREE,
06bc494ca11e Initial load
duke
parents:
diff changeset
   307
                    classDoc, false));
06bc494ca11e Initial load
duke
parents:
diff changeset
   308
            if (configuration.shouldExcludeQualifier(
06bc494ca11e Initial load
duke
parents:
diff changeset
   309
                    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
   310
                strong(type.asClassDoc().name() + typeParameters);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   311
            } else {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   312
                strong(type.asClassDoc().qualifiedName() + typeParameters);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   313
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   314
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
            print(getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_TREE_PARENT,
06bc494ca11e Initial load
duke
parents:
diff changeset
   316
                    type instanceof ClassDoc ? (ClassDoc) type : type,
06bc494ca11e Initial load
duke
parents:
diff changeset
   317
                    configuration.getClassName(type.asClassDoc()), false)));
06bc494ca11e Initial load
duke
parents:
diff changeset
   318
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   319
        println();
06bc494ca11e Initial load
duke
parents:
diff changeset
   320
        return indent + 1;
06bc494ca11e Initial load
duke
parents:
diff changeset
   321
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   322
06bc494ca11e Initial load
duke
parents:
diff changeset
   323
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   324
     * Print the class hierarchy tree for this class only.
06bc494ca11e Initial load
duke
parents:
diff changeset
   325
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   326
    public void writeClassTree() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   327
        if (! classDoc.isClass()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   328
            return;
06bc494ca11e Initial load
duke
parents:
diff changeset
   329
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   330
        pre();
06bc494ca11e Initial load
duke
parents:
diff changeset
   331
        writeTreeForClassHelper(classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   332
        preEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   333
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   334
06bc494ca11e Initial load
duke
parents:
diff changeset
   335
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   336
     * Write the type parameter information.
06bc494ca11e Initial load
duke
parents:
diff changeset
   337
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   338
    public void writeTypeParamInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   339
        if (classDoc.typeParamTags().length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   340
            dl();
06bc494ca11e Initial load
duke
parents:
diff changeset
   341
            dt();
06bc494ca11e Initial load
duke
parents:
diff changeset
   342
            TagletOutput output = (new ParamTaglet()).getTagletOutput(classDoc,
06bc494ca11e Initial load
duke
parents:
diff changeset
   343
                getTagletWriterInstance(false));
06bc494ca11e Initial load
duke
parents:
diff changeset
   344
            print(output.toString());
06bc494ca11e Initial load
duke
parents:
diff changeset
   345
            dlEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   346
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   347
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   348
06bc494ca11e Initial load
duke
parents:
diff changeset
   349
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   350
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   351
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   352
    public void writeSubClassInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   353
        if (classDoc.isClass()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   354
            if (classDoc.qualifiedName().equals("java.lang.Object") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   355
                classDoc.qualifiedName().equals("org.omg.CORBA.Object")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   356
                return;    // Don't generate the list, too huge
06bc494ca11e Initial load
duke
parents:
diff changeset
   357
            }
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
   358
            List<ClassDoc> subclasses = classtree.subs(classDoc, false);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   359
            if (subclasses.size() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   360
                dl();
06bc494ca11e Initial load
duke
parents:
diff changeset
   361
                dt();
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   362
                strongText("doclet.Subclasses");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   363
                writeClassLinks(LinkInfoImpl.CONTEXT_SUBCLASSES,
06bc494ca11e Initial load
duke
parents:
diff changeset
   364
                    subclasses);
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");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   379
                writeClassLinks(LinkInfoImpl.CONTEXT_SUBINTERFACES,
06bc494ca11e Initial load
duke
parents:
diff changeset
   380
                    subInterfaces);
06bc494ca11e Initial load
duke
parents:
diff changeset
   381
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   382
        }
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
     * If this is the interface which are the classes, that implement this?
06bc494ca11e Initial load
duke
parents:
diff changeset
   387
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   388
    public void writeInterfaceUsageInfo () {
06bc494ca11e Initial load
duke
parents:
diff changeset
   389
        if (! classDoc.isInterface()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   390
            return;
06bc494ca11e Initial load
duke
parents:
diff changeset
   391
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   392
        if (classDoc.qualifiedName().equals("java.lang.Cloneable") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   393
            classDoc.qualifiedName().equals("java.io.Serializable")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   394
            return;   // Don't generate the list, too big
06bc494ca11e Initial load
duke
parents:
diff changeset
   395
        }
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
   396
        List<ClassDoc> implcl = classtree.implementingclasses(classDoc);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   397
        if (implcl.size() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   398
            dl();
06bc494ca11e Initial load
duke
parents:
diff changeset
   399
            dt();
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   400
            strongText("doclet.Implementing_Classes");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   401
            writeClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_CLASSES,
06bc494ca11e Initial load
duke
parents:
diff changeset
   402
                implcl);
06bc494ca11e Initial load
duke
parents:
diff changeset
   403
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   404
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   405
06bc494ca11e Initial load
duke
parents:
diff changeset
   406
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   407
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   408
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   409
    public void writeImplementedInterfacesInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   410
        //NOTE:  we really should be using ClassDoc.interfaceTypes() here, but
06bc494ca11e Initial load
duke
parents:
diff changeset
   411
        //       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
   412
        List<Type> interfaceArray = Util.getAllInterfaces(classDoc, configuration);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   413
        if (classDoc.isClass() && interfaceArray.size() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   414
            dl();
06bc494ca11e Initial load
duke
parents:
diff changeset
   415
            dt();
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   416
            strongText("doclet.All_Implemented_Interfaces");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   417
            writeClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_INTERFACES,
06bc494ca11e Initial load
duke
parents:
diff changeset
   418
                interfaceArray);
06bc494ca11e Initial load
duke
parents:
diff changeset
   419
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   420
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   421
06bc494ca11e Initial load
duke
parents:
diff changeset
   422
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   423
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   424
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   425
    public void writeSuperInterfacesInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   426
        //NOTE:  we really should be using ClassDoc.interfaceTypes() here, but
06bc494ca11e Initial load
duke
parents:
diff changeset
   427
        //       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
   428
        List<Type> interfaceArray = Util.getAllInterfaces(classDoc, configuration);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   429
        if (classDoc.isInterface() && interfaceArray.size() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   430
            dl();
06bc494ca11e Initial load
duke
parents:
diff changeset
   431
            dt();
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   432
            strongText("doclet.All_Superinterfaces");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   433
            writeClassLinks(LinkInfoImpl.CONTEXT_SUPER_INTERFACES,
06bc494ca11e Initial load
duke
parents:
diff changeset
   434
                interfaceArray);
06bc494ca11e Initial load
duke
parents:
diff changeset
   435
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   436
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   437
06bc494ca11e Initial load
duke
parents:
diff changeset
   438
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   439
     * Generate links to the given classes.
06bc494ca11e Initial load
duke
parents:
diff changeset
   440
     */
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
   441
    private void writeClassLinks(int context, List<?> list) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   442
        Object[] typeList = list.toArray();
06bc494ca11e Initial load
duke
parents:
diff changeset
   443
        //Sort the list to be printed.
06bc494ca11e Initial load
duke
parents:
diff changeset
   444
        print(' ');
06bc494ca11e Initial load
duke
parents:
diff changeset
   445
        dd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   446
        for (int i = 0; i < list.size(); i++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   447
            if (i > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   448
                print(", ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   449
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   450
            if (typeList[i] instanceof ClassDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   451
                printLink(new LinkInfoImpl(context, (ClassDoc)(typeList[i])));
06bc494ca11e Initial load
duke
parents:
diff changeset
   452
06bc494ca11e Initial load
duke
parents:
diff changeset
   453
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   454
                printLink(new LinkInfoImpl(context, (Type)(typeList[i])));
06bc494ca11e Initial load
duke
parents:
diff changeset
   455
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   456
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   457
        ddEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   458
        dlEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   459
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   460
06bc494ca11e Initial load
duke
parents:
diff changeset
   461
    protected void navLinkTree() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   462
        navCellStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
   463
        printHyperLink("package-tree.html", "",
06bc494ca11e Initial load
duke
parents:
diff changeset
   464
            configuration.getText("doclet.Tree"), true, "NavBarFont1");
06bc494ca11e Initial load
duke
parents:
diff changeset
   465
        navCellEnd();
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 printSummaryDetailLinks() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   469
        try {
06bc494ca11e Initial load
duke
parents:
diff changeset
   470
            tr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   471
            tdVAlignClass("top", "NavBarCell3");
06bc494ca11e Initial load
duke
parents:
diff changeset
   472
            font("-2");
06bc494ca11e Initial load
duke
parents:
diff changeset
   473
            print("  ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   474
            navSummaryLinks();
06bc494ca11e Initial load
duke
parents:
diff changeset
   475
            fontEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   476
            tdEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   477
            tdVAlignClass("top", "NavBarCell3");
06bc494ca11e Initial load
duke
parents:
diff changeset
   478
            font("-2");
06bc494ca11e Initial load
duke
parents:
diff changeset
   479
            navDetailLinks();
06bc494ca11e Initial load
duke
parents:
diff changeset
   480
            fontEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   481
            tdEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   482
            trEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   483
        } catch (Exception e) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   484
            e.printStackTrace();
06bc494ca11e Initial load
duke
parents:
diff changeset
   485
            throw new DocletAbortException();
06bc494ca11e Initial load
duke
parents:
diff changeset
   486
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   487
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   488
06bc494ca11e Initial load
duke
parents:
diff changeset
   489
    protected void navSummaryLinks() throws Exception {
06bc494ca11e Initial load
duke
parents:
diff changeset
   490
        printText("doclet.Summary");
06bc494ca11e Initial load
duke
parents:
diff changeset
   491
        space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   492
        MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
06bc494ca11e Initial load
duke
parents:
diff changeset
   493
            configuration.getBuilderFactory().getMemberSummaryBuilder(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
   494
        String[] navLinkLabels =  new String[] {
06bc494ca11e Initial load
duke
parents:
diff changeset
   495
            "doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor",
06bc494ca11e Initial load
duke
parents:
diff changeset
   496
                "doclet.navMethod"
06bc494ca11e Initial load
duke
parents:
diff changeset
   497
        };
06bc494ca11e Initial load
duke
parents:
diff changeset
   498
        for (int i = 0; i < navLinkLabels.length; i++ ) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   499
            if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   500
                continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
   501
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   502
            if (i == VisibleMemberMap.CONSTRUCTORS && classDoc.isEnum()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   503
                continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
   504
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   505
            AbstractMemberWriter writer =
06bc494ca11e Initial load
duke
parents:
diff changeset
   506
                ((AbstractMemberWriter) memberSummaryBuilder.
06bc494ca11e Initial load
duke
parents:
diff changeset
   507
                    getMemberSummaryWriter(i));
06bc494ca11e Initial load
duke
parents:
diff changeset
   508
            if (writer == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   509
                printText(navLinkLabels[i]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   510
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   511
                writer.navSummaryLink(
06bc494ca11e Initial load
duke
parents:
diff changeset
   512
                    memberSummaryBuilder.members(i),
06bc494ca11e Initial load
duke
parents:
diff changeset
   513
                    memberSummaryBuilder.getVisibleMemberMap(i));
06bc494ca11e Initial load
duke
parents:
diff changeset
   514
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   515
            if (i < navLinkLabels.length-1) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   516
                navGap();
06bc494ca11e Initial load
duke
parents:
diff changeset
   517
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   518
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   519
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   520
06bc494ca11e Initial load
duke
parents:
diff changeset
   521
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   522
     * Method navDetailLinks
06bc494ca11e Initial load
duke
parents:
diff changeset
   523
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   524
     * @throws   Exception
06bc494ca11e Initial load
duke
parents:
diff changeset
   525
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   526
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   527
    protected void navDetailLinks() throws Exception {
06bc494ca11e Initial load
duke
parents:
diff changeset
   528
        printText("doclet.Detail");
06bc494ca11e Initial load
duke
parents:
diff changeset
   529
        space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   530
        MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
06bc494ca11e Initial load
duke
parents:
diff changeset
   531
            configuration.getBuilderFactory().getMemberSummaryBuilder(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
   532
        String[] navLinkLabels =  new String[] {
06bc494ca11e Initial load
duke
parents:
diff changeset
   533
            "doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor",
06bc494ca11e Initial load
duke
parents:
diff changeset
   534
                "doclet.navMethod"
06bc494ca11e Initial load
duke
parents:
diff changeset
   535
        };
06bc494ca11e Initial load
duke
parents:
diff changeset
   536
        for (int i = 1; i < navLinkLabels.length; i++ ) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   537
            AbstractMemberWriter writer =
06bc494ca11e Initial load
duke
parents:
diff changeset
   538
                ((AbstractMemberWriter) memberSummaryBuilder.
06bc494ca11e Initial load
duke
parents:
diff changeset
   539
                    getMemberSummaryWriter(i));
06bc494ca11e Initial load
duke
parents:
diff changeset
   540
            if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   541
                continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
   542
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   543
            if (i == VisibleMemberMap.CONSTRUCTORS && classDoc.isEnum()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   544
                continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
   545
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   546
            if (writer == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   547
                printText(navLinkLabels[i]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   548
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   549
                writer.navDetailLink(memberSummaryBuilder.members(i));
06bc494ca11e Initial load
duke
parents:
diff changeset
   550
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   551
            if (i < navLinkLabels.length - 1) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   552
                navGap();
06bc494ca11e Initial load
duke
parents:
diff changeset
   553
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   554
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   555
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   556
06bc494ca11e Initial load
duke
parents:
diff changeset
   557
    protected void navGap() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   558
        space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   559
        print('|');
06bc494ca11e Initial load
duke
parents:
diff changeset
   560
        space();
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
     * If this is an inner class or interface, write the enclosing class or
06bc494ca11e Initial load
duke
parents:
diff changeset
   565
     * interface.
06bc494ca11e Initial load
duke
parents:
diff changeset
   566
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   567
    public void writeNestedClassInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   568
        ClassDoc outerClass = classDoc.containingClass();
06bc494ca11e Initial load
duke
parents:
diff changeset
   569
        if (outerClass != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   570
            dl();
06bc494ca11e Initial load
duke
parents:
diff changeset
   571
            dt();
06bc494ca11e Initial load
duke
parents:
diff changeset
   572
            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
   573
                strongText("doclet.Enclosing_Interface");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   574
            } else {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   575
                strongText("doclet.Enclosing_Class");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   576
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   577
            dd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   578
            printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, outerClass,
06bc494ca11e Initial load
duke
parents:
diff changeset
   579
                false));
06bc494ca11e Initial load
duke
parents:
diff changeset
   580
            ddEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   581
            dlEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   582
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   583
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   584
06bc494ca11e Initial load
duke
parents:
diff changeset
   585
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   586
     * Return the classDoc being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   587
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   588
     * @return the classDoc being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   589
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   590
    public ClassDoc getClassDoc() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   591
        return classDoc;
06bc494ca11e Initial load
duke
parents:
diff changeset
   592
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   593
06bc494ca11e Initial load
duke
parents:
diff changeset
   594
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   595
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   596
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   597
    public void completeMemberSummaryBuild() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   598
        p();
06bc494ca11e Initial load
duke
parents:
diff changeset
   599
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   600
}