langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 10 06bc494ca11e
child 1787 1aa079321cd2
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
06bc494ca11e Initial load
duke
parents:
diff changeset
     2
 * Copyright 1997-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
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
import com.sun.tools.doclets.internal.toolkit.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
import com.sun.tools.doclets.internal.toolkit.taglets.*;
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.javadoc.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
import java.io.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 * Writes field documentation in HTML format.
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * @author Robert Field
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 * @author Atul M Dambalkar
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 * @author Jamie Ho (rewrite)
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 {
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
            bold(field.name());
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
        writer.preEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
        writer.dl();
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) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
        print(((TagletOutputImpl)
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
            (new DeprecatedTaglet()).getTagletOutput(field,
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
            writer.getTagletWriterInstance(false))).toString());
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
     * Write the comments for the given field.
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
     * @param field the field being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
    public void writeComments(FieldDoc field) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
        ClassDoc holder = field.containingClass();
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
        if (field.inlineTags().length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
            if (holder.equals(classdoc) ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
                (! (holder.isPublic() || Util.isLinkable(holder, configuration())))) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
                writer.dd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
                writer.printInlineComment(field);
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();
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
                writer.bold(configuration().getText(holder.isClass()?
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);
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
            }
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
     * Write the tag output for the given field.
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
     * @param field the field being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
    public void writeTags(FieldDoc field) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
        writer.printTags(field);
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
     * Write the field footer.
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
    public void writeFieldFooter() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
        writer.dlEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
     * Write the footer for the field documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
     * @param classDoc the class that the fields belong to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
    public void writeFooter(ClassDoc classDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
        //No footer to write for field documentation
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
     * Close the writer.
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
    public void close() throws IOException {
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
        writer.close();
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
    public int getMemberKind() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
        return VisibleMemberMap.FIELDS;
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
    public void printSummaryLabel(ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
        writer.boldText("doclet.Field_Summary");
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
    public void printSummaryAnchor(ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
        writer.anchor("field_summary");
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
    public void printInheritedSummaryAnchor(ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
        writer.anchor("fields_inherited_from_class_" + configuration().getClassName(cd));
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
    public void printInheritedSummaryLabel(ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
        String classlink = writer.getPreQualifiedClassLink(
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
            LinkInfoImpl.CONTEXT_MEMBER, cd, false);
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
        writer.bold();
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
        String key = cd.isClass()?
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
            "doclet.Fields_Inherited_From_Class" :
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
            "doclet.Fields_Inherited_From_Interface";
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
        writer.printText(key, classlink);
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
        writer.boldEnd();
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 writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
        writer.bold();
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
        writer.printDocLink(context, cd , (MemberDoc) member, member.name(), false);
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
        writer.boldEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
    protected void writeInheritedSummaryLink(ClassDoc cd,
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
            ProgramElementDoc member) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
        writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc)member,
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
            member.name(), false);
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
    protected void printSummaryType(ProgramElementDoc member) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
        FieldDoc field = (FieldDoc)member;
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
        printModifierAndType(field, field.type());
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 writeDeprecatedLink(ProgramElementDoc member) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
        writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER,
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
            (MemberDoc) member, ((FieldDoc)member).qualifiedName(), false);
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
    protected void printNavSummaryLink(ClassDoc cd, boolean link) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
        if (link) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
            writer.printHyperLink("", (cd == null)?
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
                        "field_summary":
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
                        "fields_inherited_from_class_" +
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
                        configuration().getClassName(cd),
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
                    configuration().getText("doclet.navField"));
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
            writer.printText("doclet.navField");
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
        }
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 printNavDetailLink(boolean link) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
        if (link) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
            writer.printHyperLink("", "field_detail",
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
                configuration().getText("doclet.navField"));
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
            writer.printText("doclet.navField");
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
}