1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Thu Oct 10 08:51:55 2013 +0200 1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Thu Oct 10 10:51:15 2013 -0700 1.3 @@ -509,28 +509,28 @@ 1.4 body.addContent(HtmlConstants.START_OF_TOP_NAVBAR); 1.5 navDiv.addStyle(HtmlStyle.topNav); 1.6 allClassesId += "navbar_top"; 1.7 - Content a = getMarkerAnchor("navbar_top"); 1.8 + Content a = getMarkerAnchor(SectionName.NAVBAR_TOP); 1.9 //WCAG - Hyperlinks should contain text or an image with alt text - for AT tools 1.10 navDiv.addContent(a); 1.11 Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav, getHyperLink( 1.12 - DocLink.fragment("skip-navbar_top"), skipNavLinks, 1.13 + getDocLink(SectionName.SKIP_NAVBAR_TOP), skipNavLinks, 1.14 skipNavLinks.toString(), "")); 1.15 navDiv.addContent(skipLinkContent); 1.16 } else { 1.17 body.addContent(HtmlConstants.START_OF_BOTTOM_NAVBAR); 1.18 navDiv.addStyle(HtmlStyle.bottomNav); 1.19 allClassesId += "navbar_bottom"; 1.20 - Content a = getMarkerAnchor("navbar_bottom"); 1.21 + Content a = getMarkerAnchor(SectionName.NAVBAR_BOTTOM); 1.22 navDiv.addContent(a); 1.23 Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav, getHyperLink( 1.24 - DocLink.fragment("skip-navbar_bottom"), skipNavLinks, 1.25 + getDocLink(SectionName.SKIP_NAVBAR_BOTTOM), skipNavLinks, 1.26 skipNavLinks.toString(), "")); 1.27 navDiv.addContent(skipLinkContent); 1.28 } 1.29 if (header) { 1.30 - navDiv.addContent(getMarkerAnchor("navbar_top_firstrow")); 1.31 + navDiv.addContent(getMarkerAnchor(SectionName.NAVBAR_TOP_FIRSTROW)); 1.32 } else { 1.33 - navDiv.addContent(getMarkerAnchor("navbar_bottom_firstrow")); 1.34 + navDiv.addContent(getMarkerAnchor(SectionName.NAVBAR_BOTTOM_FIRSTROW)); 1.35 } 1.36 HtmlTree navList = new HtmlTree(HtmlTag.UL); 1.37 navList.addStyle(HtmlStyle.navList); 1.38 @@ -577,11 +577,11 @@ 1.39 subDiv.addContent(getAllClassesLinkScript(allClassesId.toString())); 1.40 addSummaryDetailLinks(subDiv); 1.41 if (header) { 1.42 - subDiv.addContent(getMarkerAnchor("skip-navbar_top")); 1.43 + subDiv.addContent(getMarkerAnchor(SectionName.SKIP_NAVBAR_TOP)); 1.44 body.addContent(subDiv); 1.45 body.addContent(HtmlConstants.END_OF_TOP_NAVBAR); 1.46 } else { 1.47 - subDiv.addContent(getMarkerAnchor("skip-navbar_bottom")); 1.48 + subDiv.addContent(getMarkerAnchor(SectionName.SKIP_NAVBAR_BOTTOM)); 1.49 body.addContent(subDiv); 1.50 body.addContent(HtmlConstants.END_OF_BOTTOM_NAVBAR); 1.51 } 1.52 @@ -886,7 +886,28 @@ 1.53 * @return a content tree for the marker anchor 1.54 */ 1.55 public Content getMarkerAnchor(String anchorName) { 1.56 - return getMarkerAnchor(anchorName, null); 1.57 + return getMarkerAnchor(getName(anchorName), null); 1.58 + } 1.59 + 1.60 + /** 1.61 + * Get the marker anchor which will be added to the documentation tree. 1.62 + * 1.63 + * @param sectionName the section name anchor attribute for page 1.64 + * @return a content tree for the marker anchor 1.65 + */ 1.66 + public Content getMarkerAnchor(SectionName sectionName) { 1.67 + return getMarkerAnchor(sectionName.getName(), null); 1.68 + } 1.69 + 1.70 + /** 1.71 + * Get the marker anchor which will be added to the documentation tree. 1.72 + * 1.73 + * @param sectionName the section name anchor attribute for page 1.74 + * @param anchorName the anchor name combined with section name attribute for the page 1.75 + * @return a content tree for the marker anchor 1.76 + */ 1.77 + public Content getMarkerAnchor(SectionName sectionName, String anchorName) { 1.78 + return getMarkerAnchor(sectionName.getName() + getName(anchorName), null); 1.79 } 1.80 1.81 /** 1.82 @@ -1291,10 +1312,10 @@ 1.83 } else if (doc instanceof ExecutableMemberDoc) { 1.84 ExecutableMemberDoc emd = (ExecutableMemberDoc)doc; 1.85 return getLink(new LinkInfoImpl(configuration, context, classDoc) 1.86 - .label(label).where(getAnchor(emd, isProperty)).strong(strong)); 1.87 + .label(label).where(getName(getAnchor(emd, isProperty))).strong(strong)); 1.88 } else if (doc instanceof MemberDoc) { 1.89 return getLink(new LinkInfoImpl(configuration, context, classDoc) 1.90 - .label(label).where(doc.name()).strong(strong)); 1.91 + .label(label).where(getName(doc.name())).strong(strong)); 1.92 } else { 1.93 return label; 1.94 } 1.95 @@ -1319,10 +1340,10 @@ 1.96 } else if (doc instanceof ExecutableMemberDoc) { 1.97 ExecutableMemberDoc emd = (ExecutableMemberDoc) doc; 1.98 return getLink(new LinkInfoImpl(configuration, context, classDoc) 1.99 - .label(label).where(getAnchor(emd))); 1.100 + .label(label).where(getName(getAnchor(emd)))); 1.101 } else if (doc instanceof MemberDoc) { 1.102 return getLink(new LinkInfoImpl(configuration, context, classDoc) 1.103 - .label(label).where(doc.name())); 1.104 + .label(label).where(getName(doc.name()))); 1.105 } else { 1.106 return label; 1.107 }