diff -r 87c28ee29329 -r 9f6771abbd1a langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java Tue May 14 10:14:52 2013 -0700 +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java Tue May 14 10:14:52 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, 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 @@ -34,7 +34,6 @@ import com.sun.tools.doclets.internal.toolkit.util.DocFile; import com.sun.tools.doclets.internal.toolkit.util.DocLink; import com.sun.tools.doclets.internal.toolkit.util.DocPath; -import com.sun.tools.doclets.internal.toolkit.util.DocPaths; /** @@ -73,21 +72,18 @@ public abstract Configuration configuration(); /** - * Return Html Hyper Link string. + * Return Html hyperlink string. * * @param link String name of the file. * @param label Tag for the link. - * @param strong Boolean that sets label to strong. * @return String Hyper Link. */ - public String getHyperLinkString(DocPath link, - String label, boolean strong) { - return getHyperLinkString(link, label, strong, "", "", ""); + public String getHyperLinkString(DocPath link, String label) { + return getHyperLinkString(link, label, false, "", "", ""); } - public String getHyperLinkString(DocLink link, - String label, boolean strong) { - return getHyperLinkString(link, label, strong, "", "", ""); + public String getHyperLinkString(DocLink link, String label) { + return getHyperLinkString(link, label, false, "", "", ""); } /** @@ -125,19 +121,17 @@ } /** - * Get Html Hyper Link string. + * Get Html hyperlink. * - * @param link String name of the file. + * @param link path of the file. * @param label Tag for the link. * @return a content tree for the hyper link */ - public Content getHyperLink(DocPath link, - Content label) { + public Content getHyperLink(DocPath link, Content label) { return getHyperLink(link, label, "", ""); } - public Content getHyperLink(DocLink link, - Content label) { + public Content getHyperLink(DocLink link, Content label) { return getHyperLink(link, label, "", ""); } @@ -190,6 +184,28 @@ return retlink.toString(); } + public Content getHyperLink(DocLink link, + Content label, boolean strong, + String stylename, String title, String target) { + Content body = label; + if (strong) { + body = HtmlTree.SPAN(HtmlStyle.strong, body); + } + if (stylename != null && stylename.length() != 0) { + HtmlTree t = new HtmlTree(HtmlTag.FONT, body); + t.addAttr(HtmlAttr.CLASS, stylename); + body = t; + } + HtmlTree l = HtmlTree.A(link.toString(), body); + if (title != null && title.length() != 0) { + l.addAttr(HtmlAttr.TITLE, title); + } + if (target != null && target.length() != 0) { + l.addAttr(HtmlAttr.TARGET, target); + } + return l; + } + /** * Get Html Hyper Link. * @@ -217,17 +233,6 @@ } /** - * Get link string without positioning in the file. - * - * @param link String name of the file. - * @param label Tag for the link. - * @return Strign Hyper link. - */ - public String getHyperLinkString(DocPath link, String label) { - return getHyperLinkString(link, label, false); - } - - /** * Get the name of the package, this class is in. * * @param cd ClassDoc.