langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java
author jjg
Tue, 09 Oct 2012 19:10:00 -0700
changeset 14258 8d2148961366
parent 9083 63f3c4d2d992
child 14260 727a84636f12
permissions -rw-r--r--
8000663: clean up langtools imports Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 9083
diff changeset
     2
 * Copyright (c) 2003, 2012, 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: 2216
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: 2216
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: 2216
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2216
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2216
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 com.sun.javadoc.*;
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 9083
diff changeset
    29
import com.sun.tools.doclets.formats.html.markup.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
import com.sun.tools.doclets.internal.toolkit.*;
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 9083
diff changeset
    31
import com.sun.tools.doclets.internal.toolkit.builders.*;
10
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
 * Generate the Class Information Page.
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 * @see com.sun.javadoc.ClassDoc
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 * @see java.util.Collections
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * @see java.util.List
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 * @see java.util.ArrayList
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 * @see java.util.HashMap
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 * @author Atul M Dambalkar
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 * @author Robert Field
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    44
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
        implements AnnotationTypeWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
    protected AnnotationTypeDoc annotationType;
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
    protected Type prev;
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
    protected Type next;
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
     * @param annotationType the annotation type being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
     * @param prevType the previous class that was documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
     * @param nextType the next class being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
    public AnnotationTypeWriterImpl (AnnotationTypeDoc annotationType,
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
            Type prevType, Type nextType)
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
    throws Exception {
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
        super(ConfigurationImpl.getInstance(),
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
              DirectoryManager.getDirectoryPath(annotationType.containingPackage()),
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
              annotationType.name() + ".html",
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
              DirectoryManager.getRelativePath(annotationType.containingPackage().name()));
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
        this.annotationType = annotationType;
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
        configuration.currentcd = annotationType.asClassDoc();
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
        this.prev = prevType;
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
        this.next = nextType;
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    74
     * Get this package link.
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
     * @return a content tree for the package link
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    78
    protected Content getNavLinkPackage() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    79
        Content linkContent = getHyperLink("package-summary.html", "",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    80
                packageLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    81
        Content li = HtmlTree.LI(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    82
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    86
     * Get the class link.
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
     * @return a content tree for the class link
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    90
    protected Content getNavLinkClass() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    91
        Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, classLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    92
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    93
    }
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
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    96
     * Get the class use link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    97
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    98
     * @return a content tree for the class use link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    99
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   100
    protected Content getNavLinkClassUse() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   101
        Content linkContent = getHyperLink("class-use/" + filename, "", useLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   102
        Content li = HtmlTree.LI(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   103
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   107
     * Get link to previous class.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   108
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   109
     * @return a content tree for the previous class link
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   111
    public Content getNavLinkPrevious() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   112
        Content li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   113
        if (prev != null) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   114
            Content prevLink = new RawHtml(getLink(new LinkInfoImpl(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   115
                    LinkInfoImpl.CONTEXT_CLASS, prev.asClassDoc(), "",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   116
                    configuration.getText("doclet.Prev_Class"), true)));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   117
            li = HtmlTree.LI(prevLink);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   118
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   119
        else
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   120
            li = HtmlTree.LI(prevclassLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   121
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   125
     * Get link to next class.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   126
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   127
     * @return a content tree for the next class link
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   129
    public Content getNavLinkNext() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   130
        Content li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   131
        if (next != null) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   132
            Content nextLink = new RawHtml(getLink(new LinkInfoImpl(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   133
                    LinkInfoImpl.CONTEXT_CLASS, next.asClassDoc(), "",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   134
                    configuration.getText("doclet.Next_Class"), true)));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   135
            li = HtmlTree.LI(nextLink);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   137
        else
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   138
            li = HtmlTree.LI(nextclassLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   139
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   145
    public Content getHeader(String header) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
        String pkgname = (annotationType.containingPackage() != null)?
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
            annotationType.containingPackage().name(): "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
        String clname = annotationType.name();
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   149
        Content bodyTree = getBody(true, getWindowTitle(clname));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   150
        addTop(bodyTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   151
        addNavLinks(true, bodyTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   152
        bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   153
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   154
        div.addStyle(HtmlStyle.header);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   155
        if (pkgname.length() > 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   156
            Content pkgNameContent = new StringContent(pkgname);
9068
6697b4cbba1d 7010342: End tag for element P is not open for few html files generated using new javadoc
bpatel
parents: 7681
diff changeset
   157
            Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent);
6697b4cbba1d 7010342: End tag for element P is not open for few html files generated using new javadoc
bpatel
parents: 7681
diff changeset
   158
            div.addContent(pkgNameDiv);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   159
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   160
        LinkInfoImpl linkInfo = new LinkInfoImpl(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   161
                LinkInfoImpl.CONTEXT_CLASS_HEADER, annotationType, false);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   162
        Content headerContent = new StringContent(header);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   163
        Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   164
                HtmlStyle.title, headerContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   165
        heading.addContent(new RawHtml(getTypeParameterLinks(linkInfo)));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   166
        div.addContent(heading);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   167
        bodyTree.addContent(div);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   168
        return bodyTree;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   169
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   171
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   172
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   173
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   174
    public Content getAnnotationContentHeader() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   175
        return getContentHeader();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   176
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   177
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   178
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   179
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   180
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   181
    public void addFooter(Content contentTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   182
        contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   183
        addNavLinks(false, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   184
        addBottom(contentTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   190
    public void printDocument(Content contentTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   191
        printHtmlDocument(configuration.metakeywords.getMetaKeywords(annotationType),
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   192
                true, contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   193
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   194
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   195
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   196
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   197
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   198
    public Content getAnnotationInfoTreeHeader() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   199
        return getMemberTreeHeader();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   200
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   201
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
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   204
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   205
    public Content getAnnotationInfo(Content annotationInfoTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   206
        return getMemberTree(HtmlStyle.description, annotationInfoTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   212
    public void addAnnotationTypeSignature(String modifiers, Content annotationInfoTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   213
        annotationInfoTree.addContent(new HtmlTree(HtmlTag.BR));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   214
        Content pre = new HtmlTree(HtmlTag.PRE);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   215
        addAnnotationInfo(annotationType, pre);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   216
        pre.addContent(modifiers);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   217
        LinkInfoImpl linkInfo = new LinkInfoImpl(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   218
                LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, annotationType, false);
9083
63f3c4d2d992 7010344: Some of the html files do not have element <a> in right context.
bpatel
parents: 9068
diff changeset
   219
        Content annotationName = new StringContent(annotationType.name());
63f3c4d2d992 7010344: Some of the html files do not have element <a> in right context.
bpatel
parents: 9068
diff changeset
   220
        Content parameterLinks = new RawHtml(getTypeParameterLinks(linkInfo));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
        if (configuration().linksource) {
9083
63f3c4d2d992 7010344: Some of the html files do not have element <a> in right context.
bpatel
parents: 9068
diff changeset
   222
            addSrcLink(annotationType, annotationName, pre);
63f3c4d2d992 7010344: Some of the html files do not have element <a> in right context.
bpatel
parents: 9068
diff changeset
   223
            pre.addContent(parameterLinks);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
        } else {
9083
63f3c4d2d992 7010344: Some of the html files do not have element <a> in right context.
bpatel
parents: 9068
diff changeset
   225
            Content span = HtmlTree.SPAN(HtmlStyle.strong, annotationName);
63f3c4d2d992 7010344: Some of the html files do not have element <a> in right context.
bpatel
parents: 9068
diff changeset
   226
            span.addContent(parameterLinks);
63f3c4d2d992 7010344: Some of the html files do not have element <a> in right context.
bpatel
parents: 9068
diff changeset
   227
            pre.addContent(span);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   229
        annotationInfoTree.addContent(pre);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   235
    public void addAnnotationTypeDescription(Content annotationInfoTree) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
        if(!configuration.nocomment) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
            if (annotationType.inlineTags().length > 0) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   238
                addInlineComment(annotationType, annotationInfoTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   246
    public void addAnnotationTypeTagInfo(Content annotationInfoTree) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
        if(!configuration.nocomment) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   248
            addTagsInfo(annotationType, annotationInfoTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   255
    public void addAnnotationTypeDeprecationInfo(Content annotationInfoTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   256
        Content hr = new HtmlTree(HtmlTag.HR);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   257
        annotationInfoTree.addContent(hr);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
        Tag[] deprs = annotationType.tags("deprecated");
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
        if (Util.isDeprecated(annotationType)) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   260
            Content strong = HtmlTree.STRONG(deprecatedPhrase);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   261
            Content div = HtmlTree.DIV(HtmlStyle.block, strong);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
            if (deprs.length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
                Tag[] commentTags = deprs[0].inlineTags();
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
                if (commentTags.length > 0) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   265
                    div.addContent(getSpace());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   266
                    addInlineDeprecatedComment(annotationType, deprs[0], div);
10
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
            annotationInfoTree.addContent(div);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
7614
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
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   275
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   276
    public void addAnnotationDetailsMarker(Content memberDetails) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   277
        memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_DETAILS);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
7614
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
     * {@inheritDoc}
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
    protected Content getNavLinkTree() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   284
        Content treeLinkContent = getHyperLink("package-tree.html",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   285
                "", treeLabel, "", "");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   286
        Content li = HtmlTree.LI(treeLinkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   287
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   288
    }
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
     * Add summary details to the navigation bar.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   292
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   293
     * @param subDiv the content tree to which the summary detail links will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   294
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   295
    protected void addSummaryDetailLinks(Content subDiv) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
        try {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   297
            Content div = HtmlTree.DIV(getNavSummaryLinks());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   298
            div.addContent(getNavDetailLinks());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   299
            subDiv.addContent(div);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
        } catch (Exception e) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
            e.printStackTrace();
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
            throw new DocletAbortException();
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   304
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   306
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   307
     * Get summary links for navigation bar.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   308
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   309
     * @return the content tree for the navigation summary links
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
    protected Content getNavSummaryLinks() throws Exception {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   312
        Content li = HtmlTree.LI(summaryLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   313
        li.addContent(getSpace());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   314
        Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
        MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   316
                configuration.getBuilderFactory().getMemberSummaryBuilder(this);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   317
        Content liNavReq = new HtmlTree(HtmlTag.LI);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   318
        addNavSummaryLink(memberSummaryBuilder,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   319
                "doclet.navAnnotationTypeRequiredMember",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   320
                VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED, liNavReq);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   321
        addNavGap(liNavReq);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   322
        ulNav.addContent(liNavReq);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   323
        Content liNavOpt = new HtmlTree(HtmlTag.LI);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   324
        addNavSummaryLink(memberSummaryBuilder,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   325
                "doclet.navAnnotationTypeOptionalMember",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   326
                VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL, liNavOpt);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   327
        ulNav.addContent(liNavOpt);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   328
        return ulNav;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   329
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   330
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   331
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   332
     * Add the navigation summary link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   333
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   334
     * @param builder builder for the member to be documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   335
     * @param label the label for the navigation
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   336
     * @param type type to be documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   337
     * @param liNav the content tree to which the navigation summary link will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   338
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   339
    protected void addNavSummaryLink(MemberSummaryBuilder builder,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   340
            String label, int type, Content liNav) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   341
        AbstractMemberWriter writer = ((AbstractMemberWriter) builder.
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   342
                getMemberSummaryWriter(type));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   343
        if (writer == null) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   344
            liNav.addContent(getResource(label));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   345
        } else {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   346
            liNav.addContent(writer.getNavSummaryLink(null,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   347
                    ! builder.getVisibleMemberMap(type).noVisibleMembers()));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   348
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   349
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   350
06bc494ca11e Initial load
duke
parents:
diff changeset
   351
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   352
     * Get detail links for the navigation bar.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   353
     *
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   354
     * @return the content tree for the detail links
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   355
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   356
    protected Content getNavDetailLinks() throws Exception {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   357
        Content li = HtmlTree.LI(detailLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   358
        li.addContent(getSpace());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   359
        Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   360
        MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   361
                configuration.getBuilderFactory().getMemberSummaryBuilder(this);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   362
        AbstractMemberWriter writerOptional =
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   363
                ((AbstractMemberWriter) memberSummaryBuilder.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   364
                getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL));
06bc494ca11e Initial load
duke
parents:
diff changeset
   365
        AbstractMemberWriter writerRequired =
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   366
                ((AbstractMemberWriter) memberSummaryBuilder.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   367
                getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED));
06bc494ca11e Initial load
duke
parents:
diff changeset
   368
        if (writerOptional != null){
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   369
            Content liNavOpt = new HtmlTree(HtmlTag.LI);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   370
            writerOptional.addNavDetailLink(annotationType.elements().length > 0, liNavOpt);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   371
            ulNav.addContent(liNavOpt);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   372
        } else if (writerRequired != null){
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   373
            Content liNavReq = new HtmlTree(HtmlTag.LI);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   374
            writerRequired.addNavDetailLink(annotationType.elements().length > 0, liNavReq);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   375
            ulNav.addContent(liNavReq);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   376
        } else {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   377
            Content liNav = HtmlTree.LI(getResource("doclet.navAnnotationTypeMember"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   378
            ulNav.addContent(liNav);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   379
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   380
        return ulNav;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   381
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   382
06bc494ca11e Initial load
duke
parents:
diff changeset
   383
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   384
     * Add gap between navigation bar elements.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   385
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   386
     * @param liNav the content tree to which the gap will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   387
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   388
    protected void addNavGap(Content liNav) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   389
        liNav.addContent(getSpace());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   390
        liNav.addContent("|");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   391
        liNav.addContent(getSpace());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   392
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   393
06bc494ca11e Initial load
duke
parents:
diff changeset
   394
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   395
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   396
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   397
    public AnnotationTypeDoc getAnnotationTypeDoc() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   398
        return annotationType;
06bc494ca11e Initial load
duke
parents:
diff changeset
   399
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   400
}