From: aclement Date: Wed, 7 Apr 2004 16:04:02 +0000 (+0000) Subject: Fix broken links in ajdoc. Part 3 : fix links to members of types X-Git-Tag: Root_ajdt_support~34 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=172f6f9edc3f295616e41196bfe36fcb653b61c7;p=aspectj.git Fix broken links in ajdoc. Part 3 : fix links to members of types in other packages (again). Also, fix for nested types. --- diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java b/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java index 0c3bca6b3..8c93a10ef 100644 --- a/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java +++ b/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java @@ -475,27 +475,51 @@ class HtmlDecorator { String linkRef = ""; String linkName = rootDir.getAbsolutePath() + "/"; if (currDecl.getKind().isType()) { - linkName = packagePath + currDecl.getName(); - linkRef = - getRelativeComponent(packagePath) - + packagePath - + currDecl.toLabelString() - + ".html"; + linkName = packagePath; + if (currDecl.getParent().getKind().isType()) { + linkName = + linkName + currDecl.getParent().getName() + "."; + } + linkName = linkName + currDecl.getName(); + + linkRef = getRelativeComponent(packagePath) + packagePath; + // XXX: only one level of nested classes + if (currDecl.getParent().getKind().isType()) { + linkRef = + linkRef + currDecl.getParent().getName() + "."; + } + linkRef = linkRef + currDecl.toLabelString() + ".html"; } else { - linkName = packagePath + currDecl.getParent().getName() + "." + currDecl.getName(); - linkRef = currDecl.getParent().getName() + ".html" + "#" + currDecl.toLabelString(); -// linkRef = -// getRelativeComponent(packagePath) -// + packagePath -// + currDecl.getParent().getName() -// + ".html" -// + "#" -// + currDecl.toLabelString(); -// - // XXX: only one level of nested classes - if (currDecl.getParent().getParent().getKind().isType()) { - linkRef = currDecl.getParent().getParent().getName() + "." + linkRef; - } + linkName = packagePath; + if (currDecl.getParent().getParent().getKind().isType()) { + linkName = + linkName + + currDecl.getParent().getParent().getName() + + "."; + } + linkName = + linkName + + currDecl.getParent().getName() + + "." + + currDecl.getName(); + + // Constructing the linkRef string requires a check + // to see if the parent type is actually nested inside + // another type. + linkRef = getRelativeComponent(packagePath) + packagePath; + // XXX: only one level of nested classes + if (currDecl.getParent().getParent().getKind().isType()) { + linkRef = + linkRef + + currDecl.getParent().getParent().getName() + + "."; + } + linkRef = + linkRef + + currDecl.getParent().getName() + + ".html" + + "#" + + currDecl.toLabelString(); } if (!addedNames.contains(linkName)) { entry += "