changeset 3500:f8aebd55b8f5

8150000: Javadoc omits package listing for type Reviewed-by: jjg
author ksrini
date Sat, 05 Mar 2016 07:53:12 -0800
parents e90d9efcb13f
children f5991c73ed73
files src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css test/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java
diffstat 4 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java	Thu Mar 03 14:54:44 2016 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java	Sat Mar 05 07:53:12 2016 -0800
@@ -196,8 +196,12 @@
         div.addStyle(HtmlStyle.header);
         PackageElement pkg = utils.containingPackage(typeElement);
         if (!pkg.isUnnamed()) {
-            Content pkgNameContent = new StringContent(utils.getPackageName(pkg));
-            Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent);
+            Content classPackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInClass, packageLabel);
+            Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classPackageLabel);
+            pkgNameDiv.addContent(getSpace());
+            Content pkgNameContent = getPackageLink(pkg,
+                    new StringContent(pkg.getQualifiedName().toString()));
+            pkgNameDiv.addContent(pkgNameContent);
             div.addContent(pkgNameDiv);
         }
         LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java	Thu Mar 03 14:54:44 2016 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java	Sat Mar 05 07:53:12 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -84,6 +84,7 @@
     overrideSpecifyLabel,
     overviewSummary,
     packageHierarchyLabel,
+    packageLabelInClass,
     paramLabel,
     returnLabel,
     rightContainer,
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css	Thu Mar 03 14:54:44 2016 -0800
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css	Sat Mar 05 07:53:12 2016 -0800
@@ -610,8 +610,9 @@
     color:#474747;
 }
 .deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink,
-.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel,
-.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink, .searchTagLink {
+.overrideSpecifyLabel, .packageLabelInClass, .packageHierarchyLabel,
+.paramLabel, .returnLabel, .seeLabel, .simpleTagLabel, .throwsLabel,
+.typeNameLabel, .typeNameLink, .searchTagLink {
     font-weight:bold;
 }
 .deprecationComment, .emphasizedPhrase, .interfaceName {
--- a/test/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java	Thu Mar 03 14:54:44 2016 -0800
+++ b/test/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java	Sat Mar 05 07:53:12 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 7010342
+ * @bug 7010342 8150000
  * @summary Test for correct sub title generation.
  * @author Bhavesh Patel
  * @library ../lib
@@ -50,7 +50,8 @@
             "<div class=\"block\">This is the description of package pkg.</div>");
 
         checkOutput("pkg/C.html", true,
-            "<div class=\"subTitle\">pkg</div>");
+                "<div class=\"subTitle\"><span class=\"packageLabelInClass\">" +
+                "Package</span>&nbsp;<a href=\"../pkg/package-summary.html\">pkg</a></div>");
 
         checkOutput("pkg/package-summary.html", false,
             "<p class=\"subTitle\">\n" +