langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java
author bpatel
Fri, 27 Feb 2009 18:57:17 -0800
changeset 2216 b124d5c924eb
parent 1787 1aa079321cd2
child 5520 86e4b9a9da40
permissions -rw-r--r--
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue Reviewed-by: jjg
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 2003-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
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1787
diff changeset
    28
import com.sun.javadoc.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
import com.sun.tools.doclets.internal.toolkit.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
import com.sun.tools.doclets.internal.toolkit.util.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
import com.sun.tools.doclets.internal.toolkit.builders.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
 * Generate the Class Information Page.
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
 * @see com.sun.javadoc.ClassDoc
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 * @see java.util.Collections
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 * @see java.util.List
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * @see java.util.ArrayList
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 * @see java.util.HashMap
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 * @author Atul M Dambalkar
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 * @author Robert Field
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
        implements AnnotationTypeWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
    protected AnnotationTypeDoc annotationType;
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
    protected Type prev;
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
    protected Type next;
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
     * @param annotationType the annotation type being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
     * @param prevType the previous class that was documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
     * @param nextType the next class being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
    public AnnotationTypeWriterImpl (AnnotationTypeDoc annotationType,
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
            Type prevType, Type nextType)
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
    throws Exception {
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
        super(ConfigurationImpl.getInstance(),
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
              DirectoryManager.getDirectoryPath(annotationType.containingPackage()),
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
              annotationType.name() + ".html",
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
              DirectoryManager.getRelativePath(annotationType.containingPackage().name()));
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
        this.annotationType = annotationType;
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
        configuration.currentcd = annotationType.asClassDoc();
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
        this.prev = prevType;
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
        this.next = nextType;
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
     * Print this package link
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
    protected void navLinkPackage() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
        navCellStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
        printHyperLink("package-summary.html", "",
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
            configuration.getText("doclet.Package"), true, "NavBarFont1");
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
     * Print class page indicator
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
    protected void navLinkClass() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
        navCellRevStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
        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
    87
        strongText("doclet.Class");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
        fontEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
     * Print class use link
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
    protected void navLinkClassUse() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
        navCellStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
        printHyperLink("class-use/" + filename, "",
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
                       configuration.getText("doclet.navClassUse"), true, "NavBarFont1");
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
     * Print previous package link
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
    protected void navLinkPrevious() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
        if (prev == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
            printText("doclet.Prev_Class");
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
            printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS,
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
                prev.asClassDoc(), "",
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
                configuration.getText("doclet.Prev_Class"), true));
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
     * Print next package link
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
    protected void navLinkNext() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
        if (next == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
            printText("doclet.Next_Class");
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
            printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS,
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
                next.asClassDoc(), "",
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
                configuration.getText("doclet.Next_Class"), true));
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
    public void writeHeader(String header) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
        String pkgname = (annotationType.containingPackage() != null)?
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
            annotationType.containingPackage().name(): "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
        String clname = annotationType.name();
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
        printHtmlHeader(clname,
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
            configuration.metakeywords.getMetaKeywords(annotationType), true);
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
        printTop();
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
        navLinks(true);
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
        hr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
        println("<!-- ======== START OF CLASS DATA ======== -->");
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
        h2();
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
        if (pkgname.length() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
            font("-1"); print(pkgname); fontEnd(); br();
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
        print(header + getTypeParameterLinks(new LinkInfoImpl(
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
            LinkInfoImpl.CONTEXT_CLASS_HEADER,
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
            annotationType, false)));
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
        h2End();
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
    public void writeFooter() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
        println("<!-- ========= END OF CLASS DATA ========= -->");
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
        hr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
        navLinks(false);
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
        printBottom();
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
        printBodyHtmlEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
    public void writeAnnotationTypeSignature(String modifiers) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
        preNoNewLine();
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
        writeAnnotationInfo(annotationType);
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
        print(modifiers);
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
        String name = annotationType.name() +
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
            getTypeParameterLinks(new LinkInfoImpl(
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
                LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, annotationType, false));
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
        if (configuration().linksource) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
            printSrcLink(annotationType, name);
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
        } else {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   177
            strong(name);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
        preEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
        p();
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
    public void writeAnnotationTypeDescription() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
        if(!configuration.nocomment) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
            // generate documentation for the class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
            if (annotationType.inlineTags().length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
                printInlineComment(annotationType);
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
                p();
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
    public void writeAnnotationTypeTagInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
        boolean needHr = annotationType.elements().length > 0;
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
        if(!configuration.nocomment) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
            // Print Information about all the tags here
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
            printTags(annotationType);
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
            if (needHr) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
                hr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
            p();
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
        } else if (needHr) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
            hr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
    public void writeAnnotationTypeDeprecationInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
        hr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
        Tag[] deprs = annotationType.tags("deprecated");
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
        if (Util.isDeprecated(annotationType)) {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   220
            strongText("doclet.Deprecated");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
            if (deprs.length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
                Tag[] commentTags = deprs[0].inlineTags();
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
                if (commentTags.length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
                    space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
                    printInlineDeprecatedComment(annotationType, deprs[0]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
            p();
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
    protected void navLinkTree() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
        navCellStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
        printHyperLink("package-tree.html", "",
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
            configuration.getText("doclet.Tree"), true, "NavBarFont1");
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
    protected void printSummaryDetailLinks() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
        try {
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
            tr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
            tdVAlignClass("top", "NavBarCell3");
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
            font("-2");
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
            print("  ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
            navSummaryLinks();
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
            fontEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
            tdEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
            tdVAlignClass("top", "NavBarCell3");
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
            font("-2");
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
            navDetailLinks();
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
            fontEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
            tdEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
            trEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
        } catch (Exception e) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
            e.printStackTrace();
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
            throw new DocletAbortException();
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
    protected void navSummaryLinks() throws Exception {
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
        printText("doclet.Summary");
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
        space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
        MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
            configuration.getBuilderFactory().getMemberSummaryBuilder(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
        writeNavSummaryLink(memberSummaryBuilder,
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
            "doclet.navAnnotationTypeRequiredMember",
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
            VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED);
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
        navGap();
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
        writeNavSummaryLink(memberSummaryBuilder,
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
            "doclet.navAnnotationTypeOptionalMember",
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
            VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL);
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
    private void writeNavSummaryLink(MemberSummaryBuilder builder,
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
            String label, int type) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
        AbstractMemberWriter writer = ((AbstractMemberWriter) builder.
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
            getMemberSummaryWriter(type));
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
        if (writer == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
              printText(label);
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
            writer.printNavSummaryLink(null,
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
                ! builder.getVisibleMemberMap(type).noVisibleMembers());
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
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
     * Method navDetailLinks
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
     * @throws   Exception
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
    protected void navDetailLinks() throws Exception {
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
        printText("doclet.Detail");
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
        space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
        MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
            configuration.getBuilderFactory().getMemberSummaryBuilder(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
        AbstractMemberWriter writerOptional =
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
            ((AbstractMemberWriter) memberSummaryBuilder.
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
                getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL));
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
        AbstractMemberWriter writerRequired =
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
            ((AbstractMemberWriter) memberSummaryBuilder.
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
                getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED));
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
        if (writerOptional != null){
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
            writerOptional.printNavDetailLink(annotationType.elements().length > 0);
06bc494ca11e Initial load
duke
parents:
diff changeset
   307
        } else if (writerRequired != null){
06bc494ca11e Initial load
duke
parents:
diff changeset
   308
            writerRequired.printNavDetailLink(annotationType.elements().length > 0);
06bc494ca11e Initial load
duke
parents:
diff changeset
   309
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   310
            printText("doclet.navAnnotationTypeMember");
06bc494ca11e Initial load
duke
parents:
diff changeset
   311
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   312
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   313
06bc494ca11e Initial load
duke
parents:
diff changeset
   314
    protected void navGap() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
        space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   316
        print('|');
06bc494ca11e Initial load
duke
parents:
diff changeset
   317
        space();
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
     * If this is an inner class or interface, write the enclosing class or
06bc494ca11e Initial load
duke
parents:
diff changeset
   322
     * interface.
06bc494ca11e Initial load
duke
parents:
diff changeset
   323
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   324
    public void writeNestedClassInfo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   325
        ClassDoc outerClass = annotationType.containingClass();
06bc494ca11e Initial load
duke
parents:
diff changeset
   326
        if (outerClass != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   327
            dl();
06bc494ca11e Initial load
duke
parents:
diff changeset
   328
            dt();
06bc494ca11e Initial load
duke
parents:
diff changeset
   329
            if (annotationType.isInterface()) {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   330
                strongText("doclet.Enclosing_Interface");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   331
            } else {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   332
                strongText("doclet.Enclosing_Class");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   333
            }
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1787
diff changeset
   334
            dtEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   335
            dd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   336
            printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, outerClass,
06bc494ca11e Initial load
duke
parents:
diff changeset
   337
                false));
06bc494ca11e Initial load
duke
parents:
diff changeset
   338
            ddEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   339
            dlEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   340
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   341
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   342
06bc494ca11e Initial load
duke
parents:
diff changeset
   343
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   344
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   345
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   346
    public AnnotationTypeDoc getAnnotationTypeDoc() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   347
        return annotationType;
06bc494ca11e Initial load
duke
parents:
diff changeset
   348
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   349
06bc494ca11e Initial load
duke
parents:
diff changeset
   350
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   351
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   352
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   353
    public void completeMemberSummaryBuild() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   354
        p();
06bc494ca11e Initial load
duke
parents:
diff changeset
   355
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   356
}