langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
author bpatel
Mon, 02 May 2011 10:10:31 -0700
changeset 9608 385a828ba236
parent 9606 e5a619cb5dd3
child 13844 56339cf983a3
permissions -rw-r--r--
6553182: Need to modify javadoc doclet for GPL Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
8631
664f84942e74 6866185: Util.getPackageSourcePath should use lastIndexOf not indexOf and related cleanup
jjg
parents: 7681
diff changeset
     2
 * Copyright (c) 1998, 2011, 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: 3891
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: 3891
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: 3891
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 3891
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 3891
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
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
import java.io.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
import java.text.SimpleDateFormat;
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
import java.util.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
    32
import com.sun.javadoc.*;
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
    33
import com.sun.tools.doclets.formats.html.markup.*;
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
    34
import com.sun.tools.doclets.internal.toolkit.*;
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
    35
import com.sun.tools.doclets.internal.toolkit.util.*;
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
    36
import com.sun.tools.doclets.internal.toolkit.taglets.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 * Class for the Html Format Code Generation specific to JavaDoc.
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 * This Class contains methods related to the Html Code Generation which
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 * are used extensively while generating the entire documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 * @since 1.2
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 * @author Atul M Dambalkar
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 * @author Robert Field
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
    46
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
public class HtmlDocletWriter extends HtmlDocWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
     * Relative path from the file getting generated to the destination
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
     * directory. For example, if the file getting generated is
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
     * "java/lang/Object.html", then the relative path string is "../../".
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
     * This string can be empty if the file getting generated is in
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
     * the destination directory.
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
    public String relativePath = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
     * Same as relativepath, but normalized to never be empty or
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
     * end with a slash.
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
    public String relativepathNoSlash = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
     * Platform-dependent directory path from the current or the
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
     * destination directory to the file getting generated.
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
     * Used when creating the file.
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
     * For example, if the file getting generated is
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
     * "java/lang/Object.html", then the path string is "java/lang".
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
    public String path = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
     * Name of the file getting generated. If the file getting generated is
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
     * "java/lang/Object.html", then the filename is "Object.html".
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
    public String filename = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
     * The display length used for indentation while generating the class page.
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
    public int displayLength = 0;
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
     * The global configuration information for this run.
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
    public ConfigurationImpl configuration;
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    91
     * To check whether annotation heading is printed or not.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    92
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    93
    protected boolean printedAnnotationHeading = false;
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
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
     * Constructor to construct the HtmlStandardWriter object.
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
     * @param filename File to be generated.
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
    public HtmlDocletWriter(ConfigurationImpl configuration,
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
                              String filename) throws IOException {
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
        super(configuration, filename);
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
        this.configuration = configuration;
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
        this.filename = filename;
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
     * Constructor to construct the HtmlStandardWriter object.
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
     * @param path         Platform-dependent {@link #path} used when
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
     *                     creating file.
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
     * @param filename     Name of file to be generated.
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
     * @param relativePath Value for the variable {@link #relativePath}.
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
    public HtmlDocletWriter(ConfigurationImpl configuration,
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
                              String path, String filename,
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
                              String relativePath) throws IOException {
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
        super(configuration, path, filename);
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
        this.configuration = configuration;
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
        this.path = path;
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
        this.relativePath = relativePath;
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
        this.relativepathNoSlash =
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
            DirectoryManager.getPathNoTrailingSlash(this.relativePath);
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
        this.filename = filename;
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
     * Replace {@docRoot} tag used in options that accept HTML text, such
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
     * as -header, -footer, -top and -bottom, and when converting a relative
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
     * HREF where commentTagsToString inserts a {@docRoot} where one was
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
     * missing.  (Also see DocRootTaglet for {@docRoot} tags in doc
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
     * comments.)
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
     * <p>
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
     * Replace {&#064;docRoot} tag in htmlstr with the relative path to the
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
     * destination directory from the directory where the file is being
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
     * written, looping to handle all such tags in htmlstr.
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
     * <p>
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
     * For example, for "-d docs" and -header containing {&#064;docRoot}, when
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
     * the HTML page for source file p/C1.java is being generated, the
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
     * {&#064;docRoot} tag would be inserted into the header as "../",
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
     * the relative path from docs/p/ to docs/ (the document root).
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
     * <p>
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
     * Note: This doc comment was written with '&amp;#064;' representing '@'
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
     * to prevent the inline tag from being interpreted.
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
    public String replaceDocRootDir(String htmlstr) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
        // Return if no inline tags exist
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
        int index = htmlstr.indexOf("{@");
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
        if (index < 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
            return htmlstr;
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
        String lowerHtml = htmlstr.toLowerCase();
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
        // Return index of first occurrence of {@docroot}
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
        // Note: {@docRoot} is not case sensitive when passed in w/command line option
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
        index = lowerHtml.indexOf("{@docroot}", index);
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
        if (index < 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
            return htmlstr;
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
        }
8631
664f84942e74 6866185: Util.getPackageSourcePath should use lastIndexOf not indexOf and related cleanup
jjg
parents: 7681
diff changeset
   159
        StringBuilder buf = new StringBuilder();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
        int previndex = 0;
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
        while (true) {
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   162
            if (configuration.docrootparent.length() > 0) {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   163
                // Search for lowercase version of {@docRoot}/..
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   164
                index = lowerHtml.indexOf("{@docroot}/..", previndex);
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   165
                // If next {@docRoot}/.. pattern not found, append rest of htmlstr and exit loop
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   166
                if (index < 0) {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   167
                    buf.append(htmlstr.substring(previndex));
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   168
                    break;
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   169
                }
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   170
                // If next {@docroot}/.. pattern found, append htmlstr up to start of tag
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   171
                buf.append(htmlstr.substring(previndex, index));
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   172
                previndex = index + 13;  // length for {@docroot}/.. string
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   173
                // Insert docrootparent absolute path where {@docRoot}/.. was located
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   174
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   175
                buf.append(configuration.docrootparent);
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   176
                // Append slash if next character is not a slash
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   177
                if (previndex < htmlstr.length() && htmlstr.charAt(previndex) != '/') {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   178
                    buf.append(DirectoryManager.URL_FILE_SEPARATOR);
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   179
                }
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   180
            } else {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   181
                // Search for lowercase version of {@docRoot}
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   182
                index = lowerHtml.indexOf("{@docroot}", previndex);
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   183
                // If next {@docRoot} tag not found, append rest of htmlstr and exit loop
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   184
                if (index < 0) {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   185
                    buf.append(htmlstr.substring(previndex));
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   186
                    break;
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   187
                }
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   188
                // If next {@docroot} tag found, append htmlstr up to start of tag
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   189
                buf.append(htmlstr.substring(previndex, index));
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   190
                previndex = index + 10;  // length for {@docroot} string
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   191
                // Insert relative path where {@docRoot} was located
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   192
                buf.append(relativepathNoSlash);
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   193
                // Append slash if next character is not a slash
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   194
                if (relativepathNoSlash.length() > 0 && previndex < htmlstr.length() &&
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   195
                        htmlstr.charAt(previndex) != '/') {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   196
                    buf.append(DirectoryManager.URL_FILE_SEPARATOR);
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
   197
                }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
        return buf.toString();
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
     * Print Html Hyper Link, with target frame.  This
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
     * link will only appear if page is not in a frame.
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
     * @param link String name of the file.
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
     * @param where Position in the file
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
     * @param target Name of the target frame.
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
     * @param label Tag for the link.
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
   211
     * @param strong Whether the label should be strong or not?
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
    public void printNoFramesTargetHyperLink(String link, String where,
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
                                               String target, String label,
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
   215
                                               boolean strong) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
        script();
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
        println("  <!--");
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
        println("  if(window==top) {");
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
        println("    document.writeln('"
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   220
            + getHyperLinkString(link, where, label, strong, "", "", target) + "');");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
        println("  }");
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
        println("  //-->");
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
        scriptEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
        noScript();
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   225
        println("  " + getHyperLinkString(link, where, label, strong, "", "", target));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
        noScriptEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
        println(DocletConstants.NL);
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   230
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   231
     * Get the script to show or hide the All classes link.
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
     * @param id id of the element to show or hide
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   234
     * @return a content tree for the script
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   235
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   236
    public Content getAllClassesLinkScript(String id) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   237
        HtmlTree script = new HtmlTree(HtmlTag.SCRIPT);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   238
        script.addAttr(HtmlAttr.TYPE, "text/javascript");
7641
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   239
        String scriptCode = "<!--" + DocletConstants.NL +
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   240
                "  allClassesLink = document.getElementById(\"" + id + "\");" + DocletConstants.NL +
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   241
                "  if(window==top) {" + DocletConstants.NL +
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   242
                "    allClassesLink.style.display = \"block\";" + DocletConstants.NL +
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   243
                "  }" + DocletConstants.NL +
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   244
                "  else {" + DocletConstants.NL +
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   245
                "    allClassesLink.style.display = \"none\";" + DocletConstants.NL +
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   246
                "  }" + DocletConstants.NL +
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   247
                "  //-->" + DocletConstants.NL;
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   248
        Content scriptContent = new RawHtml(scriptCode);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   249
        script.addContent(scriptContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   250
        Content div = HtmlTree.DIV(script);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   251
        return div;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   252
    }
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
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   255
     * Add method information.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   256
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   257
     * @param method the method to be documented
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   258
     * @param dl the content tree to which the method information will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   259
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   260
    private void addMethodInfo(MethodDoc method, Content dl) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
        ClassDoc[] intfacs = method.containingClass().interfaces();
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
        MethodDoc overriddenMethod = method.overriddenMethod();
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   263
        // Check whether there is any implementation or overridden info to be
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   264
        // printed. If no overridden or implementation info needs to be
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   265
        // printed, do not print this section.
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   266
        if ((intfacs.length > 0 &&
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   267
                new ImplementedMethods(method, this.configuration).build().length > 0) ||
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   268
                overriddenMethod != null) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   269
            MethodWriterImpl.addImplementsInfo(this, method, dl);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
            if (overriddenMethod != null) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   271
                MethodWriterImpl.addOverridden(this,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   272
                        method.overriddenType(), overriddenMethod, dl);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   277
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   278
     * Adds the tags information.
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
     * @param doc the doc for which the tags will be generated
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   281
     * @param htmltree the documentation tree to which the tags will be added
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 void addTagsInfo(Doc doc, Content htmltree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   284
        if (configuration.nocomment) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
            return;
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   287
        Content dl = new HtmlTree(HtmlTag.DL);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
        if (doc instanceof MethodDoc) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   289
            addMethodInfo((MethodDoc) doc, dl);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
        TagletOutputImpl output = new TagletOutputImpl("");
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
        TagletWriter.genTagOuput(configuration.tagletManager, doc,
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
            configuration.tagletManager.getCustomTags(doc),
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
                getTagletWriterInstance(false), output);
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   295
        String outputString = output.toString().trim();
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   296
        if (!outputString.isEmpty()) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   297
            Content resultString = new RawHtml(outputString);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   298
            dl.addContent(resultString);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   300
        htmltree.addContent(dl);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
    /**
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   304
     * Check whether there are any tags for Serialization Overview
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   305
     * section to be printed.
2086
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 1789
diff changeset
   306
     *
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   307
     * @param field the FieldDoc object to check for tags.
2086
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 1789
diff changeset
   308
     * @return true if there are tags to be printed else return false.
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 1789
diff changeset
   309
     */
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   310
    protected boolean hasSerializationOverviewTags(FieldDoc field) {
2086
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 1789
diff changeset
   311
        TagletOutputImpl output = new TagletOutputImpl("");
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   312
        TagletWriter.genTagOuput(configuration.tagletManager, field,
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   313
            configuration.tagletManager.getCustomTags(field),
2086
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 1789
diff changeset
   314
                getTagletWriterInstance(false), output);
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   315
        return (!output.toString().trim().isEmpty());
2086
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 1789
diff changeset
   316
    }
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 1789
diff changeset
   317
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 1789
diff changeset
   318
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   319
     * Returns a TagletWriter that knows how to write HTML.
06bc494ca11e Initial load
duke
parents:
diff changeset
   320
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   321
     * @return a TagletWriter that knows how to write HTML.
06bc494ca11e Initial load
duke
parents:
diff changeset
   322
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   323
    public TagletWriter getTagletWriterInstance(boolean isFirstSentence) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   324
        return new TagletWriterImpl(this, isFirstSentence);
06bc494ca11e Initial load
duke
parents:
diff changeset
   325
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   326
06bc494ca11e Initial load
duke
parents:
diff changeset
   327
    protected void printTagsInfoHeader() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   328
        dl();
06bc494ca11e Initial load
duke
parents:
diff changeset
   329
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   330
06bc494ca11e Initial load
duke
parents:
diff changeset
   331
    protected void printTagsInfoFooter() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   332
        dlEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   333
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   334
06bc494ca11e Initial load
duke
parents:
diff changeset
   335
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   336
     * Get Package link, with target frame.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   337
     *
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   338
     * @param pd The link will be to the "package-summary.html" page for this package
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   339
     * @param target name of the target frame
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   340
     * @param label tag for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   341
     * @return a content for the target package link
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   342
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   343
    public Content getTargetPackageLink(PackageDoc pd, String target,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   344
            Content label) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   345
        return getHyperLink(pathString(pd, "package-summary.html"), "", label, "", target);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   346
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   347
06bc494ca11e Initial load
duke
parents:
diff changeset
   348
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   349
     * Print the html file header. Also print Html page title and stylesheet
06bc494ca11e Initial load
duke
parents:
diff changeset
   350
     * default properties.
06bc494ca11e Initial load
duke
parents:
diff changeset
   351
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   352
     * @param title         String window title to go in the &lt;TITLE&gt; tag
06bc494ca11e Initial load
duke
parents:
diff changeset
   353
     * @param metakeywords  Array of String keywords for META tag.  Each element
06bc494ca11e Initial load
duke
parents:
diff changeset
   354
     *                      of the array is assigned to a separate META tag.
06bc494ca11e Initial load
duke
parents:
diff changeset
   355
     *                      Pass in null for no array.
06bc494ca11e Initial load
duke
parents:
diff changeset
   356
     * @param includeScript boolean true if printing windowtitle script.
06bc494ca11e Initial load
duke
parents:
diff changeset
   357
     *             False for files that appear in the left-hand frames.
06bc494ca11e Initial load
duke
parents:
diff changeset
   358
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   359
    public void printHtmlHeader(String title, String[] metakeywords,
06bc494ca11e Initial load
duke
parents:
diff changeset
   360
            boolean includeScript) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   361
        println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 " +
06bc494ca11e Initial load
duke
parents:
diff changeset
   362
                    "Transitional//EN\" " +
06bc494ca11e Initial load
duke
parents:
diff changeset
   363
                    "\"http://www.w3.org/TR/html4/loose.dtd\">");
06bc494ca11e Initial load
duke
parents:
diff changeset
   364
        println("<!--NewPage-->");
06bc494ca11e Initial load
duke
parents:
diff changeset
   365
        html();
06bc494ca11e Initial load
duke
parents:
diff changeset
   366
        head();
06bc494ca11e Initial load
duke
parents:
diff changeset
   367
        if (! configuration.notimestamp) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   368
            print("<!-- Generated by javadoc (build " + ConfigurationImpl.BUILD_DATE + ") on ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   369
            print(today());
06bc494ca11e Initial load
duke
parents:
diff changeset
   370
            println(" -->");
06bc494ca11e Initial load
duke
parents:
diff changeset
   371
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   372
        if (configuration.charset.length() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   373
            println("<META http-equiv=\"Content-Type\" content=\"text/html; "
06bc494ca11e Initial load
duke
parents:
diff changeset
   374
                        + "charset=" + configuration.charset + "\">");
06bc494ca11e Initial load
duke
parents:
diff changeset
   375
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   376
        if ( configuration.windowtitle.length() > 0 ) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   377
            title += " (" + configuration.windowtitle  + ")";
06bc494ca11e Initial load
duke
parents:
diff changeset
   378
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   379
        title(title);
06bc494ca11e Initial load
duke
parents:
diff changeset
   380
        println(title);
06bc494ca11e Initial load
duke
parents:
diff changeset
   381
        titleEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   382
        println("");
06bc494ca11e Initial load
duke
parents:
diff changeset
   383
        if (! configuration.notimestamp) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   384
                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
06bc494ca11e Initial load
duke
parents:
diff changeset
   385
                println("<META NAME=\"date\" "
06bc494ca11e Initial load
duke
parents:
diff changeset
   386
                                    + "CONTENT=\"" + dateFormat.format(new Date()) + "\">");
06bc494ca11e Initial load
duke
parents:
diff changeset
   387
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   388
        if ( metakeywords != null ) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   389
            for ( int i=0; i < metakeywords.length; i++ ) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   390
                println("<META NAME=\"keywords\" "
06bc494ca11e Initial load
duke
parents:
diff changeset
   391
                            + "CONTENT=\"" + metakeywords[i] + "\">");
06bc494ca11e Initial load
duke
parents:
diff changeset
   392
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   393
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   394
        println("");
06bc494ca11e Initial load
duke
parents:
diff changeset
   395
        printStyleSheetProperties();
06bc494ca11e Initial load
duke
parents:
diff changeset
   396
        println("");
06bc494ca11e Initial load
duke
parents:
diff changeset
   397
        // Don't print windowtitle script for overview-frame, allclasses-frame
06bc494ca11e Initial load
duke
parents:
diff changeset
   398
        // and package-frame
06bc494ca11e Initial load
duke
parents:
diff changeset
   399
        if (includeScript) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   400
            printWinTitleScript(title);
06bc494ca11e Initial load
duke
parents:
diff changeset
   401
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   402
        println("");
06bc494ca11e Initial load
duke
parents:
diff changeset
   403
        headEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   404
        println("");
06bc494ca11e Initial load
duke
parents:
diff changeset
   405
        body("white", includeScript);
06bc494ca11e Initial load
duke
parents:
diff changeset
   406
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   407
06bc494ca11e Initial load
duke
parents:
diff changeset
   408
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   409
     * Generates the HTML document tree and prints it out.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   410
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   411
     * @param metakeywords Array of String keywords for META tag. Each element
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   412
     *                     of the array is assigned to a separate META tag.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   413
     *                     Pass in null for no array
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   414
     * @param includeScript true if printing windowtitle script
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   415
     *                      false for files that appear in the left-hand frames
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   416
     * @param body the body htmltree to be included in the document
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   417
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   418
    public void printHtmlDocument(String[] metakeywords, boolean includeScript,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   419
            Content body) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   420
        Content htmlDocType = DocType.Transitional();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   421
        Content htmlComment = new Comment(configuration.getText("doclet.New_Page"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   422
        Content head = new HtmlTree(HtmlTag.HEAD);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   423
        if (!configuration.notimestamp) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   424
            Content headComment = new Comment("Generated by javadoc (version " +
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   425
                    ConfigurationImpl.BUILD_DATE + ") on " + today());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   426
            head.addContent(headComment);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   427
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   428
        if (configuration.charset.length() > 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   429
            Content meta = HtmlTree.META("Content-Type", "text/html",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   430
                    configuration.charset);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   431
            head.addContent(meta);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   432
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   433
        head.addContent(getTitle());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   434
        if (!configuration.notimestamp) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   435
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   436
            Content meta = HtmlTree.META("date", dateFormat.format(new Date()));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   437
            head.addContent(meta);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   438
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   439
        if (metakeywords != null) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   440
            for (int i=0; i < metakeywords.length; i++) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   441
                Content meta = HtmlTree.META("keywords", metakeywords[i]);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   442
                head.addContent(meta);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   443
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   444
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   445
        head.addContent(getStyleSheetProperties());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   446
        Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(),
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   447
                head, body);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   448
        Content htmlDocument = new HtmlDocument(htmlDocType,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   449
                htmlComment, htmlTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   450
        print(htmlDocument.toString());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   451
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   452
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   453
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   454
     * Get the window title.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   455
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   456
     * @param title the title string to construct the complete window title
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   457
     * @return the window title string
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   458
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   459
    public String getWindowTitle(String title) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   460
        if (configuration.windowtitle.length() > 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   461
            title += " (" + configuration.windowtitle  + ")";
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   462
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   463
        return title;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   464
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   465
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   466
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   467
     * Print user specified header and the footer.
06bc494ca11e Initial load
duke
parents:
diff changeset
   468
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   469
     * @param header if true print the user provided header else print the
06bc494ca11e Initial load
duke
parents:
diff changeset
   470
     * user provided footer.
06bc494ca11e Initial load
duke
parents:
diff changeset
   471
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   472
    public void printUserHeaderFooter(boolean header) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   473
        em();
06bc494ca11e Initial load
duke
parents:
diff changeset
   474
        if (header) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   475
            print(replaceDocRootDir(configuration.header));
06bc494ca11e Initial load
duke
parents:
diff changeset
   476
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   477
            if (configuration.footer.length() != 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   478
                print(replaceDocRootDir(configuration.footer));
06bc494ca11e Initial load
duke
parents:
diff changeset
   479
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   480
                print(replaceDocRootDir(configuration.header));
06bc494ca11e Initial load
duke
parents:
diff changeset
   481
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   482
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   483
        emEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   484
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   485
06bc494ca11e Initial load
duke
parents:
diff changeset
   486
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   487
     * Get user specified header and the footer.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   488
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   489
     * @param header if true print the user provided header else print the
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   490
     * user provided footer.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   491
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   492
    public Content getUserHeaderFooter(boolean header) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   493
        String content;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   494
        if (header) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   495
            content = replaceDocRootDir(configuration.header);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   496
        } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   497
            if (configuration.footer.length() != 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   498
                content = replaceDocRootDir(configuration.footer);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   499
            } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   500
                content = replaceDocRootDir(configuration.header);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   501
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   502
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   503
        Content rawContent = new RawHtml(content);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   504
        Content em = HtmlTree.EM(rawContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   505
        return em;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   506
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   507
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   508
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   509
     * Print the user specified top.
06bc494ca11e Initial load
duke
parents:
diff changeset
   510
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   511
    public void printTop() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   512
        print(replaceDocRootDir(configuration.top));
06bc494ca11e Initial load
duke
parents:
diff changeset
   513
        hr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   514
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   515
06bc494ca11e Initial load
duke
parents:
diff changeset
   516
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   517
     * Adds the user specified top.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   518
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   519
     * @param body the content tree to which user specified top will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   520
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   521
    public void addTop(Content body) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   522
        Content top = new RawHtml(replaceDocRootDir(configuration.top));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   523
        body.addContent(top);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   524
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   525
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   526
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   527
     * Print the user specified bottom.
06bc494ca11e Initial load
duke
parents:
diff changeset
   528
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   529
    public void printBottom() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   530
        hr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   531
        print(replaceDocRootDir(configuration.bottom));
06bc494ca11e Initial load
duke
parents:
diff changeset
   532
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   533
06bc494ca11e Initial load
duke
parents:
diff changeset
   534
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   535
     * Adds the user specified bottom.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   536
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   537
     * @param body the content tree to which user specified bottom will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   538
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   539
    public void addBottom(Content body) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   540
        Content bottom = new RawHtml(replaceDocRootDir(configuration.bottom));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   541
        Content small = HtmlTree.SMALL(bottom);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   542
        Content p = HtmlTree.P(HtmlStyle.legalCopy, small);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   543
        body.addContent(p);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   544
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   545
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   546
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   547
     * Print the navigation bar for the Html page at the top and and the bottom.
06bc494ca11e Initial load
duke
parents:
diff changeset
   548
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   549
     * @param header If true print navigation bar at the top of the page else
06bc494ca11e Initial load
duke
parents:
diff changeset
   550
     * print the nevigation bar at the bottom.
06bc494ca11e Initial load
duke
parents:
diff changeset
   551
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   552
    protected void navLinks(boolean header) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   553
        println("");
06bc494ca11e Initial load
duke
parents:
diff changeset
   554
        if (!configuration.nonavbar) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   555
            if (header) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   556
                println(DocletConstants.NL + "<!-- ========= START OF TOP NAVBAR ======= -->");
06bc494ca11e Initial load
duke
parents:
diff changeset
   557
                anchor("navbar_top");
06bc494ca11e Initial load
duke
parents:
diff changeset
   558
                println();
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   559
                print(getHyperLinkString("", "skip-navbar_top", "", false, "",
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   560
                    configuration.getText("doclet.Skip_navigation_links"), ""));
06bc494ca11e Initial load
duke
parents:
diff changeset
   561
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   562
                println(DocletConstants.NL + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
06bc494ca11e Initial load
duke
parents:
diff changeset
   563
                anchor("navbar_bottom");
06bc494ca11e Initial load
duke
parents:
diff changeset
   564
                println();
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   565
                print(getHyperLinkString("", "skip-navbar_bottom", "", false, "",
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   566
                    configuration.getText("doclet.Skip_navigation_links"), ""));
06bc494ca11e Initial load
duke
parents:
diff changeset
   567
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   568
            table(0, "100%", 1, 0);
06bc494ca11e Initial load
duke
parents:
diff changeset
   569
            tr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   570
            tdColspanBgcolorStyle(2, "#EEEEFF", "NavBarCell1");
06bc494ca11e Initial load
duke
parents:
diff changeset
   571
            println("");
06bc494ca11e Initial load
duke
parents:
diff changeset
   572
            if (header) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   573
                anchor("navbar_top_firstrow");
06bc494ca11e Initial load
duke
parents:
diff changeset
   574
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   575
                anchor("navbar_bottom_firstrow");
06bc494ca11e Initial load
duke
parents:
diff changeset
   576
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   577
            table(0, 0, 3);
06bc494ca11e Initial load
duke
parents:
diff changeset
   578
            print("  ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   579
            trAlignVAlign("center", "top");
06bc494ca11e Initial load
duke
parents:
diff changeset
   580
06bc494ca11e Initial load
duke
parents:
diff changeset
   581
            if (configuration.createoverview) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   582
                navLinkContents();
06bc494ca11e Initial load
duke
parents:
diff changeset
   583
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   584
06bc494ca11e Initial load
duke
parents:
diff changeset
   585
            if (configuration.packages.length == 1) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   586
                navLinkPackage(configuration.packages[0]);
06bc494ca11e Initial load
duke
parents:
diff changeset
   587
            } else if (configuration.packages.length > 1) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   588
                navLinkPackage();
06bc494ca11e Initial load
duke
parents:
diff changeset
   589
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   590
06bc494ca11e Initial load
duke
parents:
diff changeset
   591
            navLinkClass();
06bc494ca11e Initial load
duke
parents:
diff changeset
   592
06bc494ca11e Initial load
duke
parents:
diff changeset
   593
            if(configuration.classuse) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   594
                navLinkClassUse();
06bc494ca11e Initial load
duke
parents:
diff changeset
   595
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   596
            if(configuration.createtree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   597
                navLinkTree();
06bc494ca11e Initial load
duke
parents:
diff changeset
   598
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   599
            if(!(configuration.nodeprecated ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   600
                     configuration.nodeprecatedlist)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   601
                navLinkDeprecated();
06bc494ca11e Initial load
duke
parents:
diff changeset
   602
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   603
            if(configuration.createindex) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   604
                navLinkIndex();
06bc494ca11e Initial load
duke
parents:
diff changeset
   605
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   606
            if (!configuration.nohelp) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   607
                navLinkHelp();
06bc494ca11e Initial load
duke
parents:
diff changeset
   608
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   609
            print("  ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   610
            trEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   611
            tableEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   612
            tdEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   613
06bc494ca11e Initial load
duke
parents:
diff changeset
   614
            tdAlignVAlignRowspan("right", "top", 3);
06bc494ca11e Initial load
duke
parents:
diff changeset
   615
06bc494ca11e Initial load
duke
parents:
diff changeset
   616
            printUserHeaderFooter(header);
06bc494ca11e Initial load
duke
parents:
diff changeset
   617
            tdEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   618
            trEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   619
            println("");
06bc494ca11e Initial load
duke
parents:
diff changeset
   620
06bc494ca11e Initial load
duke
parents:
diff changeset
   621
            tr();
06bc494ca11e Initial load
duke
parents:
diff changeset
   622
            tdBgcolorStyle("white", "NavBarCell2");
06bc494ca11e Initial load
duke
parents:
diff changeset
   623
            font("-2");
06bc494ca11e Initial load
duke
parents:
diff changeset
   624
            space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   625
            navLinkPrevious();
06bc494ca11e Initial load
duke
parents:
diff changeset
   626
            space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   627
            println("");
06bc494ca11e Initial load
duke
parents:
diff changeset
   628
            space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   629
            navLinkNext();
06bc494ca11e Initial load
duke
parents:
diff changeset
   630
            fontEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   631
            tdEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   632
06bc494ca11e Initial load
duke
parents:
diff changeset
   633
            tdBgcolorStyle("white", "NavBarCell2");
06bc494ca11e Initial load
duke
parents:
diff changeset
   634
            font("-2");
06bc494ca11e Initial load
duke
parents:
diff changeset
   635
            print("  ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   636
            navShowLists();
06bc494ca11e Initial load
duke
parents:
diff changeset
   637
            print("  ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   638
            space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   639
            println("");
06bc494ca11e Initial load
duke
parents:
diff changeset
   640
            space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   641
            navHideLists(filename);
06bc494ca11e Initial load
duke
parents:
diff changeset
   642
            print("  ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   643
            space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   644
            println("");
06bc494ca11e Initial load
duke
parents:
diff changeset
   645
            space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   646
            navLinkClassIndex();
06bc494ca11e Initial load
duke
parents:
diff changeset
   647
            fontEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   648
            tdEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   649
06bc494ca11e Initial load
duke
parents:
diff changeset
   650
            trEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   651
06bc494ca11e Initial load
duke
parents:
diff changeset
   652
            printSummaryDetailLinks();
06bc494ca11e Initial load
duke
parents:
diff changeset
   653
06bc494ca11e Initial load
duke
parents:
diff changeset
   654
            tableEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   655
            if (header) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   656
                aName("skip-navbar_top");
06bc494ca11e Initial load
duke
parents:
diff changeset
   657
                aEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   658
                println(DocletConstants.NL + "<!-- ========= END OF TOP NAVBAR ========= -->");
06bc494ca11e Initial load
duke
parents:
diff changeset
   659
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   660
                aName("skip-navbar_bottom");
06bc494ca11e Initial load
duke
parents:
diff changeset
   661
                aEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   662
                println(DocletConstants.NL + "<!-- ======== END OF BOTTOM NAVBAR ======= -->");
06bc494ca11e Initial load
duke
parents:
diff changeset
   663
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   664
            println("");
06bc494ca11e Initial load
duke
parents:
diff changeset
   665
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   666
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   667
06bc494ca11e Initial load
duke
parents:
diff changeset
   668
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   669
     * Adds the navigation bar for the Html page at the top and and the bottom.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   670
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   671
     * @param header If true print navigation bar at the top of the page else
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   672
     * @param body the HtmlTree to which the nav links will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   673
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   674
    protected void addNavLinks(boolean header, Content body) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   675
        if (!configuration.nonavbar) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   676
            String allClassesId = "allclasses_";
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   677
            HtmlTree navDiv = new HtmlTree(HtmlTag.DIV);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   678
            if (header) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   679
                body.addContent(HtmlConstants.START_OF_TOP_NAVBAR);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   680
                navDiv.addStyle(HtmlStyle.topNav);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   681
                allClassesId += "navbar_top";
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   682
                Content a = getMarkerAnchor("navbar_top");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   683
                navDiv.addContent(a);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   684
                Content skipLinkContent = getHyperLink("",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   685
                        "skip-navbar_top", HtmlTree.EMPTY, configuration.getText(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   686
                        "doclet.Skip_navigation_links"), "");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   687
                navDiv.addContent(skipLinkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   688
            } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   689
                body.addContent(HtmlConstants.START_OF_BOTTOM_NAVBAR);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   690
                navDiv.addStyle(HtmlStyle.bottomNav);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   691
                allClassesId += "navbar_bottom";
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   692
                Content a = getMarkerAnchor("navbar_bottom");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   693
                navDiv.addContent(a);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   694
                Content skipLinkContent = getHyperLink("",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   695
                        "skip-navbar_bottom", HtmlTree.EMPTY, configuration.getText(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   696
                        "doclet.Skip_navigation_links"), "");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   697
                navDiv.addContent(skipLinkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   698
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   699
            if (header) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   700
                navDiv.addContent(getMarkerAnchor("navbar_top_firstrow"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   701
            } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   702
                navDiv.addContent(getMarkerAnchor("navbar_bottom_firstrow"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   703
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   704
            HtmlTree navList = new HtmlTree(HtmlTag.UL);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   705
            navList.addStyle(HtmlStyle.navList);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   706
            navList.addAttr(HtmlAttr.TITLE, "Navigation");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   707
            if (configuration.createoverview) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   708
                navList.addContent(getNavLinkContents());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   709
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   710
            if (configuration.packages.length == 1) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   711
                navList.addContent(getNavLinkPackage(configuration.packages[0]));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   712
            } else if (configuration.packages.length > 1) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   713
                navList.addContent(getNavLinkPackage());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   714
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   715
            navList.addContent(getNavLinkClass());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   716
            if(configuration.classuse) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   717
                navList.addContent(getNavLinkClassUse());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   718
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   719
            if(configuration.createtree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   720
                navList.addContent(getNavLinkTree());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   721
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   722
            if(!(configuration.nodeprecated ||
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   723
                     configuration.nodeprecatedlist)) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   724
                navList.addContent(getNavLinkDeprecated());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   725
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   726
            if(configuration.createindex) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   727
                navList.addContent(getNavLinkIndex());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   728
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   729
            if (!configuration.nohelp) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   730
                navList.addContent(getNavLinkHelp());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   731
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   732
            navDiv.addContent(navList);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   733
            Content aboutDiv = HtmlTree.DIV(HtmlStyle.aboutLanguage, getUserHeaderFooter(header));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   734
            navDiv.addContent(aboutDiv);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   735
            body.addContent(navDiv);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   736
            Content ulNav = HtmlTree.UL(HtmlStyle.navList, getNavLinkPrevious());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   737
            ulNav.addContent(getNavLinkNext());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   738
            Content subDiv = HtmlTree.DIV(HtmlStyle.subNav, ulNav);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   739
            Content ulFrames = HtmlTree.UL(HtmlStyle.navList, getNavShowLists());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   740
            ulFrames.addContent(getNavHideLists(filename));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   741
            subDiv.addContent(ulFrames);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   742
            HtmlTree ulAllClasses = HtmlTree.UL(HtmlStyle.navList, getNavLinkClassIndex());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   743
            ulAllClasses.addAttr(HtmlAttr.ID, allClassesId.toString());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   744
            subDiv.addContent(ulAllClasses);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   745
            subDiv.addContent(getAllClassesLinkScript(allClassesId.toString()));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   746
            addSummaryDetailLinks(subDiv);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   747
            if (header) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   748
                subDiv.addContent(getMarkerAnchor("skip-navbar_top"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   749
                body.addContent(subDiv);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   750
                body.addContent(HtmlConstants.END_OF_TOP_NAVBAR);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   751
            } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   752
                subDiv.addContent(getMarkerAnchor("skip-navbar_bottom"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   753
                body.addContent(subDiv);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   754
                body.addContent(HtmlConstants.END_OF_BOTTOM_NAVBAR);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   755
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   756
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   757
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   758
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   759
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   760
     * Print the word "NEXT" to indicate that no link is available.  Override
06bc494ca11e Initial load
duke
parents:
diff changeset
   761
     * this method to customize next link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   762
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   763
    protected void navLinkNext() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   764
        navLinkNext(null);
06bc494ca11e Initial load
duke
parents:
diff changeset
   765
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   766
06bc494ca11e Initial load
duke
parents:
diff changeset
   767
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   768
     * Get the word "NEXT" to indicate that no link is available.  Override
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   769
     * this method to customize next link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   770
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   771
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   772
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   773
    protected Content getNavLinkNext() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   774
        return getNavLinkNext(null);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   775
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   776
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   777
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   778
     * Print the word "PREV" to indicate that no link is available.  Override
06bc494ca11e Initial load
duke
parents:
diff changeset
   779
     * this method to customize prev link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   780
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   781
    protected void navLinkPrevious() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   782
        navLinkPrevious(null);
06bc494ca11e Initial load
duke
parents:
diff changeset
   783
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   784
06bc494ca11e Initial load
duke
parents:
diff changeset
   785
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   786
     * Get the word "PREV" to indicate that no link is available.  Override
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   787
     * this method to customize prev link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   788
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   789
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   790
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   791
    protected Content getNavLinkPrevious() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   792
        return getNavLinkPrevious(null);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   793
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   794
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   795
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   796
     * Do nothing. This is the default method.
06bc494ca11e Initial load
duke
parents:
diff changeset
   797
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   798
    protected void printSummaryDetailLinks() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   799
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   800
06bc494ca11e Initial load
duke
parents:
diff changeset
   801
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   802
     * Do nothing. This is the default method.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   803
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   804
    protected void addSummaryDetailLinks(Content navDiv) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   805
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   806
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   807
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   808
     * Print link to the "overview-summary.html" page.
06bc494ca11e Initial load
duke
parents:
diff changeset
   809
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   810
    protected void navLinkContents() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   811
        navCellStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
   812
        printHyperLink(relativePath + "overview-summary.html", "",
06bc494ca11e Initial load
duke
parents:
diff changeset
   813
                       configuration.getText("doclet.Overview"), true, "NavBarFont1");
06bc494ca11e Initial load
duke
parents:
diff changeset
   814
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   815
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   816
06bc494ca11e Initial load
duke
parents:
diff changeset
   817
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   818
     * Get link to the "overview-summary.html" page.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   819
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   820
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   821
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   822
    protected Content getNavLinkContents() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   823
        Content linkContent = getHyperLink(relativePath +
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   824
                "overview-summary.html", "", overviewLabel, "", "");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   825
        Content li = HtmlTree.LI(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   826
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   827
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   828
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   829
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   830
     * Description for a cell in the navigation bar.
06bc494ca11e Initial load
duke
parents:
diff changeset
   831
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   832
    protected void navCellStart() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   833
        print("  ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   834
        tdBgcolorStyle("#EEEEFF", "NavBarCell1");
06bc494ca11e Initial load
duke
parents:
diff changeset
   835
        print("    ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   836
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   837
06bc494ca11e Initial load
duke
parents:
diff changeset
   838
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   839
     * Description for a cell in the navigation bar, but with reverse
06bc494ca11e Initial load
duke
parents:
diff changeset
   840
     * high-light effect.
06bc494ca11e Initial load
duke
parents:
diff changeset
   841
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   842
    protected void navCellRevStart() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   843
        print("  ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   844
        tdBgcolorStyle("#FFFFFF", "NavBarCell1Rev");
06bc494ca11e Initial load
duke
parents:
diff changeset
   845
        print(" ");
06bc494ca11e Initial load
duke
parents:
diff changeset
   846
        space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   847
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   848
06bc494ca11e Initial load
duke
parents:
diff changeset
   849
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   850
     * Closing tag for navigation bar cell.
06bc494ca11e Initial load
duke
parents:
diff changeset
   851
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   852
    protected void navCellEnd() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   853
        space();
06bc494ca11e Initial load
duke
parents:
diff changeset
   854
        tdEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   855
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   856
06bc494ca11e Initial load
duke
parents:
diff changeset
   857
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   858
     * Print link to the "package-summary.html" page for the package passed.
06bc494ca11e Initial load
duke
parents:
diff changeset
   859
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   860
     * @param pkg Package to which link will be generated.
06bc494ca11e Initial load
duke
parents:
diff changeset
   861
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   862
    protected void navLinkPackage(PackageDoc pkg) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   863
        navCellStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
   864
        printPackageLink(pkg, configuration.getText("doclet.Package"), true,
06bc494ca11e Initial load
duke
parents:
diff changeset
   865
            "NavBarFont1");
06bc494ca11e Initial load
duke
parents:
diff changeset
   866
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   867
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   868
06bc494ca11e Initial load
duke
parents:
diff changeset
   869
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   870
     * Get link to the "package-summary.html" page for the package passed.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   871
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   872
     * @param pkg Package to which link will be generated
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   873
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   874
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   875
    protected Content getNavLinkPackage(PackageDoc pkg) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   876
        Content linkContent = getPackageLink(pkg,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   877
                packageLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   878
        Content li = HtmlTree.LI(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   879
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   880
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   881
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   882
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   883
     * Print the word "Package" in the navigation bar cell, to indicate that
06bc494ca11e Initial load
duke
parents:
diff changeset
   884
     * link is not available here.
06bc494ca11e Initial load
duke
parents:
diff changeset
   885
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   886
    protected void navLinkPackage() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   887
        navCellStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
   888
        fontStyle("NavBarFont1");
06bc494ca11e Initial load
duke
parents:
diff changeset
   889
        printText("doclet.Package");
06bc494ca11e Initial load
duke
parents:
diff changeset
   890
        fontEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   891
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   892
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   893
06bc494ca11e Initial load
duke
parents:
diff changeset
   894
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   895
     * Get the word "Package" , to indicate that link is not available here.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   896
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   897
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   898
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   899
    protected Content getNavLinkPackage() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   900
        Content li = HtmlTree.LI(packageLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   901
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   902
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   903
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   904
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   905
     * Print the word "Use" in the navigation bar cell, to indicate that link
06bc494ca11e Initial load
duke
parents:
diff changeset
   906
     * is not available.
06bc494ca11e Initial load
duke
parents:
diff changeset
   907
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   908
    protected void navLinkClassUse() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   909
        navCellStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
   910
        fontStyle("NavBarFont1");
06bc494ca11e Initial load
duke
parents:
diff changeset
   911
        printText("doclet.navClassUse");
06bc494ca11e Initial load
duke
parents:
diff changeset
   912
        fontEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   913
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
   914
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   915
06bc494ca11e Initial load
duke
parents:
diff changeset
   916
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   917
     * Get the word "Use", to indicate that link is not available.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   918
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   919
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   920
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   921
    protected Content getNavLinkClassUse() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   922
        Content li = HtmlTree.LI(useLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   923
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   924
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   925
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   926
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   927
     * Print link for previous file.
06bc494ca11e Initial load
duke
parents:
diff changeset
   928
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   929
     * @param prev File name for the prev link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   930
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   931
    public void navLinkPrevious(String prev) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   932
        String tag = configuration.getText("doclet.Prev");
06bc494ca11e Initial load
duke
parents:
diff changeset
   933
        if (prev != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   934
            printHyperLink(prev, "", tag, true) ;
06bc494ca11e Initial load
duke
parents:
diff changeset
   935
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   936
            print(tag);
06bc494ca11e Initial load
duke
parents:
diff changeset
   937
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   938
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   939
06bc494ca11e Initial load
duke
parents:
diff changeset
   940
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   941
     * Get link for previous file.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   942
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   943
     * @param prev File name for the prev link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   944
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   945
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   946
    public Content getNavLinkPrevious(String prev) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   947
        Content li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   948
        if (prev != null) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   949
            li = HtmlTree.LI(getHyperLink(prev, "", prevLabel, "", ""));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   950
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   951
        else
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   952
            li = HtmlTree.LI(prevLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   953
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   954
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   955
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   956
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   957
     * Print link for next file.  If next is null, just print the label
06bc494ca11e Initial load
duke
parents:
diff changeset
   958
     * without linking it anywhere.
06bc494ca11e Initial load
duke
parents:
diff changeset
   959
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   960
     * @param next File name for the next link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   961
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   962
    public void navLinkNext(String next) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   963
        String tag = configuration.getText("doclet.Next");
06bc494ca11e Initial load
duke
parents:
diff changeset
   964
        if (next != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   965
            printHyperLink(next, "", tag, true);
06bc494ca11e Initial load
duke
parents:
diff changeset
   966
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   967
            print(tag);
06bc494ca11e Initial load
duke
parents:
diff changeset
   968
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   969
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   970
06bc494ca11e Initial load
duke
parents:
diff changeset
   971
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   972
     * Get link for next file.  If next is null, just print the label
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   973
     * without linking it anywhere.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   974
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   975
     * @param next File name for the next link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   976
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   977
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   978
    public Content getNavLinkNext(String next) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   979
        Content li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   980
        if (next != null) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   981
            li = HtmlTree.LI(getHyperLink(next, "", nextLabel, "", ""));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   982
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   983
        else
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   984
            li = HtmlTree.LI(nextLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   985
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   986
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   987
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   988
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   989
     * Print "FRAMES" link, to switch to the frame version of the output.
06bc494ca11e Initial load
duke
parents:
diff changeset
   990
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   991
     * @param link File to be linked, "index.html".
06bc494ca11e Initial load
duke
parents:
diff changeset
   992
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   993
    protected void navShowLists(String link) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   994
        print(getHyperLinkString(link + "?" + path + filename, "",
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   995
            configuration.getText("doclet.FRAMES"), true, "", "", "_top"));
06bc494ca11e Initial load
duke
parents:
diff changeset
   996
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   997
06bc494ca11e Initial load
duke
parents:
diff changeset
   998
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   999
     * Get "FRAMES" link, to switch to the frame version of the output.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1000
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1001
     * @param link File to be linked, "index.html"
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1002
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1003
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1004
    protected Content getNavShowLists(String link) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1005
        Content framesContent = getHyperLink(link + "?" + path +
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1006
                filename, "", framesLabel, "", "_top");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1007
        Content li = HtmlTree.LI(framesContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1008
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1009
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1010
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1011
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1012
     * Print "FRAMES" link, to switch to the frame version of the output.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1013
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1014
    protected void navShowLists() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1015
        navShowLists(relativePath + "index.html");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1016
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1017
06bc494ca11e Initial load
duke
parents:
diff changeset
  1018
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1019
     * Get "FRAMES" link, to switch to the frame version of the output.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1020
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1021
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1022
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1023
    protected Content getNavShowLists() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1024
        return getNavShowLists(relativePath + "index.html");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1025
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1026
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1027
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1028
     * Print "NO FRAMES" link, to switch to the non-frame version of the output.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1029
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1030
     * @param link File to be linked.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1031
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1032
    protected void navHideLists(String link) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1033
        print(getHyperLinkString(link, "", configuration.getText("doclet.NO_FRAMES"),
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1034
            true, "", "", "_top"));
06bc494ca11e Initial load
duke
parents:
diff changeset
  1035
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1036
06bc494ca11e Initial load
duke
parents:
diff changeset
  1037
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1038
     * Get "NO FRAMES" link, to switch to the non-frame version of the output.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1039
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1040
     * @param link File to be linked
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1041
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1042
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1043
    protected Content getNavHideLists(String link) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1044
        Content noFramesContent = getHyperLink(link, "", noframesLabel, "", "_top");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1045
        Content li = HtmlTree.LI(noFramesContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1046
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1047
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1048
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1049
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1050
     * Print "Tree" link in the navigation bar. If there is only one package
06bc494ca11e Initial load
duke
parents:
diff changeset
  1051
     * specified on the command line, then the "Tree" link will be to the
06bc494ca11e Initial load
duke
parents:
diff changeset
  1052
     * only "package-tree.html" file otherwise it will be to the
06bc494ca11e Initial load
duke
parents:
diff changeset
  1053
     * "overview-tree.html" file.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1054
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1055
    protected void navLinkTree() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1056
        navCellStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1057
        PackageDoc[] packages = configuration.root.specifiedPackages();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1058
        if (packages.length == 1 && configuration.root.specifiedClasses().length == 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1059
            printHyperLink(pathString(packages[0], "package-tree.html"), "",
06bc494ca11e Initial load
duke
parents:
diff changeset
  1060
                           configuration.getText("doclet.Tree"), true, "NavBarFont1");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1061
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1062
            printHyperLink(relativePath + "overview-tree.html", "",
06bc494ca11e Initial load
duke
parents:
diff changeset
  1063
                           configuration.getText("doclet.Tree"), true, "NavBarFont1");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1064
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1065
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1066
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1067
06bc494ca11e Initial load
duke
parents:
diff changeset
  1068
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1069
     * Get "Tree" link in the navigation bar. If there is only one package
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1070
     * specified on the command line, then the "Tree" link will be to the
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1071
     * only "package-tree.html" file otherwise it will be to the
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1072
     * "overview-tree.html" file.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1073
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1074
     * @return a content tree for the link
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1075
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1076
    protected Content getNavLinkTree() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1077
        Content treeLinkContent;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1078
        PackageDoc[] packages = configuration.root.specifiedPackages();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1079
        if (packages.length == 1 && configuration.root.specifiedClasses().length == 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1080
            treeLinkContent = getHyperLink(pathString(packages[0],
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1081
                    "package-tree.html"), "", treeLabel,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1082
                    "", "");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1083
        } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1084
            treeLinkContent = getHyperLink(relativePath + "overview-tree.html",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1085
                    "", treeLabel, "", "");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1086
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1087
        Content li = HtmlTree.LI(treeLinkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1088
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1089
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1090
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1091
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1092
     * Get the overview tree link for the main tree.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1093
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1094
     * @param label the label for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1095
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1096
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1097
    protected Content getNavLinkMainTree(String label) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1098
        Content mainTreeContent = getHyperLink(relativePath + "overview-tree.html",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1099
                new StringContent(label));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1100
        Content li = HtmlTree.LI(mainTreeContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1101
        return li;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1102
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1103
06bc494ca11e Initial load
duke
parents:
diff changeset
  1104
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1105
     * Print the word "Class" in the navigation bar cell, to indicate that
06bc494ca11e Initial load
duke
parents:
diff changeset
  1106
     * class link is not available.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1107
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1108
    protected void navLinkClass() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1109
        navCellStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1110
        fontStyle("NavBarFont1");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1111
        printText("doclet.Class");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1112
        fontEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1113
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1114
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1115
06bc494ca11e Initial load
duke
parents:
diff changeset
  1116
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1117
     * Get the word "Class", to indicate that class link is not available.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1118
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1119
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1120
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1121
    protected Content getNavLinkClass() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1122
        Content li = HtmlTree.LI(classLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1123
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1124
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1125
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1126
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1127
     * Print "Deprecated" API link in the navigation bar.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1128
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1129
    protected void navLinkDeprecated() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1130
        navCellStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1131
        printHyperLink(relativePath + "deprecated-list.html", "",
06bc494ca11e Initial load
duke
parents:
diff changeset
  1132
                       configuration.getText("doclet.navDeprecated"), true, "NavBarFont1");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1133
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1134
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1135
06bc494ca11e Initial load
duke
parents:
diff changeset
  1136
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1137
     * Get "Deprecated" API link in the navigation bar.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1138
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1139
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1140
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1141
    protected Content getNavLinkDeprecated() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1142
        Content linkContent = getHyperLink(relativePath +
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1143
                "deprecated-list.html", "", deprecatedLabel, "", "");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1144
        Content li = HtmlTree.LI(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1145
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1146
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1147
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1148
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1149
     * Print link for generated index. If the user has used "-splitindex"
06bc494ca11e Initial load
duke
parents:
diff changeset
  1150
     * command line option, then link to file "index-files/index-1.html" is
06bc494ca11e Initial load
duke
parents:
diff changeset
  1151
     * generated otherwise link to file "index-all.html" is generated.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1152
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1153
    protected void navLinkClassIndex() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1154
        printNoFramesTargetHyperLink(relativePath +
06bc494ca11e Initial load
duke
parents:
diff changeset
  1155
                AllClassesFrameWriter.OUTPUT_FILE_NAME_NOFRAMES,
06bc494ca11e Initial load
duke
parents:
diff changeset
  1156
            "", "", configuration.getText("doclet.All_Classes"), true);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1157
    }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1158
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1159
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1160
     * Get link for generated index. If the user has used "-splitindex"
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1161
     * command line option, then link to file "index-files/index-1.html" is
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1162
     * generated otherwise link to file "index-all.html" is generated.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1163
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1164
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1165
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1166
    protected Content getNavLinkClassIndex() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1167
        Content allClassesContent = getHyperLink(relativePath +
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1168
                AllClassesFrameWriter.OUTPUT_FILE_NAME_NOFRAMES, "",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1169
                allclassesLabel, "", "");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1170
        Content li = HtmlTree.LI(allClassesContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1171
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1172
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1173
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1174
     * Print link for generated class index.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1175
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1176
    protected void navLinkIndex() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1177
        navCellStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1178
        printHyperLink(relativePath +
06bc494ca11e Initial load
duke
parents:
diff changeset
  1179
                           (configuration.splitindex?
06bc494ca11e Initial load
duke
parents:
diff changeset
  1180
                                DirectoryManager.getPath("index-files") +
06bc494ca11e Initial load
duke
parents:
diff changeset
  1181
                                fileseparator: "") +
06bc494ca11e Initial load
duke
parents:
diff changeset
  1182
                           (configuration.splitindex?
06bc494ca11e Initial load
duke
parents:
diff changeset
  1183
                                "index-1.html" : "index-all.html"), "",
06bc494ca11e Initial load
duke
parents:
diff changeset
  1184
                       configuration.getText("doclet.Index"), true, "NavBarFont1");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1185
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1186
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1187
06bc494ca11e Initial load
duke
parents:
diff changeset
  1188
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1189
     * Get link for generated class index.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1190
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1191
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1192
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1193
    protected Content getNavLinkIndex() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1194
        Content linkContent = getHyperLink(relativePath +(configuration.splitindex?
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1195
            DirectoryManager.getPath("index-files") + fileseparator: "") +
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1196
            (configuration.splitindex?"index-1.html" : "index-all.html"), "",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1197
            indexLabel, "", "");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1198
        Content li = HtmlTree.LI(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1199
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1200
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1201
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1202
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1203
     * Print help file link. If user has provided a help file, then generate a
06bc494ca11e Initial load
duke
parents:
diff changeset
  1204
     * link to the user given file, which is already copied to current or
06bc494ca11e Initial load
duke
parents:
diff changeset
  1205
     * destination directory.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1206
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1207
    protected void navLinkHelp() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1208
        String helpfilenm = configuration.helpfile;
06bc494ca11e Initial load
duke
parents:
diff changeset
  1209
        if (helpfilenm.equals("")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1210
            helpfilenm = "help-doc.html";
06bc494ca11e Initial load
duke
parents:
diff changeset
  1211
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1212
            int lastsep;
06bc494ca11e Initial load
duke
parents:
diff changeset
  1213
            if ((lastsep = helpfilenm.lastIndexOf(File.separatorChar)) != -1) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1214
                helpfilenm = helpfilenm.substring(lastsep + 1);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1215
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1216
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1217
        navCellStart();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1218
        printHyperLink(relativePath + helpfilenm, "",
06bc494ca11e Initial load
duke
parents:
diff changeset
  1219
                       configuration.getText("doclet.Help"), true, "NavBarFont1");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1220
        navCellEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1221
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1222
06bc494ca11e Initial load
duke
parents:
diff changeset
  1223
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1224
     * Get help file link. If user has provided a help file, then generate a
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1225
     * link to the user given file, which is already copied to current or
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1226
     * destination directory.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1227
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1228
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1229
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1230
    protected Content getNavLinkHelp() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1231
        String helpfilenm = configuration.helpfile;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1232
        if (helpfilenm.equals("")) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1233
            helpfilenm = "help-doc.html";
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1234
        } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1235
            int lastsep;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1236
            if ((lastsep = helpfilenm.lastIndexOf(File.separatorChar)) != -1) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1237
                helpfilenm = helpfilenm.substring(lastsep + 1);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1238
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1239
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1240
        Content linkContent = getHyperLink(relativePath + helpfilenm, "",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1241
                helpLabel, "", "");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1242
        Content li = HtmlTree.LI(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1243
        return li;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1244
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1245
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1246
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1247
     * Print the word "Detail" in the navigation bar. No link is available.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1248
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1249
    protected void navDetail() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1250
        printText("doclet.Detail");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1251
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1252
06bc494ca11e Initial load
duke
parents:
diff changeset
  1253
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1254
     * Print the word "Summary" in the navigation bar. No link is available.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1255
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1256
    protected void navSummary() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1257
        printText("doclet.Summary");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1258
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1259
06bc494ca11e Initial load
duke
parents:
diff changeset
  1260
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1261
     * Print the Html table tag for the index summary tables. The table tag
06bc494ca11e Initial load
duke
parents:
diff changeset
  1262
     * printed is
06bc494ca11e Initial load
duke
parents:
diff changeset
  1263
     * &lt;TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
06bc494ca11e Initial load
duke
parents:
diff changeset
  1264
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1265
    public void tableIndexSummary() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1266
        table(1, "100%", 3, 0);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1267
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1268
06bc494ca11e Initial load
duke
parents:
diff changeset
  1269
    /**
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1270
     * Print the Html table tag for the index summary tables.
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1271
     *
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1272
     * @param summary the summary for the table tag summary attribute.
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1273
     */
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1274
    public void tableIndexSummary(String summary) {
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1275
        table(1, "100%", 3, 0, summary);
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1276
    }
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1277
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1278
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1279
     * Same as {@link #tableIndexSummary()}.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1280
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1281
    public void tableIndexDetail() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1282
        table(1, "100%", 3, 0);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1283
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1284
06bc494ca11e Initial load
duke
parents:
diff changeset
  1285
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1286
     * Print Html tag for table elements. The tag printed is
06bc494ca11e Initial load
duke
parents:
diff changeset
  1287
     * &lt;TD ALIGN="right" VALIGN="top" WIDTH="1%"&gt;.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1288
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1289
    public void tdIndex() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1290
        print("<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\">");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1291
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1292
06bc494ca11e Initial load
duke
parents:
diff changeset
  1293
    /**
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1294
     * Print table caption.
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1295
     */
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1296
    public void tableCaptionStart() {
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1297
        captionStyle("TableCaption");
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1298
    }
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1299
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1300
    /**
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1301
     * Print table sub-caption.
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1302
     */
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1303
    public void tableSubCaptionStart() {
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1304
        captionStyle("TableSubCaption");
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1305
    }
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1306
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1307
    /**
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1308
     * Print table caption end tags.
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1309
     */
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1310
    public void tableCaptionEnd() {
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1311
        captionEnd();
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1312
    }
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1313
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1314
    /**
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1315
     * Print summary table header.
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1316
     */
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1317
    public void summaryTableHeader(String[] header, String scope) {
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1318
        tr();
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1319
        for ( int i=0; i < header.length; i++ ) {
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1320
            thScopeNoWrap("TableHeader", scope);
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1321
            print(header[i]);
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1322
            thEnd();
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1323
        }
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1324
        trEnd();
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1325
    }
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1326
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
  1327
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1328
     * Get summary table header.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1329
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1330
     * @param header the header for the table
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1331
     * @param scope the scope of the headers
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1332
     * @return a content tree for the header
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1333
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1334
    public Content getSummaryTableHeader(String[] header, String scope) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1335
        Content tr = new HtmlTree(HtmlTag.TR);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1336
        int size = header.length;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1337
        Content tableHeader;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1338
        if (size == 1) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1339
            tableHeader = new StringContent(header[0]);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1340
            tr.addContent(HtmlTree.TH(HtmlStyle.colOne, scope, tableHeader));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1341
            return tr;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1342
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1343
        for (int i = 0; i < size; i++) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1344
            tableHeader = new StringContent(header[i]);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1345
            if(i == 0)
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1346
                tr.addContent(HtmlTree.TH(HtmlStyle.colFirst, scope, tableHeader));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1347
            else if(i == (size - 1))
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1348
                tr.addContent(HtmlTree.TH(HtmlStyle.colLast, scope, tableHeader));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1349
            else
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1350
                tr.addContent(HtmlTree.TH(scope, tableHeader));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1351
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1352
        return tr;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1353
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1354
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1355
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1356
     * Get table caption.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1357
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1358
     * @param rawText the caption for the table which could be raw Html
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1359
     * @return a content tree for the caption
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1360
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1361
    public Content getTableCaption(String rawText) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1362
        Content title = new RawHtml(rawText);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1363
        Content captionSpan = HtmlTree.SPAN(title);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1364
        Content space = getSpace();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1365
        Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, space);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1366
        Content caption = HtmlTree.CAPTION(captionSpan);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1367
        caption.addContent(tabSpan);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1368
        return caption;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1369
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1370
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1371
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1372
     * Get the marker anchor which will be added to the documentation tree.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1373
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1374
     * @param anchorName the anchor name attribute
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1375
     * @return a content tree for the marker anchor
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1376
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1377
    public Content getMarkerAnchor(String anchorName) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1378
        return getMarkerAnchor(anchorName, null);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1379
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1380
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1381
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1382
     * Get the marker anchor which will be added to the documentation tree.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1383
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1384
     * @param anchorName the anchor name attribute
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1385
     * @param anchorContent the content that should be added to the anchor
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1386
     * @return a content tree for the marker anchor
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1387
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1388
    public Content getMarkerAnchor(String anchorName, Content anchorContent) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1389
        if (anchorContent == null)
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1390
            anchorContent = new Comment(" ");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1391
        Content markerAnchor = HtmlTree.A_NAME(anchorName, anchorContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1392
        return markerAnchor;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1393
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1394
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1395
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1396
     * Returns a packagename content.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1397
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1398
     * @param packageDoc the package to check
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1399
     * @return package name content
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1400
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1401
    public Content getPackageName(PackageDoc packageDoc) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1402
        return packageDoc == null || packageDoc.name().length() == 0 ?
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1403
            defaultPackageLabel :
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1404
            getPackageLabel(packageDoc.name());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1405
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1406
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1407
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1408
     * Returns a package name label.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1409
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1410
     * @param parsedName the package name
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1411
     * @return the package name content
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1412
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1413
    public Content getPackageLabel(String packageName) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1414
        return new StringContent(packageName);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1415
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1416
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1417
    /**
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1418
     * Add package deprecation information to the documentation tree
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1419
     *
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1420
     * @param deprPkgs list of deprecated packages
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1421
     * @param headingKey the caption for the deprecated package table
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1422
     * @param tableSummary the summary for the deprecated package table
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1423
     * @param tableHeader table headers for the deprecated package table
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1424
     * @param contentTree the content tree to which the deprecated package table will be added
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1425
     */
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1426
    protected void addPackageDeprecatedAPI(List<Doc> deprPkgs, String headingKey,
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1427
            String tableSummary, String[] tableHeader, Content contentTree) {
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1428
        if (deprPkgs.size() > 0) {
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1429
            Content table = HtmlTree.TABLE(0, 3, 0, tableSummary,
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1430
                    getTableCaption(configuration().getText(headingKey)));
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1431
            table.addContent(getSummaryTableHeader(tableHeader, "col"));
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1432
            Content tbody = new HtmlTree(HtmlTag.TBODY);
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1433
            for (int i = 0; i < deprPkgs.size(); i++) {
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1434
                PackageDoc pkg = (PackageDoc) deprPkgs.get(i);
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1435
                HtmlTree td = HtmlTree.TD(HtmlStyle.colOne,
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1436
                        getPackageLink(pkg, getPackageName(pkg)));
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1437
                if (pkg.tags("deprecated").length > 0) {
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1438
                    addInlineDeprecatedComment(pkg, pkg.tags("deprecated")[0], td);
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1439
                }
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1440
                HtmlTree tr = HtmlTree.TR(td);
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1441
                if (i % 2 == 0) {
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1442
                    tr.addStyle(HtmlStyle.altColor);
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1443
                } else {
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1444
                    tr.addStyle(HtmlStyle.rowColor);
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1445
                }
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1446
                tbody.addContent(tr);
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1447
            }
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1448
            table.addContent(tbody);
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1449
            Content li = HtmlTree.LI(HtmlStyle.blockList, table);
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1450
            Content ul = HtmlTree.UL(HtmlStyle.blockList, li);
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1451
            contentTree.addContent(ul);
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1452
        }
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1453
    }
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1454
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents: 9592
diff changeset
  1455
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1456
     * Prine table header information about color, column span and the font.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1457
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1458
     * @param color Background color.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1459
     * @param span  Column span.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1460
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1461
    public void tableHeaderStart(String color, int span) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1462
        trBgcolorStyle(color, "TableHeadingColor");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1463
        thAlignColspan("left", span);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1464
        font("+2");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1465
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1466
06bc494ca11e Initial load
duke
parents:
diff changeset
  1467
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1468
     * Print table header for the inherited members summary tables. Print the
06bc494ca11e Initial load
duke
parents:
diff changeset
  1469
     * background color information.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1470
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1471
     * @param color Background color.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1472
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1473
    public void tableInheritedHeaderStart(String color) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1474
        trBgcolorStyle(color, "TableSubHeadingColor");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1475
        thAlign("left");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1476
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1477
06bc494ca11e Initial load
duke
parents:
diff changeset
  1478
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1479
     * Print "Use" table header. Print the background color and the column span.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1480
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1481
     * @param color Background color.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1482
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1483
    public void tableUseInfoHeaderStart(String color) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1484
        trBgcolorStyle(color, "TableSubHeadingColor");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1485
        thAlignColspan("left", 2);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1486
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1487
06bc494ca11e Initial load
duke
parents:
diff changeset
  1488
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1489
     * Print table header with the background color with default column span 2.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1490
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1491
     * @param color Background color.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1492
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1493
    public void tableHeaderStart(String color) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1494
        tableHeaderStart(color, 2);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1495
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1496
06bc494ca11e Initial load
duke
parents:
diff changeset
  1497
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1498
     * Print table header with the column span, with the default color #CCCCFF.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1499
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1500
     * @param span Column span.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1501
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1502
    public void tableHeaderStart(int span) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1503
        tableHeaderStart("#CCCCFF", span);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1504
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1505
06bc494ca11e Initial load
duke
parents:
diff changeset
  1506
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1507
     * Print table header with default column span 2 and default color #CCCCFF.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1508
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1509
    public void tableHeaderStart() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1510
        tableHeaderStart(2);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1511
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1512
06bc494ca11e Initial load
duke
parents:
diff changeset
  1513
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1514
     * Print table header end tags for font, column and row.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1515
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1516
    public void tableHeaderEnd() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1517
        fontEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1518
        thEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1519
        trEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1520
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1521
06bc494ca11e Initial load
duke
parents:
diff changeset
  1522
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1523
     * Print table header end tags in inherited tables for column and row.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1524
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1525
    public void tableInheritedHeaderEnd() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1526
        thEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1527
        trEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1528
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1529
06bc494ca11e Initial load
duke
parents:
diff changeset
  1530
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1531
     * Print the summary table row cell attribute width.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1532
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1533
     * @param width Width of the table cell.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1534
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1535
    public void summaryRow(int width) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1536
        if (width != 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1537
            tdWidth(width + "%");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1538
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1539
            td();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1540
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1541
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1542
06bc494ca11e Initial load
duke
parents:
diff changeset
  1543
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1544
     * Print the summary table row cell end tag.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1545
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1546
    public void summaryRowEnd() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1547
        tdEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1548
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1549
06bc494ca11e Initial load
duke
parents:
diff changeset
  1550
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1551
     * Print the heading in Html &lt;H2> format.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1552
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1553
     * @param str The Header string.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1554
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1555
    public void printIndexHeading(String str) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1556
        h2();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1557
        print(str);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1558
        h2End();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1559
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1560
06bc494ca11e Initial load
duke
parents:
diff changeset
  1561
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1562
     * Print Html tag &lt;FRAMESET=arg&gt;.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1563
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1564
     * @param arg Argument for the tag.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1565
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1566
    public void frameSet(String arg) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1567
        println("<FRAMESET " + arg + ">");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1568
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1569
06bc494ca11e Initial load
duke
parents:
diff changeset
  1570
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1571
     * Print Html closing tag &lt;/FRAMESET&gt;.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1572
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1573
    public void frameSetEnd() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1574
        println("</FRAMESET>");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1575
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1576
06bc494ca11e Initial load
duke
parents:
diff changeset
  1577
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1578
     * Print Html tag &lt;FRAME=arg&gt;.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1579
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1580
     * @param arg Argument for the tag.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1581
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1582
    public void frame(String arg) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1583
        println("<FRAME " + arg + ">");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1584
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1585
06bc494ca11e Initial load
duke
parents:
diff changeset
  1586
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1587
     * Print Html closing tag &lt;/FRAME&gt;.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1588
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1589
    public void frameEnd() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1590
        println("</FRAME>");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1591
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1592
06bc494ca11e Initial load
duke
parents:
diff changeset
  1593
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1594
     * Return path to the class page for a classdoc. For example, the class
06bc494ca11e Initial load
duke
parents:
diff changeset
  1595
     * name is "java.lang.Object" and if the current file getting generated is
06bc494ca11e Initial load
duke
parents:
diff changeset
  1596
     * "java/io/File.html", then the path string to the class, returned is
06bc494ca11e Initial load
duke
parents:
diff changeset
  1597
     * "../../java/lang.Object.html".
06bc494ca11e Initial load
duke
parents:
diff changeset
  1598
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1599
     * @param cd Class to which the path is requested.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1600
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1601
    protected String pathToClass(ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1602
        return pathString(cd.containingPackage(), cd.name() + ".html");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1603
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1604
06bc494ca11e Initial load
duke
parents:
diff changeset
  1605
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1606
     * Return the path to the class page for a classdoc. Works same as
06bc494ca11e Initial load
duke
parents:
diff changeset
  1607
     * {@link #pathToClass(ClassDoc)}.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1608
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1609
     * @param cd   Class to which the path is requested.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1610
     * @param name Name of the file(doesn't include path).
06bc494ca11e Initial load
duke
parents:
diff changeset
  1611
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1612
    protected String pathString(ClassDoc cd, String name) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1613
        return pathString(cd.containingPackage(), name);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1614
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1615
06bc494ca11e Initial load
duke
parents:
diff changeset
  1616
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1617
     * Return path to the given file name in the given package. So if the name
06bc494ca11e Initial load
duke
parents:
diff changeset
  1618
     * passed is "Object.html" and the name of the package is "java.lang", and
06bc494ca11e Initial load
duke
parents:
diff changeset
  1619
     * if the relative path is "../.." then returned string will be
06bc494ca11e Initial load
duke
parents:
diff changeset
  1620
     * "../../java/lang/Object.html"
06bc494ca11e Initial load
duke
parents:
diff changeset
  1621
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1622
     * @param pd Package in which the file name is assumed to be.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1623
     * @param name File name, to which path string is.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1624
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1625
    protected String pathString(PackageDoc pd, String name) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1626
        StringBuffer buf = new StringBuffer(relativePath);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1627
        buf.append(DirectoryManager.getPathToPackage(pd, name));
06bc494ca11e Initial load
duke
parents:
diff changeset
  1628
        return buf.toString();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1629
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1630
06bc494ca11e Initial load
duke
parents:
diff changeset
  1631
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1632
     * Print the link to the given package.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1633
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1634
     * @param pkg the package to link to.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1635
     * @param label the label for the link.
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1636
     * @param isStrong true if the label should be strong.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1637
     */
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1638
    public void printPackageLink(PackageDoc pkg, String label, boolean isStrong) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1639
        print(getPackageLinkString(pkg, label, isStrong));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1640
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1641
06bc494ca11e Initial load
duke
parents:
diff changeset
  1642
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1643
     * Print the link to the given package.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1644
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1645
     * @param pkg the package to link to.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1646
     * @param label the label for the link.
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1647
     * @param isStrong true if the label should be strong.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1648
     * @param style  the font of the package link label.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1649
     */
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1650
    public void printPackageLink(PackageDoc pkg, String label, boolean isStrong,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1651
            String style) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1652
        print(getPackageLinkString(pkg, label, isStrong, style));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1653
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1654
06bc494ca11e Initial load
duke
parents:
diff changeset
  1655
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1656
     * Return the link to the given package.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1657
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1658
     * @param pkg the package to link to.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1659
     * @param label the label for the link.
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1660
     * @param isStrong true if the label should be strong.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1661
     * @return the link to the given package.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1662
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1663
    public String getPackageLinkString(PackageDoc pkg, String label,
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1664
                                 boolean isStrong) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1665
        return getPackageLinkString(pkg, label, isStrong, "");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1666
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1667
06bc494ca11e Initial load
duke
parents:
diff changeset
  1668
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1669
     * Return the link to the given package.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1670
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1671
     * @param pkg the package to link to.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1672
     * @param label the label for the link.
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1673
     * @param isStrong true if the label should be strong.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1674
     * @param style  the font of the package link label.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1675
     * @return the link to the given package.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1676
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1677
    public String getPackageLinkString(PackageDoc pkg, String label, boolean isStrong,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1678
            String style) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1679
        boolean included = pkg != null && pkg.isIncluded();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1680
        if (! included) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1681
            PackageDoc[] packages = configuration.packages;
06bc494ca11e Initial load
duke
parents:
diff changeset
  1682
            for (int i = 0; i < packages.length; i++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1683
                if (packages[i].equals(pkg)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1684
                    included = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
  1685
                    break;
06bc494ca11e Initial load
duke
parents:
diff changeset
  1686
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1687
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1688
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1689
        if (included || pkg == null) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1690
            return getHyperLinkString(pathString(pkg, "package-summary.html"),
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1691
                                "", label, isStrong, style);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1692
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1693
            String crossPkgLink = getCrossPackageLink(Util.getPackageName(pkg));
06bc494ca11e Initial load
duke
parents:
diff changeset
  1694
            if (crossPkgLink != null) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1695
                return getHyperLinkString(crossPkgLink, "", label, isStrong, style);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1696
            } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1697
                return label;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1698
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1699
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1700
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1701
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1702
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1703
     * Return the link to the given package.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1704
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1705
     * @param pkg the package to link to.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1706
     * @param label the label for the link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1707
     * @return a content tree for the package link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1708
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1709
    public Content getPackageLink(PackageDoc pkg, Content label) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1710
        boolean included = pkg != null && pkg.isIncluded();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1711
        if (! included) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1712
            PackageDoc[] packages = configuration.packages;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1713
            for (int i = 0; i < packages.length; i++) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1714
                if (packages[i].equals(pkg)) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1715
                    included = true;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1716
                    break;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1717
                }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1718
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1719
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1720
        if (included || pkg == null) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1721
            return getHyperLink(pathString(pkg, "package-summary.html"),
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1722
                                "", label);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1723
        } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1724
            String crossPkgLink = getCrossPackageLink(Util.getPackageName(pkg));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1725
            if (crossPkgLink != null) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1726
                return getHyperLink(crossPkgLink, "", label);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1727
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1728
                return label;
06bc494ca11e Initial load
duke
parents:
diff changeset
  1729
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1730
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1731
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1732
06bc494ca11e Initial load
duke
parents:
diff changeset
  1733
    public String italicsClassName(ClassDoc cd, boolean qual) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1734
        String name = (qual)? cd.qualifiedName(): cd.name();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1735
        return (cd.isInterface())?  italicsText(name): name;
06bc494ca11e Initial load
duke
parents:
diff changeset
  1736
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1737
06bc494ca11e Initial load
duke
parents:
diff changeset
  1738
    public void printSrcLink(ProgramElementDoc d, String label) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1739
        if (d == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1740
            return;
06bc494ca11e Initial load
duke
parents:
diff changeset
  1741
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1742
        ClassDoc cd = d.containingClass();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1743
        if (cd == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1744
            //d must be a class doc since in has no containing class.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1745
            cd = (ClassDoc) d;
06bc494ca11e Initial load
duke
parents:
diff changeset
  1746
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1747
        String href = relativePath + DocletConstants.SOURCE_OUTPUT_DIR_NAME
06bc494ca11e Initial load
duke
parents:
diff changeset
  1748
            + DirectoryManager.getDirectoryPath(cd.containingPackage())
06bc494ca11e Initial load
duke
parents:
diff changeset
  1749
            + cd.name() + ".html#" + SourceToHTMLConverter.getAnchorName(d);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1750
        printHyperLink(href, "", label, true);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1751
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1752
06bc494ca11e Initial load
duke
parents:
diff changeset
  1753
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1754
     * Add the link to the content tree.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1755
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1756
     * @param doc program element doc for which the link will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1757
     * @param label label for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1758
     * @param htmltree 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
  1759
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1760
    public void addSrcLink(ProgramElementDoc doc, Content label, Content htmltree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1761
        if (doc == null) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1762
            return;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1763
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1764
        ClassDoc cd = doc.containingClass();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1765
        if (cd == null) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1766
            //d must be a class doc since in has no containing class.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1767
            cd = (ClassDoc) doc;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1768
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1769
        String href = relativePath + DocletConstants.SOURCE_OUTPUT_DIR_NAME
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1770
                + DirectoryManager.getDirectoryPath(cd.containingPackage())
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1771
                + cd.name() + ".html#" + SourceToHTMLConverter.getAnchorName(doc);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1772
        Content linkContent = getHyperLink(href, "", label, "", "");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1773
        htmltree.addContent(linkContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1774
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1775
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1776
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1777
     * Return the link to the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1778
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1779
     * @param linkInfo the information about the link.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1780
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1781
     * @return the link for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1782
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1783
    public String getLink(LinkInfoImpl linkInfo) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1784
        LinkFactoryImpl factory = new LinkFactoryImpl(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1785
        String link = ((LinkOutputImpl) factory.getLinkOutput(linkInfo)).toString();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1786
        displayLength += linkInfo.displayLength;
06bc494ca11e Initial load
duke
parents:
diff changeset
  1787
        return link;
06bc494ca11e Initial load
duke
parents:
diff changeset
  1788
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1789
06bc494ca11e Initial load
duke
parents:
diff changeset
  1790
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1791
     * Return the type parameters for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1792
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1793
     * @param linkInfo the information about the link.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1794
     * @return the type for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1795
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1796
    public String getTypeParameterLinks(LinkInfoImpl linkInfo) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1797
        LinkFactoryImpl factory = new LinkFactoryImpl(this);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1798
        return ((LinkOutputImpl)
06bc494ca11e Initial load
duke
parents:
diff changeset
  1799
            factory.getTypeParameterLinks(linkInfo, false)).toString();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1800
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1801
06bc494ca11e Initial load
duke
parents:
diff changeset
  1802
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1803
     * Print the link to the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1804
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1805
    public void printLink(LinkInfoImpl linkInfo) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1806
        print(getLink(linkInfo));
06bc494ca11e Initial load
duke
parents:
diff changeset
  1807
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1808
06bc494ca11e Initial load
duke
parents:
diff changeset
  1809
    /*************************************************************
06bc494ca11e Initial load
duke
parents:
diff changeset
  1810
     * Return a class cross link to external class documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1811
     * The name must be fully qualified to determine which package
06bc494ca11e Initial load
duke
parents:
diff changeset
  1812
     * the class is in.  The -link option does not allow users to
06bc494ca11e Initial load
duke
parents:
diff changeset
  1813
     * link to external classes in the "default" package.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1814
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1815
     * @param qualifiedClassName the qualified name of the external class.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1816
     * @param refMemName the name of the member being referenced.  This should
06bc494ca11e Initial load
duke
parents:
diff changeset
  1817
     * be null or empty string if no member is being referenced.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1818
     * @param label the label for the external link.
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1819
     * @param strong true if the link should be strong.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1820
     * @param style the style of the link.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1821
     * @param code true if the label should be code font.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1822
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1823
    public String getCrossClassLink(String qualifiedClassName, String refMemName,
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1824
                                    String label, boolean strong, String style,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1825
                                    boolean code) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1826
        String className = "",
06bc494ca11e Initial load
duke
parents:
diff changeset
  1827
            packageName = qualifiedClassName == null ? "" : qualifiedClassName;
06bc494ca11e Initial load
duke
parents:
diff changeset
  1828
        int periodIndex;
06bc494ca11e Initial load
duke
parents:
diff changeset
  1829
        while((periodIndex = packageName.lastIndexOf('.')) != -1) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1830
            className = packageName.substring(periodIndex + 1, packageName.length()) +
06bc494ca11e Initial load
duke
parents:
diff changeset
  1831
                (className.length() > 0 ? "." + className : "");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1832
            String defaultLabel = code ? getCode() + className + getCodeEnd() : className;
06bc494ca11e Initial load
duke
parents:
diff changeset
  1833
            packageName = packageName.substring(0, periodIndex);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1834
            if (getCrossPackageLink(packageName) != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1835
                //The package exists in external documentation, so link to the external
06bc494ca11e Initial load
duke
parents:
diff changeset
  1836
                //class (assuming that it exists).  This is definitely a limitation of
06bc494ca11e Initial load
duke
parents:
diff changeset
  1837
                //the -link option.  There are ways to determine if an external package
06bc494ca11e Initial load
duke
parents:
diff changeset
  1838
                //exists, but no way to determine if the external class exists.  We just
06bc494ca11e Initial load
duke
parents:
diff changeset
  1839
                //have to assume that it does.
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1840
                return getHyperLinkString(
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1841
                    configuration.extern.getExternalLink(packageName, relativePath,
06bc494ca11e Initial load
duke
parents:
diff changeset
  1842
                                className + ".html?is-external=true"),
06bc494ca11e Initial load
duke
parents:
diff changeset
  1843
                    refMemName == null ? "" : refMemName,
06bc494ca11e Initial load
duke
parents:
diff changeset
  1844
                    label == null || label.length() == 0 ? defaultLabel : label,
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1845
                    strong, style,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1846
                    configuration.getText("doclet.Href_Class_Or_Interface_Title", packageName),
06bc494ca11e Initial load
duke
parents:
diff changeset
  1847
                    "");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1848
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1849
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1850
        return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
  1851
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1852
06bc494ca11e Initial load
duke
parents:
diff changeset
  1853
    public boolean isClassLinkable(ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1854
        if (cd.isIncluded()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1855
            return configuration.isGeneratedDoc(cd);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1856
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1857
        return configuration.extern.isExternal(cd);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1858
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1859
06bc494ca11e Initial load
duke
parents:
diff changeset
  1860
    public String getCrossPackageLink(String pkgName) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1861
        return configuration.extern.getExternalLink(pkgName, relativePath,
06bc494ca11e Initial load
duke
parents:
diff changeset
  1862
            "package-summary.html?is-external=true");
06bc494ca11e Initial load
duke
parents:
diff changeset
  1863
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1864
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1865
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1866
     * Get the class link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1867
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1868
     * @param context the id of the context where the link will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1869
     * @param cd the class doc to link to
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1870
     * @return a content tree for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1871
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1872
    public Content getQualifiedClassLink(int context, ClassDoc cd) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1873
        return new RawHtml(getLink(new LinkInfoImpl(context, cd,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1874
                configuration.getClassName(cd), "")));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1875
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1876
06bc494ca11e Initial load
duke
parents:
diff changeset
  1877
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1878
     * Add the class link.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1879
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1880
     * @param context the id of the context where the link will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1881
     * @param cd the class doc to link to
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1882
     * @param contentTree the content tree to which the link will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1883
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1884
    public void addPreQualifiedClassLink(int context, ClassDoc cd, Content contentTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1885
        addPreQualifiedClassLink(context, cd, false, contentTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1886
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1887
06bc494ca11e Initial load
duke
parents:
diff changeset
  1888
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1889
     * Retrieve the class link with the package portion of the label in
06bc494ca11e Initial load
duke
parents:
diff changeset
  1890
     * plain text.  If the qualifier is excluded, it willnot be included in the
06bc494ca11e Initial load
duke
parents:
diff changeset
  1891
     * link label.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1892
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1893
     * @param cd the class to link to.
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1894
     * @param isStrong true if the link should be strong.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1895
     * @return the link with the package portion of the label in plain text.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1896
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1897
    public String getPreQualifiedClassLink(int context,
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1898
            ClassDoc cd, boolean isStrong) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1899
        String classlink = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
  1900
        PackageDoc pd = cd.containingPackage();
06bc494ca11e Initial load
duke
parents:
diff changeset
  1901
        if(pd != null && ! configuration.shouldExcludeQualifier(pd.name())) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1902
            classlink = getPkgName(cd);
06bc494ca11e Initial load
duke
parents:
diff changeset
  1903
        }
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1904
        classlink += getLink(new LinkInfoImpl(context, cd, cd.name(), isStrong));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1905
        return classlink;
06bc494ca11e Initial load
duke
parents:
diff changeset
  1906
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1907
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1908
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1909
     * Add the class link with the package portion of the label in
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1910
     * plain text. If the qualifier is excluded, it will not be included in the
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1911
     * link label.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1912
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1913
     * @param context the id of the context where the link will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1914
     * @param cd the class to link to
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1915
     * @param isStrong true if the link should be strong
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1916
     * @param contentTree the content tree to which the link with be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1917
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1918
    public void addPreQualifiedClassLink(int context,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1919
            ClassDoc cd, boolean isStrong, Content contentTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1920
        PackageDoc pd = cd.containingPackage();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1921
        if(pd != null && ! configuration.shouldExcludeQualifier(pd.name())) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1922
            contentTree.addContent(getPkgName(cd));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1923
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1924
        contentTree.addContent(new RawHtml(getLink(new LinkInfoImpl(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1925
                context, cd, cd.name(), isStrong))));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1926
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1927
06bc494ca11e Initial load
duke
parents:
diff changeset
  1928
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1929
     * Add the class link, with only class name as the strong link and prefixing
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1930
     * plain package name.
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1931
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1932
     * @param context the id of the context where the link will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1933
     * @param cd the class to link to
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1934
     * @param contentTree the content tree to which the link with be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1935
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1936
    public void addPreQualifiedStrongClassLink(int context, ClassDoc cd, Content contentTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1937
        addPreQualifiedClassLink(context, cd, true, contentTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1938
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1939
06bc494ca11e Initial load
duke
parents:
diff changeset
  1940
    public void printText(String key) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1941
        print(configuration.getText(key));
06bc494ca11e Initial load
duke
parents:
diff changeset
  1942
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1943
06bc494ca11e Initial load
duke
parents:
diff changeset
  1944
    public void printText(String key, String a1) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1945
        print(configuration.getText(key, a1));
06bc494ca11e Initial load
duke
parents:
diff changeset
  1946
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1947
06bc494ca11e Initial load
duke
parents:
diff changeset
  1948
    public void printText(String key, String a1, String a2) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  1949
        print(configuration.getText(key, a1, a2));
06bc494ca11e Initial load
duke
parents:
diff changeset
  1950
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1951
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1952
    public void strongText(String key) {
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1953
        strong(configuration.getText(key));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1954
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1955
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1956
    public void strongText(String key, String a1) {
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1957
        strong(configuration.getText(key, a1));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1958
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1959
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1960
    public void strongText(String key, String a1, String a2) {
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1961
        strong(configuration.getText(key, a1, a2));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1962
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1963
06bc494ca11e Initial load
duke
parents:
diff changeset
  1964
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1965
     * Get the link for the given member.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1966
     *
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1967
     * @param context the id of the context where the link will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1968
     * @param doc the member being linked to
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1969
     * @param label the label for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1970
     * @return a content tree for the doc link
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1971
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1972
    public Content getDocLink(int context, MemberDoc doc, String label) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  1973
        return getDocLink(context, doc.containingClass(), doc, label);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1974
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1975
06bc494ca11e Initial load
duke
parents:
diff changeset
  1976
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1977
     * Print the link for the given member.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1978
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1979
     * @param context the id of the context where the link will be printed.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1980
     * @param classDoc the classDoc that we should link to.  This is not
06bc494ca11e Initial load
duke
parents:
diff changeset
  1981
     *                 necessarily equal to doc.containingClass().  We may be
06bc494ca11e Initial load
duke
parents:
diff changeset
  1982
     *                 inheriting comments.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1983
     * @param doc the member being linked to.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1984
     * @param label the label for the link.
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1985
     * @param strong true if the link should be strong.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1986
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  1987
    public void printDocLink(int context, ClassDoc classDoc, MemberDoc doc,
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1988
            String label, boolean strong) {
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1989
        print(getDocLink(context, classDoc, doc, label, strong));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1990
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  1991
06bc494ca11e Initial load
duke
parents:
diff changeset
  1992
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  1993
     * Return the link for the given member.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1994
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  1995
     * @param context the id of the context where the link will be printed.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1996
     * @param doc the member being linked to.
06bc494ca11e Initial load
duke
parents:
diff changeset
  1997
     * @param label the label for the link.
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  1998
     * @param strong true if the link should be strong.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  1999
     * @return the link for the given member.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2000
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  2001
    public String getDocLink(int context, MemberDoc doc, String label,
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  2002
                boolean strong) {
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  2003
        return getDocLink(context, doc.containingClass(), doc, label, strong);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2004
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2005
06bc494ca11e Initial load
duke
parents:
diff changeset
  2006
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  2007
     * Return the link for the given member.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2008
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  2009
     * @param context the id of the context where the link will be printed.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2010
     * @param classDoc the classDoc that we should link to.  This is not
06bc494ca11e Initial load
duke
parents:
diff changeset
  2011
     *                 necessarily equal to doc.containingClass().  We may be
06bc494ca11e Initial load
duke
parents:
diff changeset
  2012
     *                 inheriting comments.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2013
     * @param doc the member being linked to.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2014
     * @param label the label for the link.
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  2015
     * @param strong true if the link should be strong.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2016
     * @return the link for the given member.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2017
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  2018
    public String getDocLink(int context, ClassDoc classDoc, MemberDoc doc,
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  2019
        String label, boolean strong) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2020
        if (! (doc.isIncluded() ||
06bc494ca11e Initial load
duke
parents:
diff changeset
  2021
            Util.isLinkable(classDoc, configuration()))) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2022
            return label;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2023
        } else if (doc instanceof ExecutableMemberDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2024
            ExecutableMemberDoc emd = (ExecutableMemberDoc)doc;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2025
            return getLink(new LinkInfoImpl(context, classDoc,
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  2026
                getAnchor(emd), label, strong));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2027
        } else if (doc instanceof MemberDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2028
            return getLink(new LinkInfoImpl(context, classDoc,
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 1264
diff changeset
  2029
                doc.name(), label, strong));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2030
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2031
            return label;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2032
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2033
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2034
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2035
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2036
     * Return the link for the given member.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2037
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2038
     * @param context the id of the context where the link will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2039
     * @param classDoc the classDoc that we should link to.  This is not
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2040
     *                 necessarily equal to doc.containingClass().  We may be
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2041
     *                 inheriting comments
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2042
     * @param doc the member being linked to
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2043
     * @param label the label for the link
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2044
     * @return the link for the given member
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2045
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2046
    public Content getDocLink(int context, ClassDoc classDoc, MemberDoc doc,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2047
        String label) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2048
        if (! (doc.isIncluded() ||
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2049
            Util.isLinkable(classDoc, configuration()))) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2050
            return new StringContent(label);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2051
        } else if (doc instanceof ExecutableMemberDoc) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2052
            ExecutableMemberDoc emd = (ExecutableMemberDoc)doc;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2053
            return new RawHtml(getLink(new LinkInfoImpl(context, classDoc,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2054
                getAnchor(emd), label, false)));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2055
        } else if (doc instanceof MemberDoc) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2056
            return new RawHtml(getLink(new LinkInfoImpl(context, classDoc,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2057
                doc.name(), label, false)));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2058
        } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2059
            return new StringContent(label);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2060
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2061
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2062
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2063
    public void anchor(ExecutableMemberDoc emd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2064
        anchor(getAnchor(emd));
06bc494ca11e Initial load
duke
parents:
diff changeset
  2065
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2066
06bc494ca11e Initial load
duke
parents:
diff changeset
  2067
    public String getAnchor(ExecutableMemberDoc emd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2068
        StringBuilder signature = new StringBuilder(emd.signature());
06bc494ca11e Initial load
duke
parents:
diff changeset
  2069
        StringBuilder signatureParsed = new StringBuilder();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2070
        int counter = 0;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2071
        for (int i = 0; i < signature.length(); i++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2072
            char c = signature.charAt(i);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2073
            if (c == '<') {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2074
                counter++;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2075
            } else if (c == '>') {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2076
                counter--;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2077
            } else if (counter == 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2078
                signatureParsed.append(c);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2079
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2080
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2081
        return emd.name() + signatureParsed.toString();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2082
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2083
06bc494ca11e Initial load
duke
parents:
diff changeset
  2084
    public String seeTagToString(SeeTag see) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2085
        String tagName = see.name();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2086
        if (! (tagName.startsWith("@link") || tagName.equals("@see"))) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2087
            return "";
06bc494ca11e Initial load
duke
parents:
diff changeset
  2088
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2089
        StringBuffer result = new StringBuffer();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2090
        boolean isplaintext = tagName.toLowerCase().equals("@linkplain");
06bc494ca11e Initial load
duke
parents:
diff changeset
  2091
        String label = see.label();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2092
        label = (label.length() > 0)?
06bc494ca11e Initial load
duke
parents:
diff changeset
  2093
            ((isplaintext) ? label :
06bc494ca11e Initial load
duke
parents:
diff changeset
  2094
                 getCode() + label + getCodeEnd()):"";
06bc494ca11e Initial load
duke
parents:
diff changeset
  2095
        String seetext = replaceDocRootDir(see.text());
06bc494ca11e Initial load
duke
parents:
diff changeset
  2096
06bc494ca11e Initial load
duke
parents:
diff changeset
  2097
        //Check if @see is an href or "string"
06bc494ca11e Initial load
duke
parents:
diff changeset
  2098
        if (seetext.startsWith("<") || seetext.startsWith("\"")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2099
            result.append(seetext);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2100
            return result.toString();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2101
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2102
06bc494ca11e Initial load
duke
parents:
diff changeset
  2103
        //The text from the @see tag.  We will output this text when a label is not specified.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2104
        String text = (isplaintext) ? seetext : getCode() + seetext + getCodeEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2105
06bc494ca11e Initial load
duke
parents:
diff changeset
  2106
        ClassDoc refClass = see.referencedClass();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2107
        String refClassName = see.referencedClassName();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2108
        MemberDoc refMem = see.referencedMember();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2109
        String refMemName = see.referencedMemberName();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2110
        if (refClass == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2111
            //@see is not referencing an included class
06bc494ca11e Initial load
duke
parents:
diff changeset
  2112
            PackageDoc refPackage = see.referencedPackage();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2113
            if (refPackage != null && refPackage.isIncluded()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2114
                //@see is referencing an included package
06bc494ca11e Initial load
duke
parents:
diff changeset
  2115
                String packageName = isplaintext ? refPackage.name() :
06bc494ca11e Initial load
duke
parents:
diff changeset
  2116
                    getCode() + refPackage.name() + getCodeEnd();
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2117
                result.append(getPackageLinkString(refPackage,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2118
                    label.length() == 0 ? packageName : label, false));
06bc494ca11e Initial load
duke
parents:
diff changeset
  2119
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2120
                //@see is not referencing an included class or package.  Check for cross links.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2121
                String classCrossLink, packageCrossLink = getCrossPackageLink(refClassName);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2122
                if (packageCrossLink != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2123
                    //Package cross link found
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2124
                    result.append(getHyperLinkString(packageCrossLink, "",
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2125
                        (label.length() == 0)? text : label, false));
06bc494ca11e Initial load
duke
parents:
diff changeset
  2126
                } else if ((classCrossLink = getCrossClassLink(refClassName,
06bc494ca11e Initial load
duke
parents:
diff changeset
  2127
                        refMemName, label, false, "", ! isplaintext)) != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2128
                    //Class cross link found (possiblly to a member in the class)
06bc494ca11e Initial load
duke
parents:
diff changeset
  2129
                    result.append(classCrossLink);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2130
                } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2131
                    //No cross link found so print warning
06bc494ca11e Initial load
duke
parents:
diff changeset
  2132
                    configuration.getDocletSpecificMsg().warning(see.position(), "doclet.see.class_or_package_not_found",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2133
                            tagName, seetext);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2134
                    result.append((label.length() == 0)? text: label);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2135
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2136
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2137
        } else if (refMemName == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2138
            // Must be a class reference since refClass is not null and refMemName is null.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2139
            if (label.length() == 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2140
                label = (isplaintext) ? refClass.name() : getCode() + refClass.name() + getCodeEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2141
                result.append(getLink(new LinkInfoImpl(refClass, label)));
06bc494ca11e Initial load
duke
parents:
diff changeset
  2142
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2143
                result.append(getLink(new LinkInfoImpl(refClass, label)));
06bc494ca11e Initial load
duke
parents:
diff changeset
  2144
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2145
        } else if (refMem == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2146
            // Must be a member reference since refClass is not null and refMemName is not null.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2147
            // However, refMem is null, so this referenced member does not exist.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2148
            result.append((label.length() == 0)? text: label);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2149
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2150
            // Must be a member reference since refClass is not null and refMemName is not null.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2151
            // refMem is not null, so this @see tag must be referencing a valid member.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2152
            ClassDoc containing = refMem.containingClass();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2153
            if (see.text().trim().startsWith("#") &&
06bc494ca11e Initial load
duke
parents:
diff changeset
  2154
                ! (containing.isPublic() ||
06bc494ca11e Initial load
duke
parents:
diff changeset
  2155
                Util.isLinkable(containing, configuration()))) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2156
                // Since the link is relative and the holder is not even being
06bc494ca11e Initial load
duke
parents:
diff changeset
  2157
                // documented, this must be an inherited link.  Redirect it.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2158
                // The current class either overrides the referenced member or
06bc494ca11e Initial load
duke
parents:
diff changeset
  2159
                // inherits it automatically.
3891
69ac41cb327b 5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents: 2321
diff changeset
  2160
                if (this instanceof ClassWriterImpl) {
69ac41cb327b 5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents: 2321
diff changeset
  2161
                    containing = ((ClassWriterImpl) this).getClassDoc();
69ac41cb327b 5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents: 2321
diff changeset
  2162
                } else if (!containing.isPublic()){
69ac41cb327b 5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents: 2321
diff changeset
  2163
                    configuration.getDocletSpecificMsg().warning(
69ac41cb327b 5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents: 2321
diff changeset
  2164
                        see.position(), "doclet.see.class_or_package_not_accessible",
69ac41cb327b 5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents: 2321
diff changeset
  2165
                        tagName, containing.qualifiedName());
69ac41cb327b 5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents: 2321
diff changeset
  2166
                } else {
69ac41cb327b 5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents: 2321
diff changeset
  2167
                    configuration.getDocletSpecificMsg().warning(
69ac41cb327b 5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents: 2321
diff changeset
  2168
                        see.position(), "doclet.see.class_or_package_not_found",
69ac41cb327b 5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents: 2321
diff changeset
  2169
                        tagName, seetext);
69ac41cb327b 5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents: 2321
diff changeset
  2170
                }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2171
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2172
            if (configuration.currentcd != containing) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2173
                refMemName = containing.name() + "." + refMemName;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2174
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2175
            if (refMem instanceof ExecutableMemberDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2176
                if (refMemName.indexOf('(') < 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2177
                    refMemName += ((ExecutableMemberDoc)refMem).signature();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2178
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2179
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2180
            text = (isplaintext) ?
9592
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents: 9303
diff changeset
  2181
                refMemName : getCode() + Util.escapeHtmlChars(refMemName) + getCodeEnd();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2182
06bc494ca11e Initial load
duke
parents:
diff changeset
  2183
            result.append(getDocLink(LinkInfoImpl.CONTEXT_SEE_TAG, containing,
06bc494ca11e Initial load
duke
parents:
diff changeset
  2184
                refMem, (label.length() == 0)? text: label, false));
06bc494ca11e Initial load
duke
parents:
diff changeset
  2185
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2186
        return result.toString();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2187
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2188
06bc494ca11e Initial load
duke
parents:
diff changeset
  2189
    public void printInlineComment(Doc doc, Tag tag) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2190
        printCommentTags(doc, tag.inlineTags(), false, false);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2191
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2192
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2193
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2194
     * Add the inline comment.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2195
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2196
     * @param doc the doc for which the inline comment will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2197
     * @param tag the inline tag to be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2198
     * @param htmltree 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
  2199
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2200
    public void addInlineComment(Doc doc, Tag tag, Content htmltree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2201
        addCommentTags(doc, tag.inlineTags(), false, false, htmltree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2202
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2203
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2204
    public void printInlineDeprecatedComment(Doc doc, Tag tag) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2205
        printCommentTags(doc, tag.inlineTags(), true, false);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2206
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2207
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2208
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2209
     * Add the inline deprecated comment.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2210
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2211
     * @param doc the doc for which the inline deprecated comment will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2212
     * @param tag the inline tag to be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2213
     * @param htmltree 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
  2214
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2215
    public void addInlineDeprecatedComment(Doc doc, Tag tag, Content htmltree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2216
        addCommentTags(doc, tag.inlineTags(), true, false, htmltree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2217
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2218
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2219
    public void printSummaryComment(Doc doc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2220
        printSummaryComment(doc, doc.firstSentenceTags());
06bc494ca11e Initial load
duke
parents:
diff changeset
  2221
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2222
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2223
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2224
     * Adds the summary content.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2225
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2226
     * @param doc the doc for which the summary will be generated
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2227
     * @param htmltree the documentation 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
  2228
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2229
    public void addSummaryComment(Doc doc, Content htmltree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2230
        addSummaryComment(doc, doc.firstSentenceTags(), htmltree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2231
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2232
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2233
    public void printSummaryComment(Doc doc, Tag[] firstSentenceTags) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2234
        printCommentTags(doc, firstSentenceTags, false, true);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2235
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2236
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2237
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2238
     * Adds the summary content.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2239
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2240
     * @param doc the doc for which the summary will be generated
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2241
     * @param firstSentenceTags the first sentence tags for the doc
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2242
     * @param htmltree the documentation 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
  2243
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2244
    public void addSummaryComment(Doc doc, Tag[] firstSentenceTags, Content htmltree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2245
        addCommentTags(doc, firstSentenceTags, false, true, htmltree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2246
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2247
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2248
    public void printSummaryDeprecatedComment(Doc doc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2249
        printCommentTags(doc, doc.firstSentenceTags(), true, true);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2250
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2251
06bc494ca11e Initial load
duke
parents:
diff changeset
  2252
    public void printSummaryDeprecatedComment(Doc doc, Tag tag) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2253
        printCommentTags(doc, tag.firstSentenceTags(), true, true);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2254
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2255
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2256
    public void addSummaryDeprecatedComment(Doc doc, Tag tag, Content htmltree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2257
        addCommentTags(doc, tag.firstSentenceTags(), true, true, htmltree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2258
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2259
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2260
    public void printInlineComment(Doc doc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2261
        printCommentTags(doc, doc.inlineTags(), false, false);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2262
        p();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2263
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2264
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2265
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2266
     * Adds the inline comment.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2267
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2268
     * @param doc the doc for which the inline comments will be generated
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2269
     * @param htmltree the documentation tree to which the inline comments will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2270
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2271
    public void addInlineComment(Doc doc, Content htmltree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2272
        addCommentTags(doc, doc.inlineTags(), false, false, htmltree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2273
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2274
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2275
    public void printInlineDeprecatedComment(Doc doc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2276
        printCommentTags(doc, doc.inlineTags(), true, false);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2277
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2278
06bc494ca11e Initial load
duke
parents:
diff changeset
  2279
    private void printCommentTags(Doc doc, Tag[] tags, boolean depr, boolean first) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2280
        if(configuration.nocomment){
06bc494ca11e Initial load
duke
parents:
diff changeset
  2281
            return;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2282
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2283
        if (depr) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2284
            italic();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2285
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2286
        String result = commentTagsToString(null, doc, tags, first);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2287
        print(result);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2288
        if (depr) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2289
            italicEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2290
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2291
        if (tags.length == 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2292
            space();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2293
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2294
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2295
06bc494ca11e Initial load
duke
parents:
diff changeset
  2296
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2297
     * Adds the comment tags.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2298
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2299
     * @param doc the doc for which the comment tags will be generated
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2300
     * @param tags the first sentence tags for the doc
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2301
     * @param depr true if it is deprecated
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2302
     * @param first true if the first sentenge tags should be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2303
     * @param htmltree the documentation tree to which the comment tags will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2304
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2305
    private void addCommentTags(Doc doc, Tag[] tags, boolean depr,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2306
            boolean first, Content htmltree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2307
        if(configuration.nocomment){
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2308
            return;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2309
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2310
        Content div;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2311
        Content result = new RawHtml(commentTagsToString(null, doc, tags, first));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2312
        if (depr) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2313
            Content italic = HtmlTree.I(result);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2314
            div = HtmlTree.DIV(HtmlStyle.block, italic);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2315
            htmltree.addContent(div);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2316
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2317
        else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2318
            div = HtmlTree.DIV(HtmlStyle.block, result);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2319
            htmltree.addContent(div);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2320
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2321
        if (tags.length == 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2322
            htmltree.addContent(getSpace());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2323
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2324
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2325
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2326
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2327
     * Converts inline tags and text to text strings, expanding the
06bc494ca11e Initial load
duke
parents:
diff changeset
  2328
     * inline tags along the way.  Called wherever text can contain
06bc494ca11e Initial load
duke
parents:
diff changeset
  2329
     * an inline tag, such as in comments or in free-form text arguments
06bc494ca11e Initial load
duke
parents:
diff changeset
  2330
     * to non-inline tags.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2331
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  2332
     * @param holderTag    specific tag where comment resides
06bc494ca11e Initial load
duke
parents:
diff changeset
  2333
     * @param doc    specific doc where comment resides
06bc494ca11e Initial load
duke
parents:
diff changeset
  2334
     * @param tags   array of text tags and inline tags (often alternating)
06bc494ca11e Initial load
duke
parents:
diff changeset
  2335
     *               present in the text of interest for this doc
06bc494ca11e Initial load
duke
parents:
diff changeset
  2336
     * @param isFirstSentence  true if text is first sentence
06bc494ca11e Initial load
duke
parents:
diff changeset
  2337
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  2338
    public String commentTagsToString(Tag holderTag, Doc doc, Tag[] tags,
06bc494ca11e Initial load
duke
parents:
diff changeset
  2339
            boolean isFirstSentence) {
8631
664f84942e74 6866185: Util.getPackageSourcePath should use lastIndexOf not indexOf and related cleanup
jjg
parents: 7681
diff changeset
  2340
        StringBuilder result = new StringBuilder();
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
  2341
        boolean textTagChange = false;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2342
        // Array of all possible inline tags for this javadoc run
06bc494ca11e Initial load
duke
parents:
diff changeset
  2343
        configuration.tagletManager.checkTags(doc, tags, true);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2344
        for (int i = 0; i < tags.length; i++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2345
            Tag tagelem = tags[i];
06bc494ca11e Initial load
duke
parents:
diff changeset
  2346
            String tagName = tagelem.name();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2347
            if (tagelem instanceof SeeTag) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2348
                result.append(seeTagToString((SeeTag)tagelem));
06bc494ca11e Initial load
duke
parents:
diff changeset
  2349
            } else if (! tagName.equals("Text")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2350
                int originalLength = result.length();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2351
                TagletOutput output = TagletWriter.getInlineTagOuput(
06bc494ca11e Initial load
duke
parents:
diff changeset
  2352
                    configuration.tagletManager, holderTag,
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
  2353
                    tagelem, getTagletWriterInstance(isFirstSentence));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2354
                result.append(output == null ? "" : output.toString());
06bc494ca11e Initial load
duke
parents:
diff changeset
  2355
                if (originalLength == 0 && isFirstSentence && tagelem.name().equals("@inheritDoc") && result.length() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2356
                    break;
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
  2357
                } else if (configuration.docrootparent.length() > 0 &&
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
  2358
                        tagelem.name().equals("@docRoot") &&
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
  2359
                        ((tags[i + 1]).text()).startsWith("/..")) {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
  2360
                    //If Xdocrootparent switch ON, set the flag to remove the /.. occurance after
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
  2361
                    //{@docRoot} tag in the very next Text tag.
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
  2362
                    textTagChange = true;
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
  2363
                    continue;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2364
                } else {
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
  2365
                    continue;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2366
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2367
            } else {
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
  2368
                String text = tagelem.text();
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
  2369
                //If Xdocrootparent switch ON, remove the /.. occurance after {@docRoot} tag.
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
  2370
                if (textTagChange) {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
  2371
                    text = text.replaceFirst("/..", "");
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
  2372
                    textTagChange = false;
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
  2373
                }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2374
                //This is just a regular text tag.  The text may contain html links (<a>)
06bc494ca11e Initial load
duke
parents:
diff changeset
  2375
                //or inline tag {@docRoot}, which will be handled as special cases.
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents: 9606
diff changeset
  2376
                text = redirectRelativeLinks(tagelem.holder(), text);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2377
06bc494ca11e Initial load
duke
parents:
diff changeset
  2378
                // Replace @docRoot only if not represented by an instance of DocRootTaglet,
06bc494ca11e Initial load
duke
parents:
diff changeset
  2379
                // that is, only if it was not present in a source file doc comment.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2380
                // This happens when inserted by the doclet (a few lines
06bc494ca11e Initial load
duke
parents:
diff changeset
  2381
                // above in this method).  [It might also happen when passed in on the command
06bc494ca11e Initial load
duke
parents:
diff changeset
  2382
                // line as a text argument to an option (like -header).]
06bc494ca11e Initial load
duke
parents:
diff changeset
  2383
                text = replaceDocRootDir(text);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2384
                if (isFirstSentence) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2385
                    text = removeNonInlineHtmlTags(text);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2386
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2387
                StringTokenizer lines = new StringTokenizer(text, "\r\n", true);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2388
                StringBuffer textBuff = new StringBuffer();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2389
                while (lines.hasMoreTokens()) {
8631
664f84942e74 6866185: Util.getPackageSourcePath should use lastIndexOf not indexOf and related cleanup
jjg
parents: 7681
diff changeset
  2390
                    StringBuilder line = new StringBuilder(lines.nextToken());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2391
                    Util.replaceTabs(configuration.sourcetab, line);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2392
                    textBuff.append(line.toString());
06bc494ca11e Initial load
duke
parents:
diff changeset
  2393
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2394
                result.append(textBuff);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2395
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2396
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2397
        return result.toString();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2398
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2399
06bc494ca11e Initial load
duke
parents:
diff changeset
  2400
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  2401
     * Return true if relative links should not be redirected.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2402
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  2403
     * @return Return true if a relative link should not be redirected.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2404
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  2405
    private boolean shouldNotRedirectRelativeLinks() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2406
        return  this instanceof AnnotationTypeWriter ||
06bc494ca11e Initial load
duke
parents:
diff changeset
  2407
                this instanceof ClassWriter ||
06bc494ca11e Initial load
duke
parents:
diff changeset
  2408
                this instanceof PackageSummaryWriter;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2409
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2410
06bc494ca11e Initial load
duke
parents:
diff changeset
  2411
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  2412
     * Suppose a piece of documentation has a relative link.  When you copy
06bc494ca11e Initial load
duke
parents:
diff changeset
  2413
     * that documetation to another place such as the index or class-use page,
06bc494ca11e Initial load
duke
parents:
diff changeset
  2414
     * that relative link will no longer work.  We should redirect those links
06bc494ca11e Initial load
duke
parents:
diff changeset
  2415
     * so that they will work again.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2416
     * <p>
06bc494ca11e Initial load
duke
parents:
diff changeset
  2417
     * Here is the algorithm used to fix the link:
06bc494ca11e Initial load
duke
parents:
diff changeset
  2418
     * <p>
06bc494ca11e Initial load
duke
parents:
diff changeset
  2419
     * &lt;relative link&gt; => docRoot + &lt;relative path to file&gt; + &lt;relative link&gt;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2420
     * <p>
06bc494ca11e Initial load
duke
parents:
diff changeset
  2421
     * For example, suppose com.sun.javadoc.RootDoc has this link:
06bc494ca11e Initial load
duke
parents:
diff changeset
  2422
     * &lt;a href="package-summary.html"&gt;The package Page&lt;/a&gt;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2423
     * <p>
06bc494ca11e Initial load
duke
parents:
diff changeset
  2424
     * If this link appeared in the index, we would redirect
06bc494ca11e Initial load
duke
parents:
diff changeset
  2425
     * the link like this:
06bc494ca11e Initial load
duke
parents:
diff changeset
  2426
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  2427
     * &lt;a href="./com/sun/javadoc/package-summary.html"&gt;The package Page&lt;/a&gt;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2428
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  2429
     * @param doc the Doc object whose documentation is being written.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2430
     * @param text the text being written.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2431
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  2432
     * @return the text, with all the relative links redirected to work.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2433
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  2434
    private String redirectRelativeLinks(Doc doc, String text) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2435
        if (doc == null || shouldNotRedirectRelativeLinks()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2436
            return text;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2437
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2438
06bc494ca11e Initial load
duke
parents:
diff changeset
  2439
        String redirectPathFromRoot;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2440
        if (doc instanceof ClassDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2441
            redirectPathFromRoot = DirectoryManager.getDirectoryPath(((ClassDoc) doc).containingPackage());
06bc494ca11e Initial load
duke
parents:
diff changeset
  2442
        } else if (doc instanceof MemberDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2443
            redirectPathFromRoot = DirectoryManager.getDirectoryPath(((MemberDoc) doc).containingPackage());
06bc494ca11e Initial load
duke
parents:
diff changeset
  2444
        } else if (doc instanceof PackageDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2445
            redirectPathFromRoot = DirectoryManager.getDirectoryPath((PackageDoc) doc);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2446
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2447
            return text;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2448
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2449
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2450
        if (! redirectPathFromRoot.endsWith(DirectoryManager.URL_FILE_SEPARATOR)) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2451
            redirectPathFromRoot += DirectoryManager.URL_FILE_SEPARATOR;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2452
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2453
06bc494ca11e Initial load
duke
parents:
diff changeset
  2454
        //Redirect all relative links.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2455
        int end, begin = text.toLowerCase().indexOf("<a");
06bc494ca11e Initial load
duke
parents:
diff changeset
  2456
        if(begin >= 0){
06bc494ca11e Initial load
duke
parents:
diff changeset
  2457
            StringBuffer textBuff = new StringBuffer(text);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2458
06bc494ca11e Initial load
duke
parents:
diff changeset
  2459
            while(begin >=0){
06bc494ca11e Initial load
duke
parents:
diff changeset
  2460
                if (textBuff.length() > begin + 2 && ! Character.isWhitespace(textBuff.charAt(begin+2))) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2461
                    begin = textBuff.toString().toLowerCase().indexOf("<a", begin + 1);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2462
                    continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2463
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2464
06bc494ca11e Initial load
duke
parents:
diff changeset
  2465
                begin = textBuff.indexOf("=", begin) + 1;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2466
                end = textBuff.indexOf(">", begin +1);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2467
                if(begin == 0){
06bc494ca11e Initial load
duke
parents:
diff changeset
  2468
                    //Link has no equal symbol.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2469
                    configuration.root.printWarning(
06bc494ca11e Initial load
duke
parents:
diff changeset
  2470
                        doc.position(),
06bc494ca11e Initial load
duke
parents:
diff changeset
  2471
                        configuration.getText("doclet.malformed_html_link_tag", text));
06bc494ca11e Initial load
duke
parents:
diff changeset
  2472
                    break;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2473
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2474
                if (end == -1) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2475
                    //Break without warning.  This <a> tag is not necessarily malformed.  The text
06bc494ca11e Initial load
duke
parents:
diff changeset
  2476
                    //might be missing '>' character because the href has an inline tag.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2477
                    break;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2478
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2479
                if(textBuff.substring(begin, end).indexOf("\"") != -1){
06bc494ca11e Initial load
duke
parents:
diff changeset
  2480
                    begin = textBuff.indexOf("\"", begin) + 1;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2481
                    end = textBuff.indexOf("\"", begin +1);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2482
                    if(begin == 0 || end == -1){
06bc494ca11e Initial load
duke
parents:
diff changeset
  2483
                        //Link is missing a quote.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2484
                        break;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2485
                    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2486
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2487
                String relativeLink = textBuff.substring(begin, end);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2488
                if(!(relativeLink.toLowerCase().startsWith("mailto:") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
  2489
                     relativeLink.toLowerCase().startsWith("http:") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
  2490
                     relativeLink.toLowerCase().startsWith("https:") ||
06bc494ca11e Initial load
duke
parents:
diff changeset
  2491
                     relativeLink.toLowerCase().startsWith("file:"))){
06bc494ca11e Initial load
duke
parents:
diff changeset
  2492
                     relativeLink = "{@"+(new DocRootTaglet()).getName() + "}"
06bc494ca11e Initial load
duke
parents:
diff changeset
  2493
                        + redirectPathFromRoot
06bc494ca11e Initial load
duke
parents:
diff changeset
  2494
                        + relativeLink;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2495
                    textBuff.replace(begin, end, relativeLink);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2496
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2497
                begin = textBuff.toString().toLowerCase().indexOf("<a", begin + 1);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2498
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2499
            return textBuff.toString();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2500
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2501
        return text;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2502
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2503
06bc494ca11e Initial load
duke
parents:
diff changeset
  2504
    public String removeNonInlineHtmlTags(String text) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2505
        if (text.indexOf('<') < 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2506
            return text;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2507
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2508
        String noninlinetags[] = { "<ul>", "</ul>", "<ol>", "</ol>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2509
                "<dl>", "</dl>", "<table>", "</table>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2510
                "<tr>", "</tr>", "<td>", "</td>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2511
                "<th>", "</th>", "<p>", "</p>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2512
                "<li>", "</li>", "<dd>", "</dd>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2513
                "<dir>", "</dir>", "<dt>", "</dt>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2514
                "<h1>", "</h1>", "<h2>", "</h2>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2515
                "<h3>", "</h3>", "<h4>", "</h4>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2516
                "<h5>", "</h5>", "<h6>", "</h6>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2517
                "<pre>", "</pre>", "<menu>", "</menu>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2518
                "<listing>", "</listing>", "<hr>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2519
                "<blockquote>", "</blockquote>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2520
                "<center>", "</center>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2521
                "<UL>", "</UL>", "<OL>", "</OL>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2522
                "<DL>", "</DL>", "<TABLE>", "</TABLE>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2523
                "<TR>", "</TR>", "<TD>", "</TD>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2524
                "<TH>", "</TH>", "<P>", "</P>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2525
                "<LI>", "</LI>", "<DD>", "</DD>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2526
                "<DIR>", "</DIR>", "<DT>", "</DT>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2527
                "<H1>", "</H1>", "<H2>", "</H2>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2528
                "<H3>", "</H3>", "<H4>", "</H4>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2529
                "<H5>", "</H5>", "<H6>", "</H6>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2530
                "<PRE>", "</PRE>", "<MENU>", "</MENU>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2531
                "<LISTING>", "</LISTING>", "<HR>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2532
                "<BLOCKQUOTE>", "</BLOCKQUOTE>",
06bc494ca11e Initial load
duke
parents:
diff changeset
  2533
                "<CENTER>", "</CENTER>"
06bc494ca11e Initial load
duke
parents:
diff changeset
  2534
        };
06bc494ca11e Initial load
duke
parents:
diff changeset
  2535
        for (int i = 0; i < noninlinetags.length; i++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2536
            text = replace(text, noninlinetags[i], "");
06bc494ca11e Initial load
duke
parents:
diff changeset
  2537
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2538
        return text;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2539
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2540
06bc494ca11e Initial load
duke
parents:
diff changeset
  2541
    public String replace(String text, String tobe, String by) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2542
        while (true) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2543
            int startindex = text.indexOf(tobe);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2544
            if (startindex < 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2545
                return text;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2546
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2547
            int endindex = startindex + tobe.length();
8631
664f84942e74 6866185: Util.getPackageSourcePath should use lastIndexOf not indexOf and related cleanup
jjg
parents: 7681
diff changeset
  2548
            StringBuilder replaced = new StringBuilder();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2549
            if (startindex > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2550
                replaced.append(text.substring(0, startindex));
06bc494ca11e Initial load
duke
parents:
diff changeset
  2551
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2552
            replaced.append(by);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2553
            if (text.length() > endindex) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2554
                replaced.append(text.substring(endindex));
06bc494ca11e Initial load
duke
parents:
diff changeset
  2555
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2556
            text = replaced.toString();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2557
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2558
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2559
06bc494ca11e Initial load
duke
parents:
diff changeset
  2560
    public void printStyleSheetProperties() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2561
        String filename = configuration.stylesheetfile;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2562
        if (filename.length() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2563
            File stylefile = new File(filename);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2564
            String parent = stylefile.getParent();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2565
            filename = (parent == null)?
06bc494ca11e Initial load
duke
parents:
diff changeset
  2566
                filename:
06bc494ca11e Initial load
duke
parents:
diff changeset
  2567
                filename.substring(parent.length() + 1);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2568
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2569
            filename = "stylesheet.css";
06bc494ca11e Initial load
duke
parents:
diff changeset
  2570
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2571
        filename = relativePath + filename;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2572
        link("REL =\"stylesheet\" TYPE=\"text/css\" HREF=\"" +
06bc494ca11e Initial load
duke
parents:
diff changeset
  2573
                 filename + "\" " + "TITLE=\"Style\"");
06bc494ca11e Initial load
duke
parents:
diff changeset
  2574
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2575
06bc494ca11e Initial load
duke
parents:
diff changeset
  2576
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2577
     * Returns a link to the stylesheet file.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2578
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2579
     * @return an HtmlTree for the lINK tag which provides the stylesheet location
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2580
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2581
    public HtmlTree getStyleSheetProperties() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2582
        String filename = configuration.stylesheetfile;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2583
        if (filename.length() > 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2584
            File stylefile = new File(filename);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2585
            String parent = stylefile.getParent();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2586
            filename = (parent == null)?
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2587
                filename:
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2588
                filename.substring(parent.length() + 1);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2589
        } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2590
            filename = "stylesheet.css";
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2591
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2592
        filename = relativePath + filename;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2593
        HtmlTree link = HtmlTree.LINK("stylesheet", "text/css", filename, "Style");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2594
        return link;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2595
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2596
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2597
    /**
9303
eae35c201e19 7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents: 8631
diff changeset
  2598
     * According to
eae35c201e19 7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents: 8631
diff changeset
  2599
     * <cite>The Java&trade; Language Specification</cite>,
eae35c201e19 7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents: 8631
diff changeset
  2600
     * all the outer classes and static nested classes are core classes.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2601
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  2602
    public boolean isCoreClass(ClassDoc cd) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2603
        return cd.containingClass() == null || cd.isStatic();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2604
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2605
06bc494ca11e Initial load
duke
parents:
diff changeset
  2606
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  2607
     * Write the annotatation types for the given packageDoc.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2608
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  2609
     * @param packageDoc the package to write annotations for.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2610
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  2611
    public void writeAnnotationInfo(PackageDoc packageDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2612
        writeAnnotationInfo(packageDoc, packageDoc.annotations());
06bc494ca11e Initial load
duke
parents:
diff changeset
  2613
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2614
06bc494ca11e Initial load
duke
parents:
diff changeset
  2615
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2616
     * Adds the annotatation types for the given packageDoc.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2617
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2618
     * @param packageDoc the package to write annotations for.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2619
     * @param htmltree the documentation tree to which the annotation info will be
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2620
     *        added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2621
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2622
    public void addAnnotationInfo(PackageDoc packageDoc, Content htmltree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2623
        addAnnotationInfo(packageDoc, packageDoc.annotations(), htmltree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2624
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2625
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2626
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2627
     * Write the annotatation types for the given doc.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2628
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  2629
     * @param doc the doc to write annotations for.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2630
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  2631
    public void writeAnnotationInfo(ProgramElementDoc doc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2632
        writeAnnotationInfo(doc, doc.annotations());
06bc494ca11e Initial load
duke
parents:
diff changeset
  2633
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2634
06bc494ca11e Initial load
duke
parents:
diff changeset
  2635
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2636
     * Adds the annotatation types for the given doc.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2637
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2638
     * @param packageDoc the package to write annotations for
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2639
     * @param htmltree the content tree to which the annotation types will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2640
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2641
    public void addAnnotationInfo(ProgramElementDoc doc, Content htmltree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2642
        addAnnotationInfo(doc, doc.annotations(), htmltree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2643
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2644
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2645
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2646
     * Write the annotatation types for the given doc and parameter.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2647
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  2648
     * @param indent the number of spaced to indent the parameters.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2649
     * @param doc the doc to write annotations for.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2650
     * @param param the parameter to write annotations for.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2651
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  2652
    public boolean writeAnnotationInfo(int indent, Doc doc, Parameter param) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2653
        return writeAnnotationInfo(indent, doc, param.annotations(), false);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2654
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2655
06bc494ca11e Initial load
duke
parents:
diff changeset
  2656
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2657
     * Add the annotatation types for the given doc and parameter.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2658
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2659
     * @param indent the number of spaces to indent the parameters.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2660
     * @param doc the doc to write annotations for.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2661
     * @param param the parameter to write annotations for.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2662
     * @param tree the content tree to which the annotation types will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2663
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2664
    public boolean addAnnotationInfo(int indent, Doc doc, Parameter param,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2665
            Content tree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2666
        return addAnnotationInfo(indent, doc, param.annotations(), false, tree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2667
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2668
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2669
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2670
     * Write the annotatation types for the given doc.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2671
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  2672
     * @param doc the doc to write annotations for.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2673
     * @param descList the array of {@link AnnotationDesc}.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2674
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  2675
    private void writeAnnotationInfo(Doc doc, AnnotationDesc[] descList) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2676
        writeAnnotationInfo(0, doc, descList, true);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2677
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2678
06bc494ca11e Initial load
duke
parents:
diff changeset
  2679
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2680
     * Adds the annotatation types for the given doc.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2681
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2682
     * @param doc the doc to write annotations for.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2683
     * @param descList the array of {@link AnnotationDesc}.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2684
     * @param htmltree the documentation tree to which the annotation info will be
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2685
     *        added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2686
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2687
    private void addAnnotationInfo(Doc doc, AnnotationDesc[] descList,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2688
            Content htmltree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2689
        addAnnotationInfo(0, doc, descList, true, htmltree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2690
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2691
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2692
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2693
     * Write the annotatation types for the given doc.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2694
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  2695
     * @param indent the number of extra spaces to indent the annotations.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2696
     * @param doc the doc to write annotations for.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2697
     * @param descList the array of {@link AnnotationDesc}.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2698
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  2699
    private boolean writeAnnotationInfo(int indent, Doc doc, AnnotationDesc[] descList, boolean lineBreak) {
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
  2700
        List<String> annotations = getAnnotations(indent, descList, lineBreak);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2701
        if (annotations.size() == 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2702
            return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2703
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2704
        fontNoNewLine("-1");
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
  2705
        for (Iterator<String> iter = annotations.iterator(); iter.hasNext();) {
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
  2706
            print(iter.next());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2707
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2708
        fontEnd();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2709
        return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2710
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2711
06bc494ca11e Initial load
duke
parents:
diff changeset
  2712
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2713
     * Adds the annotatation types for the given doc.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2714
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2715
     * @param indent the number of extra spaces to indent the annotations.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2716
     * @param doc the doc to write annotations for.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2717
     * @param descList the array of {@link AnnotationDesc}.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2718
     * @param htmltree the documentation tree to which the annotation info will be
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2719
     *        added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2720
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2721
    private boolean addAnnotationInfo(int indent, Doc doc,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2722
            AnnotationDesc[] descList, boolean lineBreak, Content htmltree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2723
        List<String> annotations = getAnnotations(indent, descList, lineBreak);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2724
        if (annotations.size() == 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2725
            return false;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2726
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2727
        Content annotationContent;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2728
        for (Iterator<String> iter = annotations.iterator(); iter.hasNext();) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2729
            annotationContent = new RawHtml(iter.next());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2730
            htmltree.addContent(annotationContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2731
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2732
        return true;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2733
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2734
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
  2735
   /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2736
     * Return the string representations of the annotation types for
06bc494ca11e Initial load
duke
parents:
diff changeset
  2737
     * the given doc.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2738
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  2739
     * @param indent the number of extra spaces to indent the annotations.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2740
     * @param descList the array of {@link AnnotationDesc}.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2741
     * @param linkBreak if true, add new line between each member value.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2742
     * @return an array of strings representing the annotations being
06bc494ca11e Initial load
duke
parents:
diff changeset
  2743
     *         documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2744
     */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
  2745
    private List<String> getAnnotations(int indent, AnnotationDesc[] descList, boolean linkBreak) {
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
  2746
        List<String> results = new ArrayList<String>();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2747
        StringBuffer annotation;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2748
        for (int i = 0; i < descList.length; i++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2749
            AnnotationTypeDoc annotationDoc = descList[i].annotationType();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2750
            if (! Util.isDocumentedAnnotation(annotationDoc)){
06bc494ca11e Initial load
duke
parents:
diff changeset
  2751
                continue;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2752
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2753
            annotation = new StringBuffer();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2754
            LinkInfoImpl linkInfo = new LinkInfoImpl(
06bc494ca11e Initial load
duke
parents:
diff changeset
  2755
                LinkInfoImpl.CONTEXT_ANNOTATION, annotationDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2756
            linkInfo.label = "@" + annotationDoc.name();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2757
            annotation.append(getLink(linkInfo));
06bc494ca11e Initial load
duke
parents:
diff changeset
  2758
            AnnotationDesc.ElementValuePair[] pairs = descList[i].elementValues();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2759
            if (pairs.length > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2760
                annotation.append('(');
06bc494ca11e Initial load
duke
parents:
diff changeset
  2761
                for (int j = 0; j < pairs.length; j++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2762
                    if (j > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2763
                        annotation.append(",");
06bc494ca11e Initial load
duke
parents:
diff changeset
  2764
                        if (linkBreak) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2765
                            annotation.append(DocletConstants.NL);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2766
                            int spaces = annotationDoc.name().length() + 2;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2767
                            for (int k = 0; k < (spaces + indent); k++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2768
                                annotation.append(' ');
06bc494ca11e Initial load
duke
parents:
diff changeset
  2769
                            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2770
                        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2771
                    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2772
                    annotation.append(getDocLink(LinkInfoImpl.CONTEXT_ANNOTATION,
06bc494ca11e Initial load
duke
parents:
diff changeset
  2773
                        pairs[j].element(), pairs[j].element().name(), false));
06bc494ca11e Initial load
duke
parents:
diff changeset
  2774
                    annotation.append('=');
06bc494ca11e Initial load
duke
parents:
diff changeset
  2775
                    AnnotationValue annotationValue = pairs[j].value();
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
  2776
                    List<AnnotationValue> annotationTypeValues = new ArrayList<AnnotationValue>();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2777
                    if (annotationValue.value() instanceof AnnotationValue[]) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2778
                        AnnotationValue[] annotationArray =
06bc494ca11e Initial load
duke
parents:
diff changeset
  2779
                            (AnnotationValue[]) annotationValue.value();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2780
                        for (int k = 0; k < annotationArray.length; k++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2781
                            annotationTypeValues.add(annotationArray[k]);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2782
                        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2783
                    } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2784
                        annotationTypeValues.add(annotationValue);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2785
                    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2786
                    annotation.append(annotationTypeValues.size() == 1 ? "" : "{");
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
  2787
                    for (Iterator<AnnotationValue> iter = annotationTypeValues.iterator(); iter.hasNext(); ) {
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
  2788
                        annotation.append(annotationValueToString(iter.next()));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2789
                        annotation.append(iter.hasNext() ? "," : "");
06bc494ca11e Initial load
duke
parents:
diff changeset
  2790
                    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2791
                    annotation.append(annotationTypeValues.size() == 1 ? "" : "}");
06bc494ca11e Initial load
duke
parents:
diff changeset
  2792
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2793
                annotation.append(")");
06bc494ca11e Initial load
duke
parents:
diff changeset
  2794
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2795
            annotation.append(linkBreak ? DocletConstants.NL : "");
06bc494ca11e Initial load
duke
parents:
diff changeset
  2796
            results.add(annotation.toString());
06bc494ca11e Initial load
duke
parents:
diff changeset
  2797
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2798
        return results;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2799
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2800
06bc494ca11e Initial load
duke
parents:
diff changeset
  2801
    private String annotationValueToString(AnnotationValue annotationValue) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2802
        if (annotationValue.value() instanceof Type) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2803
            Type type = (Type) annotationValue.value();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2804
            if (type.asClassDoc() != null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2805
                LinkInfoImpl linkInfo = new LinkInfoImpl(
06bc494ca11e Initial load
duke
parents:
diff changeset
  2806
                    LinkInfoImpl.CONTEXT_ANNOTATION, type);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2807
                    linkInfo.label = (type.asClassDoc().isIncluded() ?
06bc494ca11e Initial load
duke
parents:
diff changeset
  2808
                        type.typeName() :
06bc494ca11e Initial load
duke
parents:
diff changeset
  2809
                        type.qualifiedTypeName()) + type.dimension() + ".class";
06bc494ca11e Initial load
duke
parents:
diff changeset
  2810
                return getLink(linkInfo);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2811
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2812
                return type.typeName() + type.dimension() + ".class";
06bc494ca11e Initial load
duke
parents:
diff changeset
  2813
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2814
        } else if (annotationValue.value() instanceof AnnotationDesc) {
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
  2815
            List<String> list = getAnnotations(0,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2816
                new AnnotationDesc[]{(AnnotationDesc) annotationValue.value()},
06bc494ca11e Initial load
duke
parents:
diff changeset
  2817
                    false);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2818
            StringBuffer buf = new StringBuffer();
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1787
diff changeset
  2819
            for (Iterator<String> iter = list.iterator(); iter.hasNext(); ) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
  2820
                buf.append(iter.next());
06bc494ca11e Initial load
duke
parents:
diff changeset
  2821
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2822
            return buf.toString();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2823
        } else if (annotationValue.value() instanceof MemberDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2824
            return getDocLink(LinkInfoImpl.CONTEXT_ANNOTATION,
06bc494ca11e Initial load
duke
parents:
diff changeset
  2825
                (MemberDoc) annotationValue.value(),
06bc494ca11e Initial load
duke
parents:
diff changeset
  2826
                ((MemberDoc) annotationValue.value()).name(), false);
06bc494ca11e Initial load
duke
parents:
diff changeset
  2827
         } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2828
            return annotationValue.toString();
06bc494ca11e Initial load
duke
parents:
diff changeset
  2829
         }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2830
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2831
06bc494ca11e Initial load
duke
parents:
diff changeset
  2832
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
  2833
     * Return the configuation for this doclet.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2834
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
  2835
     * @return the configuration for this doclet.
06bc494ca11e Initial load
duke
parents:
diff changeset
  2836
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
  2837
    public Configuration configuration() {
06bc494ca11e Initial load
duke
parents:
diff changeset
  2838
        return configuration;
06bc494ca11e Initial load
duke
parents:
diff changeset
  2839
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
  2840
}