langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java
author ohair
Tue, 25 May 2010 15:54:51 -0700
changeset 5520 86e4b9a9da40
parent 2320 5b8c377175f4
child 7614 cfadc977ca75
permissions -rw-r--r--
6943119: Rebrand source copyright notices Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
     2
 * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
package com.sun.tools.doclets.formats.html;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1787
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: 1787
diff changeset
    29
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1787
diff changeset
    30
import com.sun.javadoc.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
import com.sun.tools.doclets.internal.toolkit.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
import com.sun.tools.doclets.internal.toolkit.util.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
 * Writes field documentation in HTML format.
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 * @author Robert Field
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * @author Atul M Dambalkar
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 * @author Jamie Ho (rewrite)
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
    40
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
public class FieldWriterImpl extends AbstractMemberWriter
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
    implements FieldWriter, MemberSummaryWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
    private boolean printedSummaryHeader = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
    public FieldWriterImpl(SubWriterHolderWriter writer, ClassDoc classdoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
        super(writer, classdoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
    public FieldWriterImpl(SubWriterHolderWriter writer) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
        super(writer);
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
     * Write the fields summary header for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
     * @param classDoc the class the summary belongs to.
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
    public void writeMemberSummaryHeader(ClassDoc classDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
        printedSummaryHeader = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
        writer.println("<!-- =========== FIELD SUMMARY =========== -->");
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
        writer.println();
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
        writer.printSummaryHeader(this, classDoc);
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
     * Write the fields summary footer for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
     * @param classDoc the class the summary belongs to.
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
    public void writeMemberSummaryFooter(ClassDoc classDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
        writer.tableEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
        writer.space();
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
     * Write the inherited fields summary header for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
     * @param classDoc the class the summary belongs to.
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
    public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
        if(! printedSummaryHeader){
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
            //We don't want inherited summary to not be under heading.
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
            writeMemberSummaryHeader(classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
            writeMemberSummaryFooter(classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
            printedSummaryHeader = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
        writer.printInheritedSummaryHeader(this, classDoc);
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
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
    public void writeInheritedMemberSummary(ClassDoc classDoc,
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
        ProgramElementDoc field, boolean isFirst, boolean isLast) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
        writer.printInheritedSummaryMember(this, classDoc, field, isFirst);
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
     * Write the inherited fields summary footer for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
     * @param classDoc the class the summary belongs to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
    public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
        writer.printInheritedSummaryFooter(this, classDoc);
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
     * Write the header for the field documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
     * @param classDoc the class that the fields belong to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
    public void writeHeader(ClassDoc classDoc, String header) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
        writer.println();
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
        writer.println("<!-- ============ FIELD DETAIL =========== -->");
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
        writer.println();
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
        writer.anchor("field_detail");
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
        writer.printTableHeadingBackground(header);
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
        writer.println();
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
     * Write the field header for the given field.
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
     * @param field the field being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
     * @param isFirst the flag to indicate whether or not the field is the
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
     *        first to be documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
    public void writeFieldHeader(FieldDoc field, boolean isFirst) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
        if (! isFirst) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
            writer.printMemberHeader();
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
            writer.println("");
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
        writer.anchor(field.name());
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
        writer.h3();
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
        writer.print(field.name());
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
        writer.h3End();
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
     * Write the signature for the given field.
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
     * @param field the field being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
    public void writeSignature(FieldDoc field) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
        writer.pre();
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
        writer.writeAnnotationInfo(field);
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
        printModifiers(field);
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
        writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER,
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
            field.type()));
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
        print(' ');
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
        if (configuration().linksource) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
            writer.printSrcLink(field, field.name());
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
        } else {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   156
            strong(field.name());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
        writer.preEnd();
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1787
diff changeset
   159
        assert !writer.getMemberDetailsListPrinted();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
     * Write the deprecated output for the given field.
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
     * @param field the field being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
    public void writeDeprecated(FieldDoc field) {
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1787
diff changeset
   168
        printDeprecated(field);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
     * Write the comments for the given field.
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
     * @param field the field being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
    public void writeComments(FieldDoc field) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
        ClassDoc holder = field.containingClass();
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
        if (field.inlineTags().length > 0) {
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1787
diff changeset
   179
            writer.printMemberDetailsListStartTag();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
            if (holder.equals(classdoc) ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
                (! (holder.isPublic() || Util.isLinkable(holder, configuration())))) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
                writer.dd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
                writer.printInlineComment(field);
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1787
diff changeset
   184
                writer.ddEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
                String classlink = writer.codeText(
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
                    writer.getDocLink(LinkInfoImpl.CONTEXT_FIELD_DOC_COPY,
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
                        holder, field,
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
                        holder.isIncluded() ?
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
                            holder.typeName() : holder.qualifiedTypeName(),
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
                        false));
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
                writer.dd();
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   193
                writer.strong(configuration().getText(holder.isClass()?
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
                   "doclet.Description_From_Class" :
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
                    "doclet.Description_From_Interface", classlink));
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
                writer.ddEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
                writer.dd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
                writer.printInlineComment(field);
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1787
diff changeset
   199
                writer.ddEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
     * Write the tag output for the given field.
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
     * @param field the field being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
    public void writeTags(FieldDoc field) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
        writer.printTags(field);
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
     * Write the field footer.
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
    public void writeFieldFooter() {
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1787
diff changeset
   217
        printMemberFooter();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
     * Write the footer for the field documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
     * @param classDoc the class that the fields belong to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
    public void writeFooter(ClassDoc classDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
        //No footer to write for field documentation
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
     * Close the writer.
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
    public void close() throws IOException {
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
        writer.close();
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
    public int getMemberKind() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
        return VisibleMemberMap.FIELDS;
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   240
    public void printSummaryLabel() {
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   241
        writer.printText("doclet.Field_Summary");
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   242
    }
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   243
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   244
    public void printTableSummary() {
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   245
        writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary",
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   246
                configuration().getText("doclet.Field_Summary"),
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   247
                configuration().getText("doclet.fields")));
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   248
    }
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   249
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   250
    public void printSummaryTableHeader(ProgramElementDoc member) {
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   251
        String[] header = new String[] {
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   252
            writer.getModifierTypeHeader(),
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   253
            configuration().getText("doclet.0_and_1",
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   254
                    configuration().getText("doclet.Field"),
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   255
                    configuration().getText("doclet.Description"))
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   256
        };
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   257
        writer.summaryTableHeader(header, "col");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
    public void printSummaryAnchor(ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
        writer.anchor("field_summary");
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
    public void printInheritedSummaryAnchor(ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
        writer.anchor("fields_inherited_from_class_" + configuration().getClassName(cd));
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
    public void printInheritedSummaryLabel(ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
        String classlink = writer.getPreQualifiedClassLink(
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
            LinkInfoImpl.CONTEXT_MEMBER, cd, false);
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   271
        writer.strong();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
        String key = cd.isClass()?
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
            "doclet.Fields_Inherited_From_Class" :
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
            "doclet.Fields_Inherited_From_Interface";
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
        writer.printText(key, classlink);
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   276
        writer.strongEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
    protected void writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   280
        writer.strong();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
        writer.printDocLink(context, cd , (MemberDoc) member, member.name(), false);
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   282
        writer.strongEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
    protected void writeInheritedSummaryLink(ClassDoc cd,
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
            ProgramElementDoc member) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
        writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc)member,
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
            member.name(), false);
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
    protected void printSummaryType(ProgramElementDoc member) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
        FieldDoc field = (FieldDoc)member;
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
        printModifierAndType(field, field.type());
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
    protected void writeDeprecatedLink(ProgramElementDoc member) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
        writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER,
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
            (MemberDoc) member, ((FieldDoc)member).qualifiedName(), false);
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
    protected void printNavSummaryLink(ClassDoc cd, boolean link) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
        if (link) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
            writer.printHyperLink("", (cd == null)?
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
                        "field_summary":
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
                        "fields_inherited_from_class_" +
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
                        configuration().getClassName(cd),
06bc494ca11e Initial load
duke
parents:
diff changeset
   307
                    configuration().getText("doclet.navField"));
06bc494ca11e Initial load
duke
parents:
diff changeset
   308
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   309
            writer.printText("doclet.navField");
06bc494ca11e Initial load
duke
parents:
diff changeset
   310
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   311
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   312
06bc494ca11e Initial load
duke
parents:
diff changeset
   313
    protected void printNavDetailLink(boolean link) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   314
        if (link) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
            writer.printHyperLink("", "field_detail",
06bc494ca11e Initial load
duke
parents:
diff changeset
   316
                configuration().getText("doclet.navField"));
06bc494ca11e Initial load
duke
parents:
diff changeset
   317
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   318
            writer.printText("doclet.navField");
06bc494ca11e Initial load
duke
parents:
diff changeset
   319
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   320
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   321
}