langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
author bpatel
Tue, 12 May 2015 12:02:48 -0700
changeset 30528 dadaac1f5cc2
parent 29957 7740f9657f56
child 33920 bd731341c405
permissions -rw-r--r--
8065077: MethodTypes are not localized Reviewed-by: ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
29429
964498d4dcec 8074521: Generate iframe instead of frame and frameset for index.html page
bpatel
parents: 25874
diff changeset
     2
 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
package com.sun.tools.doclets.formats.html.markup;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1863
diff changeset
    28
import java.io.*;
14549
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
    29
import java.util.*;
17563
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 17560
diff changeset
    30
import java.util.regex.Matcher;
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 17560
diff changeset
    31
import java.util.regex.Pattern;
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1863
diff changeset
    32
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
import com.sun.tools.doclets.internal.toolkit.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
import com.sun.tools.doclets.internal.toolkit.util.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 * Class for the Html format code generation.
14266
69453558960d 8000673: remove dead code from HtmlWriter and subtypes
jjg
parents: 14265
diff changeset
    38
 * Initializes PrintWriter with FileWriter, to enable print
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 * related methods to generate the code to the named File through FileWriter.
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14259
diff changeset
    41
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14259
diff changeset
    42
 *  If you write code that depends on this, you do so at your own risk.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14259
diff changeset
    43
 *  This code and its internal interfaces are subject to change or
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14259
diff changeset
    44
 *  deletion without notice.</b>
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14259
diff changeset
    45
 *
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
 * @since 1.2
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
 * @author Atul M Dambalkar
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
    48
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
 */
14266
69453558960d 8000673: remove dead code from HtmlWriter and subtypes
jjg
parents: 14265
diff changeset
    50
public class HtmlWriter {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
     * The window title of this file
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
    protected String winTitle;
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
     * The configuration
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
    protected Configuration configuration;
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
    /**
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1863
diff changeset
    63
     * The flag to indicate whether a member details list is printed or not.
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1863
diff changeset
    64
     */
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1863
diff changeset
    65
    protected boolean memberDetailsListPrinted;
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1863
diff changeset
    66
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1863
diff changeset
    67
    /**
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
    68
     * Header for table displaying profiles and description..
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
    69
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
    70
    protected final String[] profileTableHeader;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
    71
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
    72
    /**
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
    73
     * Header for tables displaying packages and description..
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
    74
     */
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
    75
    protected final String[] packageTableHeader;
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
    76
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
    77
    /**
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
    78
     * Summary for use tables displaying class and package use.
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
    79
     */
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
    80
    protected final String useTableSummary;
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
    81
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
    82
    /**
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
    83
     * Column header for class docs displaying Modifier and Type header.
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
    84
     */
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
    85
    protected final String modifierTypeHeader;
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
    86
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    87
    public final Content overviewLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    88
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    89
    public final Content defaultPackageLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    90
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    91
    public final Content packageLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    92
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
    93
    public final Content profileLabel;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
    94
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    95
    public final Content useLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    96
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    97
    public final Content prevLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    98
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    99
    public final Content nextLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   100
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   101
    public final Content prevclassLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   102
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   103
    public final Content nextclassLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   104
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   105
    public final Content summaryLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   106
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   107
    public final Content detailLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   108
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   109
    public final Content framesLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   110
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   111
    public final Content noframesLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   112
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   113
    public final Content treeLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   114
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   115
    public final Content classLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   116
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   117
    public final Content deprecatedLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   118
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   119
    public final Content deprecatedPhrase;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   120
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   121
    public final Content allclassesLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   122
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   123
    public final Content allpackagesLabel;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   124
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   125
    public final Content allprofilesLabel;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   126
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   127
    public final Content indexLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   128
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   129
    public final Content helpLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   130
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   131
    public final Content seeLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   132
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   133
    public final Content descriptionLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   134
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   135
    public final Content prevpackageLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   136
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   137
    public final Content nextpackageLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   138
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   139
    public final Content prevprofileLabel;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   140
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   141
    public final Content nextprofileLabel;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   142
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   143
    public final Content packagesLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   144
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   145
    public final Content profilesLabel;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   146
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   147
    public final Content methodDetailsLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   148
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   149
    public final Content annotationTypeDetailsLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   150
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   151
    public final Content fieldDetailsLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   152
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   153
    public final Content propertyDetailsLabel;
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   154
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   155
    public final Content constructorDetailsLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   156
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   157
    public final Content enumConstantsDetailsLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   158
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   159
    public final Content specifiedByLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   160
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   161
    public final Content overridesLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   162
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   163
    public final Content descfrmClassLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   164
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   165
    public final Content descfrmInterfaceLabel;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   166
14266
69453558960d 8000673: remove dead code from HtmlWriter and subtypes
jjg
parents: 14265
diff changeset
   167
    private final Writer writer;
69453558960d 8000673: remove dead code from HtmlWriter and subtypes
jjg
parents: 14265
diff changeset
   168
14549
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   169
    private Content script;
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   170
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
   171
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
     * Constructor.
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
     * @param path The directory path to be created for this file
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
     *             or null if none to be created.
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
     * @exception IOException Exception raised by the FileWriter is passed on
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
     * to next level.
14259
fb94a1df0d53 8000208: fix langtools javadoc comment issues
jjg
parents: 9067
diff changeset
   178
     * @exception UnsupportedEncodingException Exception raised by the
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
     * OutputStreamWriter is passed on to next level.
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
     */
14366
af625e568667 8001929: fix doclint errors in langtools doc comments
jjg
parents: 14357
diff changeset
   181
    public HtmlWriter(Configuration configuration, DocPath path)
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14266
diff changeset
   182
            throws IOException, UnsupportedEncodingException {
14368
6f4c62de6985 8001664: refactor javadoc to use abstraction to handle files
jjg
parents: 14366
diff changeset
   183
        writer = DocFile.createFileForOutput(configuration, path).openWriter();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
        this.configuration = configuration;
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1863
diff changeset
   185
        this.memberDetailsListPrinted = false;
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   186
        profileTableHeader = new String[] {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   187
            configuration.getText("doclet.Profile"),
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   188
            configuration.getText("doclet.Description")
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   189
        };
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
   190
        packageTableHeader = new String[] {
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
   191
            configuration.getText("doclet.Package"),
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
   192
            configuration.getText("doclet.Description")
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
   193
        };
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
   194
        useTableSummary = configuration.getText("doclet.Use_Table_Summary",
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
   195
                configuration.getText("doclet.packages"));
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
   196
        modifierTypeHeader = configuration.getText("doclet.0_and_1",
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
   197
                configuration.getText("doclet.Modifier"),
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
   198
                configuration.getText("doclet.Type"));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   199
        overviewLabel = getResource("doclet.Overview");
17569
ef80738645e2 8012178: Cleanup use of Util.escapeHtmlChars
jjg
parents: 17563
diff changeset
   200
        defaultPackageLabel = new StringContent(DocletConstants.DEFAULT_PACKAGE_NAME);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   201
        packageLabel = getResource("doclet.Package");
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   202
        profileLabel = getResource("doclet.Profile");
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   203
        useLabel = getResource("doclet.navClassUse");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   204
        prevLabel = getResource("doclet.Prev");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   205
        nextLabel = getResource("doclet.Next");
19907
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   206
        prevclassLabel = getNonBreakResource("doclet.Prev_Class");
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   207
        nextclassLabel = getNonBreakResource("doclet.Next_Class");
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   208
        summaryLabel = getResource("doclet.Summary");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   209
        detailLabel = getResource("doclet.Detail");
9067
c0b85430843d 7025314: NLS: translatability violation on standard.properties
bpatel
parents: 7681
diff changeset
   210
        framesLabel = getResource("doclet.Frames");
19907
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   211
        noframesLabel = getNonBreakResource("doclet.No_Frames");
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   212
        treeLabel = getResource("doclet.Tree");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   213
        classLabel = getResource("doclet.Class");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   214
        deprecatedLabel = getResource("doclet.navDeprecated");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   215
        deprecatedPhrase = getResource("doclet.Deprecated");
19907
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   216
        allclassesLabel = getNonBreakResource("doclet.All_Classes");
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   217
        allpackagesLabel = getNonBreakResource("doclet.All_Packages");
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   218
        allprofilesLabel = getNonBreakResource("doclet.All_Profiles");
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   219
        indexLabel = getResource("doclet.Index");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   220
        helpLabel = getResource("doclet.Help");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   221
        seeLabel = getResource("doclet.See");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   222
        descriptionLabel = getResource("doclet.Description");
19907
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   223
        prevpackageLabel = getNonBreakResource("doclet.Prev_Package");
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   224
        nextpackageLabel = getNonBreakResource("doclet.Next_Package");
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   225
        prevprofileLabel = getNonBreakResource("doclet.Prev_Profile");
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   226
        nextprofileLabel = getNonBreakResource("doclet.Next_Profile");
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   227
        packagesLabel = getResource("doclet.Packages");
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14549
diff changeset
   228
        profilesLabel = getResource("doclet.Profiles");
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   229
        methodDetailsLabel = getResource("doclet.Method_Detail");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   230
        annotationTypeDetailsLabel = getResource("doclet.Annotation_Type_Member_Detail");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   231
        fieldDetailsLabel = getResource("doclet.Field_Detail");
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   232
        propertyDetailsLabel = getResource("doclet.Property_Detail");
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   233
        constructorDetailsLabel = getResource("doclet.Constructor_Detail");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   234
        enumConstantsDetailsLabel = getResource("doclet.Enum_Constant_Detail");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   235
        specifiedByLabel = getResource("doclet.Specified_By");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   236
        overridesLabel = getResource("doclet.Overrides");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   237
        descfrmClassLabel = getResource("doclet.Description_From_Class");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   238
        descfrmInterfaceLabel = getResource("doclet.Description_From_Interface");
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   239
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   240
14266
69453558960d 8000673: remove dead code from HtmlWriter and subtypes
jjg
parents: 14265
diff changeset
   241
    public void write(Content c) throws IOException {
69453558960d 8000673: remove dead code from HtmlWriter and subtypes
jjg
parents: 14265
diff changeset
   242
        c.write(writer, true);
69453558960d 8000673: remove dead code from HtmlWriter and subtypes
jjg
parents: 14265
diff changeset
   243
    }
69453558960d 8000673: remove dead code from HtmlWriter and subtypes
jjg
parents: 14265
diff changeset
   244
69453558960d 8000673: remove dead code from HtmlWriter and subtypes
jjg
parents: 14265
diff changeset
   245
    public void close() throws IOException {
69453558960d 8000673: remove dead code from HtmlWriter and subtypes
jjg
parents: 14265
diff changeset
   246
        writer.close();
69453558960d 8000673: remove dead code from HtmlWriter and subtypes
jjg
parents: 14265
diff changeset
   247
    }
69453558960d 8000673: remove dead code from HtmlWriter and subtypes
jjg
parents: 14265
diff changeset
   248
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   249
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   250
     * Get the configuration string as a content.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   251
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   252
     * @param key the key to look for in the configuration file
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   253
     * @return a content tree for the text
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
    public Content getResource(String key) {
17563
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 17560
diff changeset
   256
        return configuration.getResource(key);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   257
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   258
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   259
    /**
19907
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   260
     * Get the configuration string as a content, replacing spaces
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   261
     * with non-breaking spaces.
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   262
     *
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   263
     * @param key the key to look for in the configuration file
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   264
     * @return a content tree for the text
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   265
     */
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   266
    public Content getNonBreakResource(String key) {
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   267
        String text = configuration.getText(key);
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   268
        Content c = configuration.newContent();
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   269
        int start = 0;
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   270
        int p;
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   271
        while ((p = text.indexOf(" ", start)) != -1) {
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   272
            c.addContent(text.substring(start, p));
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   273
            c.addContent(RawHtml.nbsp);
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   274
            start = p + 1;
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   275
        }
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   276
        c.addContent(text.substring(start));
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   277
        return c;
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   278
    }
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   279
41ae54351dea 8023700: Use non breaking space in various labels
jjg
parents: 18404
diff changeset
   280
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   281
     * Get the configuration string as a content.
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
     * @param key the key to look for in the configuration file
17563
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 17560
diff changeset
   284
     * @param o   string or content argument added to configuration text
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   285
     * @return a content tree for the text
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   286
     */
17563
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 17560
diff changeset
   287
    public Content getResource(String key, Object o) {
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 17560
diff changeset
   288
        return configuration.getResource(key, o);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   289
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   290
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   291
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   292
     * Get the configuration string as a content.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   293
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   294
     * @param key the key to look for in the configuration file
17563
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 17560
diff changeset
   295
     * @param o1  string or content argument added to configuration text
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 17560
diff changeset
   296
     * @param o2  string or content argument added to configuration text
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   297
     * @return a content tree for the text
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   298
     */
17563
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 17560
diff changeset
   299
    public Content getResource(String key, Object o0, Object o1) {
e8ddeb9bd17c 8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents: 17560
diff changeset
   300
        return configuration.getResource(key, o0, o1);
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
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   304
     * Returns an HtmlTree for the SCRIPT tag.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   305
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   306
     * @return an HtmlTree for the SCRIPT tag
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   307
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   308
    protected HtmlTree getWinTitleScript(){
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 29429
diff changeset
   309
        HtmlTree script = HtmlTree.SCRIPT();
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   310
        if(winTitle != null && winTitle.length() > 0) {
7641
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   311
            String scriptCode = "<!--" + DocletConstants.NL +
20614
994200acf1e4 8024756: method grouping tabs are not selectable
bpatel
parents: 20257
diff changeset
   312
                    "    try {" + DocletConstants.NL +
994200acf1e4 8024756: method grouping tabs are not selectable
bpatel
parents: 20257
diff changeset
   313
                    "        if (location.href.indexOf('is-external=true') == -1) {" + DocletConstants.NL +
21036
chegar
parents: 20614 21035
diff changeset
   314
                    "            parent.document.title=\"" + escapeJavaScriptChars(winTitle) + "\";" + DocletConstants.NL +
20614
994200acf1e4 8024756: method grouping tabs are not selectable
bpatel
parents: 20257
diff changeset
   315
                    "        }" + DocletConstants.NL +
994200acf1e4 8024756: method grouping tabs are not selectable
bpatel
parents: 20257
diff changeset
   316
                    "    }" + DocletConstants.NL +
994200acf1e4 8024756: method grouping tabs are not selectable
bpatel
parents: 20257
diff changeset
   317
                    "    catch(err) {" + DocletConstants.NL +
7641
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   318
                    "    }" + DocletConstants.NL +
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   319
                    "//-->" + DocletConstants.NL;
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   320
            RawHtml scriptContent = new RawHtml(scriptCode);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   321
            script.addContent(scriptContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   322
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   323
        return script;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   324
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   325
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   326
    /**
21026
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   327
     * Returns a String with escaped special JavaScript characters.
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   328
     *
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   329
     * @param s String that needs to be escaped
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   330
     * @return a valid escaped JavaScript string
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   331
     */
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   332
    private static String escapeJavaScriptChars(String s) {
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   333
        StringBuilder sb = new StringBuilder();
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   334
        for (int i = 0; i < s.length(); i++) {
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   335
            char ch = s.charAt(i);
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   336
            switch (ch) {
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   337
                case '\b':
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   338
                    sb.append("\\b");
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   339
                    break;
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   340
                case '\t':
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   341
                    sb.append("\\t");
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   342
                    break;
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   343
                case '\n':
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   344
                    sb.append("\\n");
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   345
                    break;
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   346
                case '\f':
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   347
                    sb.append("\\f");
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   348
                    break;
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   349
                case '\r':
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   350
                    sb.append("\\r");
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   351
                    break;
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   352
                case '"':
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   353
                    sb.append("\\\"");
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   354
                    break;
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   355
                case '\'':
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   356
                    sb.append("\\\'");
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   357
                    break;
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   358
                case '\\':
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   359
                    sb.append("\\\\");
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   360
                    break;
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   361
                default:
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   362
                    if (ch < 32 || ch >= 127) {
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   363
                        sb.append(String.format("\\u%04X", (int)ch));
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   364
                    } else {
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   365
                        sb.append(ch);
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   366
                    }
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   367
                    break;
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   368
            }
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   369
        }
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   370
        return sb.toString();
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   371
    }
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   372
b35314edf87a 8016675: Make Javadoc pages more robust
bpatel
parents: 18404
diff changeset
   373
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   374
     * Returns a content tree for the SCRIPT tag for the main page(index.html).
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   375
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   376
     * @return a content for the SCRIPT tag
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   377
     */
29429
964498d4dcec 8074521: Generate iframe instead of frame and frameset for index.html page
bpatel
parents: 25874
diff changeset
   378
    protected Content getFramesJavaScript() {
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 29429
diff changeset
   379
        HtmlTree script = HtmlTree.SCRIPT();
17560
9f6771abbd1a 8011650: reduce use of RawHtml nodes in doclet
jjg
parents: 17559
diff changeset
   380
        String scriptCode = DocletConstants.NL +
9f6771abbd1a 8011650: reduce use of RawHtml nodes in doclet
jjg
parents: 17559
diff changeset
   381
                "    targetPage = \"\" + window.location.search;" + DocletConstants.NL +
7641
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   382
                "    if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL +
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   383
                "        targetPage = targetPage.substring(1);" + DocletConstants.NL +
18398
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   384
                "    if (targetPage.indexOf(\":\") != -1 || (targetPage != \"\" && !validURL(targetPage)))" + DocletConstants.NL +
7641
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   385
                "        targetPage = \"undefined\";" + DocletConstants.NL +
18398
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   386
                "    function validURL(url) {" + DocletConstants.NL +
20257
9da4f6c30089 8016328: Regression : Javadoc i18n regression caused by fix for 8012375
bpatel
parents: 19907
diff changeset
   387
                "        try {" + DocletConstants.NL +
9da4f6c30089 8016328: Regression : Javadoc i18n regression caused by fix for 8012375
bpatel
parents: 19907
diff changeset
   388
                "            url = decodeURIComponent(url);" + DocletConstants.NL +
9da4f6c30089 8016328: Regression : Javadoc i18n regression caused by fix for 8012375
bpatel
parents: 19907
diff changeset
   389
                "        }" + DocletConstants.NL +
9da4f6c30089 8016328: Regression : Javadoc i18n regression caused by fix for 8012375
bpatel
parents: 19907
diff changeset
   390
                "        catch (error) {" + DocletConstants.NL +
9da4f6c30089 8016328: Regression : Javadoc i18n regression caused by fix for 8012375
bpatel
parents: 19907
diff changeset
   391
                "            return false;" + DocletConstants.NL +
9da4f6c30089 8016328: Regression : Javadoc i18n regression caused by fix for 8012375
bpatel
parents: 19907
diff changeset
   392
                "        }" + DocletConstants.NL +
18404
a5aaa0341fec 8015997: Additional improvement in Javadoc framing
bpatel
parents: 18402
diff changeset
   393
                "        var pos = url.indexOf(\".html\");" + DocletConstants.NL +
a5aaa0341fec 8015997: Additional improvement in Javadoc framing
bpatel
parents: 18402
diff changeset
   394
                "        if (pos == -1 || pos != url.length - 5)" + DocletConstants.NL +
18398
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   395
                "            return false;" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   396
                "        var allowNumber = false;" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   397
                "        var allowSep = false;" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   398
                "        var seenDot = false;" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   399
                "        for (var i = 0; i < url.length - 5; i++) {" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   400
                "            var ch = url.charAt(i);" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   401
                "            if ('a' <= ch && ch <= 'z' ||" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   402
                "                    'A' <= ch && ch <= 'Z' ||" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   403
                "                    ch == '$' ||" + DocletConstants.NL +
20257
9da4f6c30089 8016328: Regression : Javadoc i18n regression caused by fix for 8012375
bpatel
parents: 19907
diff changeset
   404
                "                    ch == '_' ||" + DocletConstants.NL +
9da4f6c30089 8016328: Regression : Javadoc i18n regression caused by fix for 8012375
bpatel
parents: 19907
diff changeset
   405
                "                    ch.charCodeAt(0) > 127) {" + DocletConstants.NL +
18398
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   406
                "                allowNumber = true;" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   407
                "                allowSep = true;" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   408
                "            } else if ('0' <= ch && ch <= '9'" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   409
                "                    || ch == '-') {" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   410
                "                if (!allowNumber)" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   411
                "                     return false;" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   412
                "            } else if (ch == '/' || ch == '.') {" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   413
                "                if (!allowSep)" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   414
                "                    return false;" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   415
                "                allowNumber = false;" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   416
                "                allowSep = false;" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   417
                "                if (ch == '.')" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   418
                "                     seenDot = true;" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   419
                "                if (ch == '/' && seenDot)" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   420
                "                     return false;" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   421
                "            } else {" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   422
                "                return false;"+ DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   423
                "            }" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   424
                "        }" + DocletConstants.NL +
1935600c6f34 8012375: Improve Javadoc framing
bpatel
parents: 16319
diff changeset
   425
                "        return true;" + DocletConstants.NL +
7641
8b552db25f99 7006270: Several javadoc regression tests are failing on windows
bpatel
parents: 7614
diff changeset
   426
                "    }" + DocletConstants.NL;
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   427
        RawHtml scriptContent = new RawHtml(scriptCode);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   428
        script.addContent(scriptContent);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   429
        return script;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   430
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   431
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
     * Returns an HtmlTree for the BODY tag.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   434
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   435
     * @param includeScript  set true if printing windowtitle script
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   436
     * @param title title for the window
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   437
     * @return an HtmlTree for the BODY tag
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
    public HtmlTree getBody(boolean includeScript, String title) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   440
        HtmlTree body = new HtmlTree(HtmlTag.BODY);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   441
        // Set window title string which is later printed
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   442
        this.winTitle = title;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   443
        // Don't print windowtitle script for overview-frame, allclasses-frame
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   444
        // and package-frame
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   445
        if (includeScript) {
14549
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   446
            this.script = getWinTitleScript();
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   447
            body.addContent(script);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   448
            Content noScript = HtmlTree.NOSCRIPT(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   449
                    HtmlTree.DIV(getResource("doclet.No_Script_Message")));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   450
            body.addContent(noScript);
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
        return body;
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
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   455
    /**
14549
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   456
     * Generated javascript variables for the document.
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   457
     *
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   458
     * @param typeMap map comprising of method and type relationship
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   459
     * @param methodTypes set comprising of all methods types for this class
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   460
     */
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   461
    public void generateMethodTypesScript(Map<String,Integer> typeMap,
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   462
            Set<MethodTypes> methodTypes) {
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   463
        String sep = "";
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   464
        StringBuilder vars = new StringBuilder("var methods = {");
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   465
        for (Map.Entry<String,Integer> entry : typeMap.entrySet()) {
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   466
            vars.append(sep);
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   467
            sep = ",";
30528
dadaac1f5cc2 8065077: MethodTypes are not localized
bpatel
parents: 29957
diff changeset
   468
            vars.append("\"")
dadaac1f5cc2 8065077: MethodTypes are not localized
bpatel
parents: 29957
diff changeset
   469
                    .append(entry.getKey())
dadaac1f5cc2 8065077: MethodTypes are not localized
bpatel
parents: 29957
diff changeset
   470
                    .append("\":")
dadaac1f5cc2 8065077: MethodTypes are not localized
bpatel
parents: 29957
diff changeset
   471
                    .append(entry.getValue());
14549
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   472
        }
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   473
        vars.append("};").append(DocletConstants.NL);
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   474
        sep = "";
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   475
        vars.append("var tabs = {");
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   476
        for (MethodTypes entry : methodTypes) {
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   477
            vars.append(sep);
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   478
            sep = ",";
30528
dadaac1f5cc2 8065077: MethodTypes are not localized
bpatel
parents: 29957
diff changeset
   479
            vars.append(entry.value())
dadaac1f5cc2 8065077: MethodTypes are not localized
bpatel
parents: 29957
diff changeset
   480
                    .append(":")
dadaac1f5cc2 8065077: MethodTypes are not localized
bpatel
parents: 29957
diff changeset
   481
                    .append("[")
dadaac1f5cc2 8065077: MethodTypes are not localized
bpatel
parents: 29957
diff changeset
   482
                    .append("\"")
dadaac1f5cc2 8065077: MethodTypes are not localized
bpatel
parents: 29957
diff changeset
   483
                    .append(entry.tabId())
dadaac1f5cc2 8065077: MethodTypes are not localized
bpatel
parents: 29957
diff changeset
   484
                    .append("\"")
dadaac1f5cc2 8065077: MethodTypes are not localized
bpatel
parents: 29957
diff changeset
   485
                    .append(sep)
dadaac1f5cc2 8065077: MethodTypes are not localized
bpatel
parents: 29957
diff changeset
   486
                    .append("\"")
dadaac1f5cc2 8065077: MethodTypes are not localized
bpatel
parents: 29957
diff changeset
   487
                    .append(configuration.getText(entry.resourceKey()))
dadaac1f5cc2 8065077: MethodTypes are not localized
bpatel
parents: 29957
diff changeset
   488
                    .append("\"]");
14549
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   489
        }
30528
dadaac1f5cc2 8065077: MethodTypes are not localized
bpatel
parents: 29957
diff changeset
   490
        vars.append("};")
dadaac1f5cc2 8065077: MethodTypes are not localized
bpatel
parents: 29957
diff changeset
   491
                .append(DocletConstants.NL);
14549
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   492
        addStyles(HtmlStyle.altColor, vars);
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   493
        addStyles(HtmlStyle.rowColor, vars);
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   494
        addStyles(HtmlStyle.tableTab, vars);
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   495
        addStyles(HtmlStyle.activeTableTab, vars);
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   496
        script.addContent(new RawHtml(vars.toString()));
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   497
    }
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   498
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   499
    /**
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   500
     * Adds javascript style variables to the document.
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   501
     *
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   502
     * @param style style to be added as a javascript variable
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   503
     * @param vars variable string to which the style variable will be added
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   504
     */
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   505
    public void addStyles(HtmlStyle style, StringBuilder vars) {
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   506
        vars.append("var ").append(style).append(" = \"").append(style)
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   507
                .append("\";").append(DocletConstants.NL);
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   508
    }
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   509
0599d73bf1da 8002304: Group methods by types in methods summary section
bpatel
parents: 14368
diff changeset
   510
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   511
     * Returns an HtmlTree for the TITLE tag.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   512
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   513
     * @return an HtmlTree for the TITLE tag
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   514
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   515
    public HtmlTree getTitle() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   516
        HtmlTree title = HtmlTree.TITLE(new StringContent(winTitle));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   517
        return title;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   518
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   519
06bc494ca11e Initial load
duke
parents:
diff changeset
   520
    public String codeText(String text) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   521
        return "<code>" + text + "</code>";
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   522
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   523
06bc494ca11e Initial load
duke
parents:
diff changeset
   524
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   525
     * Return "&#38;nbsp;", non-breaking space.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   526
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   527
    public Content getSpace() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   528
        return RawHtml.nbsp;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   529
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   530
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
   531
    /*
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
   532
     * Returns a header for Modifier and Type column of a table.
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
   533
     */
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
   534
    public String getModifierTypeHeader() {
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
   535
        return modifierTypeHeader;
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2223
diff changeset
   536
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   537
}