langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java
author bpatel
Fri, 27 Feb 2009 18:57:17 -0800
changeset 2216 b124d5c924eb
parent 1789 7ac8c0815000
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 1998-2004 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: 1789
diff changeset
    28
import java.io.*;
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
    29
import java.util.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
import com.sun.javadoc.*;
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
    32
import com.sun.tools.doclets.internal.toolkit.util.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
 * Generate Index for all the Member Names with Indexing in
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 * Unicode Order. This class is a base class for {@link SingleIndexWriter} and
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 * {@link SplitIndexWriter}. It uses the functionality from
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * {@link HtmlDocletWriter} to generate the Index Contents.
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 * @see    IndexBuilder
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 * @author Atul M Dambalkar
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
public class AbstractIndexWriter extends HtmlDocletWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
     * The index of all the members with unicode character.
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
    protected IndexBuilder indexbuilder;
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
     * This constructor will be used by {@link SplitIndexWriter}. Initialises
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
     * path to this file and relative path from this file.
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
     * @param path       Path to the file which is getting generated.
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
     * @param filename   Name of the file which is getting genrated.
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
     * @param relpath    Relative path from this file to the current directory.
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
     * @param indexbuilder Unicode based Index from {@link IndexBuilder}
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
    protected AbstractIndexWriter(ConfigurationImpl configuration,
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
                                  String path, String filename,
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
                                  String relpath, IndexBuilder indexbuilder)
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
                                  throws IOException {
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
        super(configuration, path, filename, relpath);
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
        this.indexbuilder = indexbuilder;
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
     * This Constructor will be used by {@link SingleIndexWriter}.
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
     * @param filename   Name of the file which is getting genrated.
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
     * @param indexbuilder Unicode based Index form {@link IndexBuilder}
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
    protected AbstractIndexWriter(ConfigurationImpl configuration,
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
                                  String filename, IndexBuilder indexbuilder)
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
                                  throws IOException {
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
        super(configuration, filename);
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
        this.indexbuilder = indexbuilder;
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
    /**
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
    81
     * Print the text "Index" in strong format in the navigation bar.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
    protected void navLinkIndex() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
        navCellRevStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
        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
    86
        strongText("doclet.Index");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
        fontEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
     * Generate the member information for the unicode character along with the
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
     * list of the members.
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
     * @param unicode Unicode for which member list information to be generated.
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
     * @param memberlist List of members for the unicode character.
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
     */
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
    98
    protected void generateContents(Character unicode, List<? extends Doc> memberlist) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
        anchor("_" + unicode + "_");
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
        h2();
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   101
        strong(unicode.toString());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
        h2End();
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   103
        int memberListSize = memberlist.size();
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   104
        // Display the list only if there are elements to be displayed.
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   105
        if (memberListSize > 0) {
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   106
            dl();
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   107
            for (int i = 0; i < memberListSize; i++) {
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   108
                Doc element = memberlist.get(i);
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   109
                if (element instanceof MemberDoc) {
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   110
                    printDescription((MemberDoc)element);
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   111
                } else if (element instanceof ClassDoc) {
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   112
                    printDescription((ClassDoc)element);
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   113
                } else if (element instanceof PackageDoc) {
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   114
                    printDescription((PackageDoc)element);
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   115
                }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
            }
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   117
            dlEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
        hr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
     * Print one line summary comment for the package.
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
     * @param pkg PackageDoc passed.
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
    protected void printDescription(PackageDoc pkg) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
        dt();
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
        printPackageLink(pkg, Util.getPackageName(pkg), true);
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
        print(" - ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
        print(configuration.getText("doclet.package") + " " + pkg.name());
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   133
        dtEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
        dd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
        printSummaryComment(pkg);
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   136
        ddEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
     * Print one line summary comment for the class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
     * @param cd ClassDoc passed.
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
    protected void printDescription(ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
        dt();
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
        printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_INDEX, cd, true));
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
        print(" - ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
        printClassInfo(cd);
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   149
        dtEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
        dd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
        printComment(cd);
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   152
        ddEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
     * Print the classkind(class, interface, exception, error of the class
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
     * passed.
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
     * @param cd ClassDoc.
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
    protected void printClassInfo(ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
        print(configuration.getText("doclet.in",
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
            Util.getTypeName(configuration, cd, false),
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
            getPackageLink(cd.containingPackage(),
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
                Util.getPackageName(cd.containingPackage()), false)));
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
    }
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
     * Generate Description for Class, Field, Method or Constructor.
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
     * for Java.* Packages Class Members.
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
     * @param member MemberDoc for the member of the Class Kind.
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
     * @see com.sun.javadoc.MemberDoc
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
    protected void printDescription(MemberDoc member) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
        String name = (member instanceof ExecutableMemberDoc)?
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
            member.name() + ((ExecutableMemberDoc)member).flatSignature() :
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
            member.name();
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
        if (name.indexOf("<") != -1 || name.indexOf(">") != -1) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
                name = Util.escapeHtmlChars(name);
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
        ClassDoc containing = member.containingClass();
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
        dt();
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
        printDocLink(LinkInfoImpl.CONTEXT_INDEX, member, name, true);
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
        println(" - ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
        printMemberDesc(member);
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
        println();
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   189
        dtEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
        dd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
        printComment(member);
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1789
diff changeset
   192
        ddEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
        println();
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
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
     * Print comment for each element in the index. If the element is deprecated
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
     * and it has a @deprecated tag, use that comment. Else if the containing
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
     * class for this element is deprecated, then add the word "Deprecated." at
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
     * the start and then print the normal comment.
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
     * @param element Index element.
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
    protected void printComment(ProgramElementDoc element) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
        Tag[] tags;
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
        if (Util.isDeprecated(element)) {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   208
            strongText("doclet.Deprecated"); space();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
            if ((tags = element.tags("deprecated")).length > 0)
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
                printInlineDeprecatedComment(element, tags[0]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
            ClassDoc cont = element.containingClass();
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
            while (cont != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
                if (Util.isDeprecated(cont)) {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   215
                    strongText("doclet.Deprecated"); space();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
                    break;
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
                cont = cont.containingClass();
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
            printSummaryComment(element);
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
     * Print description about the Static Varible/Method/Constructor for a
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
     * member.
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
     * @param member MemberDoc for the member within the Class Kind.
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
     * @see com.sun.javadoc.MemberDoc
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
    protected void printMemberDesc(MemberDoc member) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
        ClassDoc containing = member.containingClass();
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
        String classdesc = Util.getTypeName(configuration, containing, true) + " " +
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
            getPreQualifiedClassLink(LinkInfoImpl.CONTEXT_INDEX, containing,
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
                false);
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
        if (member.isField()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
            if (member.isStatic()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
                printText("doclet.Static_variable_in", classdesc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
                printText("doclet.Variable_in", classdesc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
        } else if (member.isConstructor()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
            printText("doclet.Constructor_for", classdesc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
        } else if (member.isMethod()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
            if (member.isStatic()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
                printText("doclet.Static_method_in", classdesc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
                printText("doclet.Method_in", classdesc);
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
}