summaryrefslogtreecommitdiffstats
path: root/ajdoc/src
diff options
context:
space:
mode:
authoraclement <aclement>2004-04-07 16:04:02 +0000
committeraclement <aclement>2004-04-07 16:04:02 +0000
commit172f6f9edc3f295616e41196bfe36fcb653b61c7 (patch)
treef848a27500b90c56cc67f2d9773a99bcfba12c51 /ajdoc/src
parentc79fff2d91096ce21215f4617675f1a693f682f8 (diff)
downloadaspectj-172f6f9edc3f295616e41196bfe36fcb653b61c7.tar.gz
aspectj-172f6f9edc3f295616e41196bfe36fcb653b61c7.zip
Fix broken links in ajdoc. Part 3 : fix links to members of types
in other packages (again). Also, fix for nested types.
Diffstat (limited to 'ajdoc/src')
-rw-r--r--ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java66
1 files changed, 45 insertions, 21 deletions
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 += "<A HREF=\"" + linkRef +
@@ -519,7 +543,7 @@ class HtmlDecorator {
*/
private static String getRelativeComponent(String packagePath) {
StringBuffer result = new StringBuffer("");
- if (packagePath != null) {
+ if (packagePath != null && (packagePath.indexOf("/") != -1)) {
StringTokenizer sTok = new StringTokenizer(packagePath, "/", false);
while (sTok.hasMoreTokens()) {
sTok.nextToken(); // don't care about the token value