src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java
author bpatel
Thu, 17 May 2018 12:59:53 -0700
changeset 50167 cc705c956798
parent 49551 0d4786e42471
child 52644 43efb4ca6d6c
permissions -rw-r--r--
8196201: Generate pages to list all classes and all packages in javadoc output Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47850
diff changeset
     2
 * Copyright (c) 1998, 2018, 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: 10
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: 10
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: 10
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    26
package jdk.javadoc.internal.doclets.formats.html;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    28
import java.util.ArrayList;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    29
import java.util.Collection;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    30
import java.util.List;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    31
import java.util.ListIterator;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    32
import java.util.Set;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    33
import java.util.TreeSet;
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
    34
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    35
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    36
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    37
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    38
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    39
import jdk.javadoc.internal.doclets.toolkit.Content;
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    40
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    41
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    42
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    43
import jdk.javadoc.internal.doclets.toolkit.util.IndexBuilder;
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 7681
diff changeset
    44
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
 * Generate Separate Index Files for all the member names with Indexing in
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
 * Unicode Order. This will create "index-files" directory in the current or
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
 * destination directory and will generate separate file for each unicode index.
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    51
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    52
 *  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: 14258
diff changeset
    53
 *  This code and its internal interfaces are subject to change or
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    54
 *  deletion without notice.</b>
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    55
 *
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
 * @see java.lang.Character
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
 * @author Atul M Dambalkar
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    58
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
public class SplitIndexWriter extends AbstractIndexWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    62
    private final List<Character> indexElements;
33920
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 29957
diff changeset
    63
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
     * Construct the SplitIndexWriter. Uses path to this file and relative path
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
     * from this file.
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
     *
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    68
     * @param configuration the configuration for this doclet
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
     * @param path       Path to the file which is getting generated.
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
     * @param indexbuilder Unicode based Index from {@link IndexBuilder}
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    71
     * @param elements the collection of characters for which to generate index files
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
     */
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 40587
diff changeset
    73
    public SplitIndexWriter(HtmlConfiguration configuration,
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
    74
                            DocPath path,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    75
                            IndexBuilder indexbuilder,
48756
ce608a09a666 8196027: Remove "Prev" and "Next" links from the javadoc navigation
bpatel
parents: 48654
diff changeset
    76
                            Collection<Character> elements) {
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
    77
        super(configuration, path, indexbuilder);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 33920
diff changeset
    78
        this.indexElements = new ArrayList<>(elements);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
     * Generate separate index files, for each Unicode character, listing all
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
     * the members starting with the particular unicode character.
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
     *
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    85
     * @param configuration the configuration for this doclet
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
     * @param indexbuilder IndexBuilder built by {@link IndexBuilder}
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    87
     * @throws DocFileIOException if there is a problem generating the index files
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
     */
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 40587
diff changeset
    89
    public static void generate(HtmlConfiguration configuration,
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    90
                                IndexBuilder indexbuilder) throws DocFileIOException {
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
    91
        DocPath path = DocPaths.INDEX_FILES;
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    92
        Set<Character> keys = new TreeSet<>(indexbuilder.getIndexMap().keySet());
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    93
        keys.addAll(configuration.tagSearchIndexKeys);
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    94
        ListIterator<Character> li = new ArrayList<>(keys).listIterator();
45907
656a844c382d 8170825: Generated index page has a broken link
bpatel
parents: 45417
diff changeset
    95
        int prev;
656a844c382d 8170825: Generated index page has a broken link
bpatel
parents: 45417
diff changeset
    96
        int next;
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    97
        while (li.hasNext()) {
45907
656a844c382d 8170825: Generated index page has a broken link
bpatel
parents: 45417
diff changeset
    98
            prev = (li.hasPrevious()) ? li.previousIndex() + 1 : -1;
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    99
            Object ch = li.next();
45907
656a844c382d 8170825: Generated index page has a broken link
bpatel
parents: 45417
diff changeset
   100
            next = (li.hasNext()) ? li.nextIndex() + 1 : -1;
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   101
            DocPath filename = DocPaths.indexN(li.nextIndex());
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   102
            SplitIndexWriter indexgen = new SplitIndexWriter(configuration,
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   103
                    path.resolve(filename),
48756
ce608a09a666 8196027: Remove "Prev" and "Next" links from the javadoc navigation
bpatel
parents: 48654
diff changeset
   104
                    indexbuilder, keys);
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   105
            indexgen.generateIndexFile((Character) ch);
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   106
            if (!li.hasNext()) {
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   107
                indexgen.createSearchIndexFiles();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
     * Generate the contents of each index file, with Header, Footer,
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
     * Member Field, Method and Constructor Description.
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
     * @param unicode Unicode character referring to the character for the
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
     * index.
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   118
     * @throws DocFileIOException if there is a problem generating an index file
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   120
    protected void generateIndexFile(Character unicode) throws DocFileIOException {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   121
        String title = configuration.getText("doclet.Window_Split_Index",
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   122
                unicode.toString());
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   123
        HtmlTree body = getBody(true, getWindowTitle(title));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   124
        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   125
                ? HtmlTree.HEADER()
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   126
                : body;
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   127
        addTop(htmlTree);
49551
0d4786e42471 8196200: Implement a navigation builder in javadoc
bpatel
parents: 48756
diff changeset
   128
        navBar.setUserHeader(getUserHeaderFooter(true));
0d4786e42471 8196200: Implement a navigation builder in javadoc
bpatel
parents: 48756
diff changeset
   129
        htmlTree.addContent(navBar.getContent(true));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   130
        if (configuration.allowTag(HtmlTag.HEADER)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   131
            body.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   132
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   133
        HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
47846
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47216
diff changeset
   134
        divTree.setStyle(HtmlStyle.contentContainer);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   135
        addLinksForIndexes(divTree);
33920
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 29957
diff changeset
   136
        if (configuration.tagSearchIndexMap.get(unicode) == null) {
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 29957
diff changeset
   137
            addContents(unicode, indexbuilder.getMemberList(unicode), divTree);
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 29957
diff changeset
   138
        } else if (indexbuilder.getMemberList(unicode) == null) {
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 29957
diff changeset
   139
            addSearchContents(unicode, configuration.tagSearchIndexMap.get(unicode), divTree);
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 29957
diff changeset
   140
        } else {
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 29957
diff changeset
   141
            addContents(unicode, indexbuilder.getMemberList(unicode),
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 29957
diff changeset
   142
                    configuration.tagSearchIndexMap.get(unicode), divTree);
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 29957
diff changeset
   143
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   144
        addLinksForIndexes(divTree);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   145
        body.addContent((configuration.allowTag(HtmlTag.MAIN)) ? HtmlTree.MAIN(divTree) : divTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   146
        if (configuration.allowTag(HtmlTag.FOOTER)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   147
            htmlTree = HtmlTree.FOOTER();
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   148
        }
49551
0d4786e42471 8196200: Implement a navigation builder in javadoc
bpatel
parents: 48756
diff changeset
   149
        navBar.setUserFooter(getUserHeaderFooter(false));
0d4786e42471 8196200: Implement a navigation builder in javadoc
bpatel
parents: 48756
diff changeset
   150
        htmlTree.addContent(navBar.getContent(false));
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   151
        addBottom(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   152
        if (configuration.allowTag(HtmlTag.FOOTER)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   153
            body.addContent(htmlTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   154
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   155
        printHtmlDocument(null, true, body);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   159
     * Add links for all the Index Files per unicode character.
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
     * @param contentTree the content tree to which the links for indexes will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   163
    protected void addLinksForIndexes(Content contentTree) {
33920
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 29957
diff changeset
   164
        for (int i = 0; i < indexElements.size(); i++) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
            int j = i + 1;
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47850
diff changeset
   166
            contentTree.addContent(links.createLink(DocPaths.indexN(j),
33920
bd731341c405 8141492: Implement search feature in javadoc
bpatel
parents: 29957
diff changeset
   167
                    new StringContent(indexElements.get(i).toString())));
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   168
            contentTree.addContent(Contents.SPACE);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
        }
50167
cc705c956798 8196201: Generate pages to list all classes and all packages in javadoc output
bpatel
parents: 49551
diff changeset
   170
        contentTree.addContent(new HtmlTree(HtmlTag.BR));
cc705c956798 8196201: Generate pages to list all classes and all packages in javadoc output
bpatel
parents: 49551
diff changeset
   171
        contentTree.addContent(links.createLink(pathToRoot.resolve(DocPaths.ALLCLASSES_INDEX),
cc705c956798 8196201: Generate pages to list all classes and all packages in javadoc output
bpatel
parents: 49551
diff changeset
   172
                contents.allClassesLabel));
cc705c956798 8196201: Generate pages to list all classes and all packages in javadoc output
bpatel
parents: 49551
diff changeset
   173
        if (!configuration.packages.isEmpty()) {
cc705c956798 8196201: Generate pages to list all classes and all packages in javadoc output
bpatel
parents: 49551
diff changeset
   174
            contentTree.addContent(Contents.SPACE);
cc705c956798 8196201: Generate pages to list all classes and all packages in javadoc output
bpatel
parents: 49551
diff changeset
   175
            contentTree.addContent(links.createLink(pathToRoot.resolve(DocPaths.ALLPACKAGES_INDEX),
cc705c956798 8196201: Generate pages to list all classes and all packages in javadoc output
bpatel
parents: 49551
diff changeset
   176
                    contents.allPackagesLabel));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
}
50167
cc705c956798 8196201: Generate pages to list all classes and all packages in javadoc output
bpatel
parents: 49551
diff changeset
   179
}