langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfileWriterImpl.java
author ksrini
Sun, 15 Jun 2014 08:41:57 -0700
changeset 25454 376a52c9540c
parent 21478 fa4c7cda1b41
permissions -rw-r--r--
8039028: [javadoc] refactor the usage of Util.java Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
     1
/*
25454
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 21478
diff changeset
     2
 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
     4
 *
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    10
 *
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    15
 * accompanied this code).
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    16
 *
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    20
 *
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    23
 * questions.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    24
 */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    25
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    26
package com.sun.tools.doclets.formats.html;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    27
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    28
import java.io.*;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    29
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    30
import com.sun.javadoc.*;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    31
import com.sun.tools.javac.jvm.Profile;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    32
import com.sun.tools.doclets.formats.html.markup.*;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    33
import com.sun.tools.doclets.internal.toolkit.*;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    34
import com.sun.tools.doclets.internal.toolkit.util.*;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    35
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    36
/**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    37
 * Class to generate file for each profile contents in the right-hand
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    38
 * frame. This will list all the packages and Class Kinds in the profile. A click on any
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    39
 * class-kind will update the frame with the clicked class-kind page. A click on any
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    40
 * package will update the frame with the clicked profile package page.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    41
 *
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    42
 *  <p><b>This is NOT part of any supported API.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    43
 *  If you write code that depends on this, you do so at your own risk.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    44
 *  This code and its internal interfaces are subject to change or
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    45
 *  deletion without notice.</b>
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    46
 *
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    47
 * @author Bhavesh Patel
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    48
 */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    49
public class ProfileWriterImpl extends HtmlDocletWriter
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    50
    implements ProfileSummaryWriter {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    51
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    52
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    53
     * The prev profile name in the alpha-order list.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    54
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    55
    protected Profile prevProfile;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    56
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    57
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    58
     * The next profile name in the alpha-order list.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    59
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    60
    protected Profile nextProfile;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    61
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    62
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    63
     * The profile being documented.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    64
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    65
    protected Profile profile;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    66
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    67
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    68
     * Constructor to construct ProfileWriter object and to generate
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    69
     * "profileName-summary.html" file.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    70
     *
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    71
     * @param configuration the configuration of the doclet.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    72
     * @param profile       Profile under consideration.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    73
     * @param prevProfile   Previous profile in the sorted array.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    74
     * @param nextProfile   Next profile in the sorted array.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    75
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    76
    public ProfileWriterImpl(ConfigurationImpl configuration,
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    77
            Profile profile, Profile prevProfile, Profile nextProfile)
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    78
            throws IOException {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    79
        super(configuration, DocPaths.profileSummary(profile.name));
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    80
        this.prevProfile = prevProfile;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    81
        this.nextProfile = nextProfile;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    82
        this.profile = profile;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    83
    }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    84
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    85
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    86
     * {@inheritDoc}
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    87
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    88
    public Content getProfileHeader(String heading) {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    89
        String profileName = profile.name;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    90
        Content bodyTree = getBody(true, getWindowTitle(profileName));
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    91
        addTop(bodyTree);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    92
        addNavLinks(true, bodyTree);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    93
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    94
        div.addStyle(HtmlStyle.header);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    95
        Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    96
                HtmlStyle.title, profileLabel);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    97
        tHeading.addContent(getSpace());
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    98
        Content profileHead = new RawHtml(heading);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
    99
        tHeading.addContent(profileHead);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   100
        div.addContent(tHeading);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   101
        bodyTree.addContent(div);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   102
        return bodyTree;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   103
    }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   104
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   105
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   106
     * {@inheritDoc}
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   107
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   108
    public Content getContentHeader() {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   109
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   110
        div.addStyle(HtmlStyle.contentContainer);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   111
        return div;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   112
    }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   113
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   114
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   115
     * {@inheritDoc}
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   116
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   117
    public Content getSummaryHeader() {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   118
        HtmlTree li = new HtmlTree(HtmlTag.LI);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   119
        li.addStyle(HtmlStyle.blockList);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   120
        return li;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   121
    }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   122
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   123
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   124
     * {@inheritDoc}
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   125
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   126
    public Content getSummaryTree(Content summaryContentTree) {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   127
        HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, summaryContentTree);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   128
        HtmlTree div = HtmlTree.DIV(HtmlStyle.summary, ul);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   129
        return div;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   130
    }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   131
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   132
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   133
     * {@inheritDoc}
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   134
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   135
    public Content getPackageSummaryHeader(PackageDoc pkg) {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   136
        Content pkgName = getTargetProfilePackageLink(pkg,
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   137
                    "classFrame", new StringContent(pkg.name()), profile.name);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   138
        Content heading = HtmlTree.HEADING(HtmlTag.H3, pkgName);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   139
        HtmlTree li = HtmlTree.LI(HtmlStyle.blockList, heading);
19937
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   140
        addPackageDeprecationInfo(li, pkg);
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   141
        return li;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   142
    }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   143
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   144
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   145
     * {@inheritDoc}
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   146
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   147
    public Content getPackageSummaryTree(Content packageSummaryContentTree) {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   148
        HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, packageSummaryContentTree);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   149
        return ul;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   150
    }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   151
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   152
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   153
     * {@inheritDoc}
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   154
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   155
    public void addClassesSummary(ClassDoc[] classes, String label,
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   156
            String tableSummary, String[] tableHeader, Content packageSummaryContentTree) {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   157
        addClassesSummary(classes, label, tableSummary, tableHeader,
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   158
                packageSummaryContentTree, profile.value);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   159
    }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   160
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   161
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   162
     * {@inheritDoc}
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   163
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   164
    public void addProfileFooter(Content contentTree) {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   165
        addNavLinks(false, contentTree);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   166
        addBottom(contentTree);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   167
    }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   168
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   169
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   170
     * {@inheritDoc}
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   171
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   172
    public void printDocument(Content contentTree) throws IOException {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   173
        printHtmlDocument(configuration.metakeywords.getMetaKeywords(profile),
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   174
                true, contentTree);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   175
    }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   176
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   177
    /**
19937
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   178
     * Add the profile package deprecation information to the documentation tree.
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   179
     *
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   180
     * @param li the content tree to which the deprecation information will be added
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   181
     * @param pkg the PackageDoc that is added
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   182
     */
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   183
    public void addPackageDeprecationInfo(Content li, PackageDoc pkg) {
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   184
        Tag[] deprs;
25454
376a52c9540c 8039028: [javadoc] refactor the usage of Util.java
ksrini
parents: 21478
diff changeset
   185
        if (utils.isDeprecated(pkg)) {
19937
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   186
            deprs = pkg.tags("deprecated");
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   187
            HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   188
            deprDiv.addStyle(HtmlStyle.deprecatedContent);
21478
fa4c7cda1b41 8026567: Use meaningful style names for strong and italic styles.
bpatel
parents: 19937
diff changeset
   189
            Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase);
19937
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   190
            deprDiv.addContent(deprPhrase);
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   191
            if (deprs.length > 0) {
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   192
                Tag[] commentTags = deprs[0].inlineTags();
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   193
                if (commentTags.length > 0) {
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   194
                    addInlineDeprecatedComment(pkg, deprs[0], deprDiv);
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   195
                }
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   196
            }
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   197
            li.addContent(deprDiv);
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   198
        }
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   199
    }
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   200
7dacecdfbad4 8015496: Information that package is deprecated is missing in profiles view
bpatel
parents: 15723
diff changeset
   201
    /**
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   202
     * Get "PREV PROFILE" link in the navigation bar.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   203
     *
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   204
     * @return a content tree for the previous link
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   205
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   206
    public Content getNavLinkPrevious() {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   207
        Content li;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   208
        if (prevProfile == null) {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   209
            li = HtmlTree.LI(prevprofileLabel);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   210
        } else {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   211
            li = HtmlTree.LI(getHyperLink(pathToRoot.resolve(DocPaths.profileSummary(
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   212
                    prevProfile.name)), prevprofileLabel, "", ""));
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   213
        }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   214
        return li;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   215
    }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   216
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   217
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   218
     * Get "NEXT PROFILE" link in the navigation bar.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   219
     *
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   220
     * @return a content tree for the next link
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   221
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   222
    public Content getNavLinkNext() {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   223
        Content li;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   224
        if (nextProfile == null) {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   225
            li = HtmlTree.LI(nextprofileLabel);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   226
        } else {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   227
            li = HtmlTree.LI(getHyperLink(pathToRoot.resolve(DocPaths.profileSummary(
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   228
                    nextProfile.name)), nextprofileLabel, "", ""));
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   229
        }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   230
        return li;
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   231
    }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
diff changeset
   232
}