diff -r 1e7ad879f15e -r 933ba3f81a87 src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java --- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Thu Oct 10 08:51:55 2013 +0200 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Thu Oct 10 10:51:15 2013 -0700 @@ -509,28 +509,28 @@ body.addContent(HtmlConstants.START_OF_TOP_NAVBAR); navDiv.addStyle(HtmlStyle.topNav); allClassesId += "navbar_top"; - Content a = getMarkerAnchor("navbar_top"); + Content a = getMarkerAnchor(SectionName.NAVBAR_TOP); //WCAG - Hyperlinks should contain text or an image with alt text - for AT tools navDiv.addContent(a); Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav, getHyperLink( - DocLink.fragment("skip-navbar_top"), skipNavLinks, + getDocLink(SectionName.SKIP_NAVBAR_TOP), skipNavLinks, skipNavLinks.toString(), "")); navDiv.addContent(skipLinkContent); } else { body.addContent(HtmlConstants.START_OF_BOTTOM_NAVBAR); navDiv.addStyle(HtmlStyle.bottomNav); allClassesId += "navbar_bottom"; - Content a = getMarkerAnchor("navbar_bottom"); + Content a = getMarkerAnchor(SectionName.NAVBAR_BOTTOM); navDiv.addContent(a); Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav, getHyperLink( - DocLink.fragment("skip-navbar_bottom"), skipNavLinks, + getDocLink(SectionName.SKIP_NAVBAR_BOTTOM), skipNavLinks, skipNavLinks.toString(), "")); navDiv.addContent(skipLinkContent); } if (header) { - navDiv.addContent(getMarkerAnchor("navbar_top_firstrow")); + navDiv.addContent(getMarkerAnchor(SectionName.NAVBAR_TOP_FIRSTROW)); } else { - navDiv.addContent(getMarkerAnchor("navbar_bottom_firstrow")); + navDiv.addContent(getMarkerAnchor(SectionName.NAVBAR_BOTTOM_FIRSTROW)); } HtmlTree navList = new HtmlTree(HtmlTag.UL); navList.addStyle(HtmlStyle.navList); @@ -577,11 +577,11 @@ subDiv.addContent(getAllClassesLinkScript(allClassesId.toString())); addSummaryDetailLinks(subDiv); if (header) { - subDiv.addContent(getMarkerAnchor("skip-navbar_top")); + subDiv.addContent(getMarkerAnchor(SectionName.SKIP_NAVBAR_TOP)); body.addContent(subDiv); body.addContent(HtmlConstants.END_OF_TOP_NAVBAR); } else { - subDiv.addContent(getMarkerAnchor("skip-navbar_bottom")); + subDiv.addContent(getMarkerAnchor(SectionName.SKIP_NAVBAR_BOTTOM)); body.addContent(subDiv); body.addContent(HtmlConstants.END_OF_BOTTOM_NAVBAR); } @@ -886,7 +886,28 @@ * @return a content tree for the marker anchor */ public Content getMarkerAnchor(String anchorName) { - return getMarkerAnchor(anchorName, null); + return getMarkerAnchor(getName(anchorName), null); + } + + /** + * Get the marker anchor which will be added to the documentation tree. + * + * @param sectionName the section name anchor attribute for page + * @return a content tree for the marker anchor + */ + public Content getMarkerAnchor(SectionName sectionName) { + return getMarkerAnchor(sectionName.getName(), null); + } + + /** + * Get the marker anchor which will be added to the documentation tree. + * + * @param sectionName the section name anchor attribute for page + * @param anchorName the anchor name combined with section name attribute for the page + * @return a content tree for the marker anchor + */ + public Content getMarkerAnchor(SectionName sectionName, String anchorName) { + return getMarkerAnchor(sectionName.getName() + getName(anchorName), null); } /** @@ -1291,10 +1312,10 @@ } else if (doc instanceof ExecutableMemberDoc) { ExecutableMemberDoc emd = (ExecutableMemberDoc)doc; return getLink(new LinkInfoImpl(configuration, context, classDoc) - .label(label).where(getAnchor(emd, isProperty)).strong(strong)); + .label(label).where(getName(getAnchor(emd, isProperty))).strong(strong)); } else if (doc instanceof MemberDoc) { return getLink(new LinkInfoImpl(configuration, context, classDoc) - .label(label).where(doc.name()).strong(strong)); + .label(label).where(getName(doc.name())).strong(strong)); } else { return label; } @@ -1319,10 +1340,10 @@ } else if (doc instanceof ExecutableMemberDoc) { ExecutableMemberDoc emd = (ExecutableMemberDoc) doc; return getLink(new LinkInfoImpl(configuration, context, classDoc) - .label(label).where(getAnchor(emd))); + .label(label).where(getName(getAnchor(emd)))); } else if (doc instanceof MemberDoc) { return getLink(new LinkInfoImpl(configuration, context, classDoc) - .label(label).where(doc.name())); + .label(label).where(getName(doc.name()))); } else { return label; }