From 806b737230fd064080a38157b0bef0a7544a63f7 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 5 Apr 2004 15:00:49 +0000 Subject: Fix broken links in ajdoc. --- .../src/org/aspectj/tools/ajdoc/HtmlDecorator.java | 30 ++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java b/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java index 7517f4f4e..8b85a6761 100644 --- a/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java +++ b/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java @@ -483,7 +483,13 @@ class HtmlDecorator { } 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()) { @@ -502,7 +508,27 @@ class HtmlDecorator { return entry; } - static String generateIntroductionSignatures(IProgramElement decl, boolean isDetails) { + /** + * Generates a relative directory path fragment that can be + * usd to navigate "upwards". + * @param packagePath + * @return String consisting of multiple "../" parts, one for + * each component part of the input packagePath. + */ + private static String getRelativeComponent(String packagePath) { + StringBuffer result = new StringBuffer(""); + if (packagePath != null) { + StringTokenizer sTok = new StringTokenizer(packagePath, "/", false); + while (sTok.hasMoreTokens()) { + sTok.nextToken(); // don't care about the token value + result.append(".." + Config.DIR_SEP_CHAR); + }// end while + }// end if + + return result.toString(); + } + + static String generateIntroductionSignatures(IProgramElement decl, boolean isDetails) { return ""; // Declaration[] decls = decl.getDeclarations(); // String entry = ""; -- cgit v1.2.3