src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexFrameWriter.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -21,20 +21,29 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-package com.sun.tools.doclets.formats.html;
+package jdk.javadoc.internal.doclets.formats.html;
import java.io.IOException;
import java.util.Collection;
-import com.sun.javadoc.*;
-import com.sun.tools.doclets.formats.html.markup.*;
-import com.sun.tools.doclets.internal.toolkit.*;
-import com.sun.tools.doclets.internal.toolkit.util.*;
+import javax.lang.model.element.PackageElement;
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
+import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
+import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
+import jdk.javadoc.internal.doclets.toolkit.Content;
+import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
+import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
+import jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException;
+
+
/**
* Generate the package index for the left-hand frame in the generated output.
* A click on the package name in this frame will update the page in the bottom
* left hand frame with the listing of contents of the clicked package.
*
@@ -77,20 +86,20 @@
}
/**
* {@inheritDoc}
*/
- protected void addPackagesList(Collection<PackageDoc> packages, String text,
+ protected void addPackagesList(Collection<PackageElement> packages, String text,
String tableSummary, Content body) {
Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
packagesLabel);
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
? HtmlTree.MAIN(HtmlStyle.indexContainer, heading)
: HtmlTree.DIV(HtmlStyle.indexContainer, heading);
HtmlTree ul = new HtmlTree(HtmlTag.UL);
ul.setTitle(packagesLabel);
- for (PackageDoc aPackage : packages) {
+ for (PackageElement aPackage : packages) {
// Do not list the package if -nodeprecated option is set and the
// package is marked as deprecated.
if (aPackage != null &&
(!(configuration.nodeprecated && utils.isDeprecated(aPackage)))) {
ul.addContent(getPackage(aPackage));
@@ -101,25 +110,25 @@
}
/**
* Returns each package name as a separate link.
*
- * @param pd PackageDoc
+ * @param pe PackageElement
* @return content for the package link
*/
- protected Content getPackage(PackageDoc pd) {
+ protected Content getPackage(PackageElement pe) {
Content packageLinkContent;
Content packageLabel;
- if (!pd.name().isEmpty()) {
- packageLabel = getPackageLabel(pd.name());
- packageLinkContent = getHyperLink(pathString(pd,
- DocPaths.PACKAGE_FRAME), packageLabel, "",
- "packageFrame");
- } else {
+ if (pe.isUnnamed()) {
packageLabel = new StringContent("<unnamed package>");
packageLinkContent = getHyperLink(DocPaths.PACKAGE_FRAME,
packageLabel, "", "packageFrame");
+ } else {
+ packageLabel = getPackageLabel(pe.getQualifiedName().toString());
+ packageLinkContent = getHyperLink(pathString(pe,
+ DocPaths.PACKAGE_FRAME), packageLabel, "",
+ "packageFrame");
}
Content li = HtmlTree.LI(packageLinkContent);
return li;
}
@@ -153,23 +162,10 @@
protected void addAllClassesLink(Content ul) {
Content linkContent = getHyperLink(DocPaths.ALLCLASSES_FRAME,
allclassesLabel, "", "packageFrame");
Content li = HtmlTree.LI(linkContent);
ul.addContent(li);
- }
-
- /**
- * Adds "All Profiles" link for the top of the left-hand frame page to the
- * documentation tree.
- *
- * @param ul the Content object to which the "All Profiles" link should be added
- */
- protected void addAllProfilesLink(Content ul) {
- Content linkContent = getHyperLink(DocPaths.PROFILE_OVERVIEW_FRAME,
- allprofilesLabel, "", "packageListFrame");
- Content li = HtmlTree.LI(linkContent);
- ul.addContent(li);
}
/**
* {@inheritDoc}
*/