< prev index next >
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
Print this page
*** 153,162 ****
--- 153,164 ----
protected final Resources resources;
protected final Links links;
+ protected final DocPaths docPaths;
+
/**
* To check whether annotation heading is printed or not.
*/
protected boolean printedAnnotationHeading = false;
*** 200,209 ****
--- 202,212 ----
this.links = new Links(path, configuration.htmlVersion);
this.utils = configuration.utils;
this.path = path;
this.pathToRoot = path.parent().invert();
this.filename = path.basename();
+ this.docPaths = configuration.docPaths;
messages.notice("doclet.Generating_0",
DocFile.createFileForOutput(configuration, path).getPath());
}
*** 397,407 ****
* @param mdle the module being documented
* @return a content for the target module link
*/
public Content getTargetModuleLink(String target, Content label, ModuleElement mdle) {
return links.createLink(pathToRoot.resolve(
! DocPaths.moduleSummary(mdle)), label, "", target);
}
/**
* Generates the HTML document tree and prints it out.
*
--- 400,410 ----
* @param mdle the module being documented
* @return a content for the target module link
*/
public Content getTargetModuleLink(String target, Content label, ModuleElement mdle) {
return links.createLink(pathToRoot.resolve(
! docPaths.moduleSummary(mdle)), label, "", target);
}
/**
* Generates the HTML document tree and prints it out.
*
*** 947,957 ****
*
* @param packageElement Package in which the file name is assumed to be.
* @param name File name, to which path string is.
*/
protected DocPath pathString(PackageElement packageElement, DocPath name) {
! return pathToRoot.resolve(DocPath.forPackage(packageElement).resolve(name));
}
/**
* Given a package, return the name to be used in HTML anchor tag.
* @param packageElement the package.
--- 950,960 ----
*
* @param packageElement Package in which the file name is assumed to be.
* @param name File name, to which path string is.
*/
protected DocPath pathString(PackageElement packageElement, DocPath name) {
! return pathToRoot.resolve(docPaths.forPackage(packageElement).resolve(name));
}
/**
* Given a package, return the name to be used in HTML anchor tag.
* @param packageElement the package.
*** 1019,1029 ****
* @return a content for the module link
*/
public Content getModuleLink(ModuleElement mdle, Content label) {
boolean included = utils.isIncluded(mdle);
return (included)
! ? links.createLink(pathToRoot.resolve(DocPaths.moduleSummary(mdle)), label, "", "")
: label;
}
public Content interfaceName(TypeElement typeElement, boolean qual) {
Content name = new StringContent((qual)
--- 1022,1032 ----
* @return a content for the module link
*/
public Content getModuleLink(ModuleElement mdle, Content label) {
boolean included = utils.isIncluded(mdle);
return (included)
! ? links.createLink(pathToRoot.resolve(docPaths.moduleSummary(mdle)), label, "", "")
: label;
}
public Content interfaceName(TypeElement typeElement, boolean qual) {
Content name = new StringContent((qual)
*** 1048,1058 ****
// must be a typeElement since in has no containing class.
te = (TypeElement) typeElement;
}
DocPath href = pathToRoot
.resolve(DocPaths.SOURCE_OUTPUT)
! .resolve(DocPath.forClass(utils, te));
Content linkContent = links.createLink(href
.fragment(SourceToHTMLConverter.getAnchorName(utils, typeElement)), label, "", "");
htmltree.addContent(linkContent);
}
--- 1051,1061 ----
// must be a typeElement since in has no containing class.
te = (TypeElement) typeElement;
}
DocPath href = pathToRoot
.resolve(DocPaths.SOURCE_OUTPUT)
! .resolve(docPaths.forClass(te));
Content linkContent = links.createLink(href
.fragment(SourceToHTMLConverter.getAnchorName(utils, typeElement)), label, "", "");
htmltree.addContent(linkContent);
}
*** 1137,1147 ****
DocPaths.PACKAGE_SUMMARY.getPath());
}
public DocLink getCrossModuleLink(String mdleName) {
return configuration.extern.getExternalLink(mdleName, pathToRoot,
! DocPaths.moduleSummary(mdleName).getPath());
}
/**
* Get the class link.
*
--- 1140,1150 ----
DocPaths.PACKAGE_SUMMARY.getPath());
}
public DocLink getCrossModuleLink(String mdleName) {
return configuration.extern.getExternalLink(mdleName, pathToRoot,
! docPaths.moduleSummary(mdleName).getPath());
}
/**
* Get the class link.
*
*** 1996,2021 ****
}
DocPath redirectPathFromRoot = new SimpleElementVisitor9<DocPath, Void>() {
@Override
public DocPath visitType(TypeElement e, Void p) {
! return DocPath.forPackage(utils.containingPackage(e));
}
@Override
public DocPath visitPackage(PackageElement e, Void p) {
! return DocPath.forPackage(e);
}
@Override
public DocPath visitVariable(VariableElement e, Void p) {
! return DocPath.forPackage(utils.containingPackage(e));
}
@Override
public DocPath visitExecutable(ExecutableElement e, Void p) {
! return DocPath.forPackage(utils.containingPackage(e));
}
@Override
protected DocPath defaultAction(Element e, Void p) {
return null;
--- 1999,2024 ----
}
DocPath redirectPathFromRoot = new SimpleElementVisitor9<DocPath, Void>() {
@Override
public DocPath visitType(TypeElement e, Void p) {
! return docPaths.forPackage(utils.containingPackage(e));
}
@Override
public DocPath visitPackage(PackageElement e, Void p) {
! return docPaths.forPackage(e);
}
@Override
public DocPath visitVariable(VariableElement e, Void p) {
! return docPaths.forPackage(utils.containingPackage(e));
}
@Override
public DocPath visitExecutable(ExecutableElement e, Void p) {
! return docPaths.forPackage(utils.containingPackage(e));
}
@Override
protected DocPath defaultAction(Element e, Void p) {
return null;
< prev index next >