langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java
author bpatel
Wed, 01 Dec 2010 11:02:38 -0800
changeset 7614 cfadc977ca75
parent 5520 86e4b9a9da40
child 7681 1f0819a3341f
permissions -rw-r--r--
6851834: Javadoc doclet needs a structured approach to generate the output HTML. Reviewed-by: jjg
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
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    28
import java.io.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
import com.sun.javadoc.*;
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    30
import com.sun.tools.doclets.internal.toolkit.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
import com.sun.tools.doclets.internal.toolkit.util.*;
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    32
import com.sun.tools.doclets.formats.html.markup.*;
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
 * This abstract class exists to provide functionality needed in the
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 * the formatting of member information.  Since AbstractSubWriter and its
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 * subclasses control this, they would be the logical place to put this.
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * However, because each member type has its own subclass, subclassing
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 * can not be used effectively to change formatting.  The concrete
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 * class subclass of this class can be subclassed to change formatting.
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 * @see AbstractMemberWriter
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 * @see ClassWriterImpl
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 * @author Robert Field
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
 * @author Atul M Dambalkar
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 1787
diff changeset
    47
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
    public SubWriterHolderWriter(ConfigurationImpl configuration,
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
                                 String filename) throws IOException {
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
        super(configuration, filename);
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
    public SubWriterHolderWriter(ConfigurationImpl configuration,
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
                                 String path, String filename, String relpath)
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
                                 throws IOException {
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
        super(configuration, path, filename, relpath);
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
    public void printTypeSummaryHeader() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
        tdIndex();
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
        font("-1");
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
        code();
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
    public void printTypeSummaryFooter() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
        codeEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
        fontEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
        tdEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    75
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    76
     * Add the summary header.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    77
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    78
     * @param mw the writer for the member being documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    79
     * @param cd the classdoc to be documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    80
     * @param memberTree the content tree to which the summary header will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    81
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    82
    public void addSummaryHeader(AbstractMemberWriter mw, ClassDoc cd,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    83
            Content memberTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    84
        mw.addSummaryAnchor(cd, memberTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    85
        mw.addSummaryLabel(memberTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    86
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    87
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    88
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    89
     * Get the summary table.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    90
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    91
     * @param mw the writer for the member being documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    92
     * @param cd the classdoc to be documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    93
     * @return the content tree for the summary table
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    94
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    95
    public Content getSummaryTableTree(AbstractMemberWriter mw, ClassDoc cd) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    96
        Content table = HtmlTree.TABLE(HtmlStyle.overviewSummary, 0, 3, 0,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    97
                mw.getTableSummary(), getTableCaption(mw.getCaption()));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    98
        table.addContent(getSummaryTableHeader(mw.getSummaryTableHeader(cd), "col"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    99
        return table;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
    public void printTableHeadingBackground(String str) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
        tableIndexDetail();
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
        tableHeaderStart("#CCCCFF", 1);
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   105
        strong(str);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
        tableHeaderEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
        tableEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   110
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   111
     * Add the inherited summary header.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   112
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   113
     * @param mw the writer for the member being documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   114
     * @param cd the classdoc to be documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   115
     * @param inheritedTree the content tree to which the inherited summary header will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   116
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   117
    public void addInheritedSummaryHeader(AbstractMemberWriter mw, ClassDoc cd,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   118
            Content inheritedTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   119
        mw.addInheritedSummaryAnchor(cd, inheritedTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   120
        mw.addInheritedSummaryLabel(cd, inheritedTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
    public void printSummaryFooter(AbstractMemberWriter mw, ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
        tableEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
        space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
    public void printInheritedSummaryFooter(AbstractMemberWriter mw, ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
        codeEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
        summaryRowEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
        trEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
        tableEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
        space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   136
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   137
     * Add the index comment.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   138
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   139
     * @param member the member being documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   140
     * @param contentTree the content tree to which the comment will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   141
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   142
    protected void addIndexComment(Doc member, Content contentTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   143
        addIndexComment(member, member.firstSentenceTags(), contentTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
    protected void printIndexComment(Doc member, Tag[] firstSentenceTags) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
        Tag[] deprs = member.tags("deprecated");
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
        if (Util.isDeprecated((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
   149
            strongText("doclet.Deprecated");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
            space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
            if (deprs.length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
                printInlineDeprecatedComment(member, deprs[0]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
            return;
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
            ClassDoc cd = ((ProgramElementDoc)member).containingClass();
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
            if (cd != null && Util.isDeprecated(cd)) {
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   158
                strongText("doclet.Deprecated"); space();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
        printSummaryComment(member, firstSentenceTags);
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   164
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   165
     * Add the index comment.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   166
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   167
     * @param member the member being documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   168
     * @param firstSentenceTags the first sentence tags for the member to be documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   169
     * @param tdSummary the content tree to which the comment will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   170
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   171
    protected void addIndexComment(Doc member, Tag[] firstSentenceTags,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   172
            Content tdSummary) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   173
        Tag[] deprs = member.tags("deprecated");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   174
        Content div;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   175
        if (Util.isDeprecated((ProgramElementDoc) member)) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   176
            Content strong = HtmlTree.STRONG(deprecatedPhrase);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   177
            div = HtmlTree.DIV(HtmlStyle.block, strong);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   178
            div.addContent(getSpace());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   179
            if (deprs.length > 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   180
                addInlineDeprecatedComment(member, deprs[0], div);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   181
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   182
            tdSummary.addContent(div);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   183
            return;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   184
        } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   185
            ClassDoc cd = ((ProgramElementDoc)member).containingClass();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   186
            if (cd != null && Util.isDeprecated(cd)) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   187
                Content strong = HtmlTree.STRONG(deprecatedPhrase);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   188
                div = HtmlTree.DIV(HtmlStyle.block, strong);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   189
                div.addContent(getSpace());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   190
                tdSummary.addContent(div);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   191
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   192
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   193
        addSummaryComment(member, firstSentenceTags, tdSummary);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   196
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   197
     * Add the summary type for the member.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   198
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   199
     * @param mw the writer for the member being documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   200
     * @param member the member to be documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   201
     * @param tdSummaryType the content tree to which the type will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   202
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   203
    public void addSummaryType(AbstractMemberWriter mw, ProgramElementDoc member,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   204
            Content tdSummaryType) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   205
        mw.addSummaryType(member, tdSummaryType);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   206
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   207
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   208
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   209
     * Add the summary link for the member.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   210
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   211
     * @param mw the writer for the member being documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   212
     * @param member the member to be documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   213
     * @param contentTree the content tree to which the link will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   214
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   215
    public void addSummaryLinkComment(AbstractMemberWriter mw,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   216
            ProgramElementDoc member, Content contentTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   217
        addSummaryLinkComment(mw, member, member.firstSentenceTags(), contentTree);
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
    public void printSummaryLinkComment(AbstractMemberWriter mw,
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
                                        ProgramElementDoc member,
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
                                        Tag[] firstSentenceTags) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
        codeEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
        println();
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
        br();
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
        printNbsps();
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
        printIndexComment(member, firstSentenceTags);
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
        summaryRowEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
        trEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   232
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   233
     * Add the summary link comment.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   234
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   235
     * @param mw the writer for the member being documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   236
     * @param member the member being documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   237
     * @param firstSentenceTags the first sentence tags for the member to be documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   238
     * @param tdSummary the content tree to which the comment will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   239
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   240
    public void addSummaryLinkComment(AbstractMemberWriter mw,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   241
            ProgramElementDoc member, Tag[] firstSentenceTags, Content tdSummary) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   242
        addIndexComment(member, firstSentenceTags, tdSummary);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   243
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   244
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   245
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   246
     * Add the inherited member summary.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   247
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   248
     * @param mw the writer for the member being documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   249
     * @param cd the class being documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   250
     * @param member the member being documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   251
     * @param isFirst true if its the first link being documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   252
     * @param linksTree the content tree to which the summary will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   253
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   254
    public void addInheritedMemberSummary(AbstractMemberWriter mw, ClassDoc cd,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   255
            ProgramElementDoc member, boolean isFirst, Content linksTree) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
        if (! isFirst) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   257
            linksTree.addContent(", ");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   259
        mw.addInheritedSummaryLink(cd, member, linksTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
    public void printMemberHeader() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
        hr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
    public void printMemberFooter() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   269
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   270
     * Get the document content header tree
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   271
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   272
     * @return a content tree the document content header
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   273
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   274
    public Content getContentHeader() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   275
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   276
        div.addStyle(HtmlStyle.contentContainer);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   277
        return div;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   278
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   279
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   280
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   281
     * Get the member header tree
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   282
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   283
     * @return a content tree the member header
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   284
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   285
    public Content getMemberTreeHeader() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   286
        HtmlTree li = new HtmlTree(HtmlTag.LI);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   287
        li.addStyle(HtmlStyle.blockList);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   288
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   289
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   290
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   291
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   292
     * Get the member tree
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   293
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   294
     * @param contentTree the tree used to generate the complete member tree
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   295
     * @return a content tree for the member
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   296
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   297
    public Content getMemberTree(Content contentTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   298
        Content ul = HtmlTree.UL(HtmlStyle.blockList, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   299
        return ul;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   300
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   301
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   302
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   303
     * Get the member summary tree
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   304
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   305
     * @param contentTree the tree used to generate the member summary tree
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   306
     * @return a content tree for the member summary
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   307
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   308
    public Content getMemberSummaryTree(Content contentTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   309
        return getMemberTree(HtmlStyle.summary, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   310
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   311
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   312
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   313
     * Get the member details tree
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   314
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   315
     * @param contentTree the tree used to generate the member details tree
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   316
     * @return a content tree for the member details
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   317
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   318
    public Content getMemberDetailsTree(Content contentTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   319
        return getMemberTree(HtmlStyle.details, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   320
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   321
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   322
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   323
     * Get the member tree
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   324
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   325
     * @param style the style class to be added to the content tree
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   326
     * @param contentTree the tree used to generate the complete member tree
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   327
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   328
    public Content getMemberTree(HtmlStyle style, Content contentTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   329
        Content div = HtmlTree.DIV(style, getMemberTree(contentTree));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   330
        return div;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   331
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   332
}