From d3f22340b84c9254f7893e71fedb40ac7467abf9 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 14 Apr 2004 16:02:15 +0000 Subject: Georges fix for relative paths in ajdoc. Means we support multiple browsers and the doc is portable. --- ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'ajdoc') diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java b/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java index e680bdd0a..655eb4aca 100644 --- a/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java +++ b/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java @@ -431,6 +431,10 @@ class HtmlDecorator { = "" + "
 Advised by:"; + String relativePackagePath = + getRelativePathFromHere( + node.getPackageName().replace('.', '/') + Config.DIR_SEP_CHAR); + List addedNames = new ArrayList(); for (Iterator it = targets.iterator(); it.hasNext(); ) { String currHandle = (String)it.next(); @@ -443,8 +447,11 @@ class HtmlDecorator { String hrefName = ""; String hrefLink = ""; - - hrefLink = rootDir.getAbsolutePath() + "/" + packagePath; + + // Start the hRefLink with the relative path based on where + // *this* type (i.e. the advised) is in the package structure. + hrefLink = relativePackagePath + packagePath; + if (currDecl.getPackageName() != null ) { hrefName = currDecl.getPackageName().replace('.', '/'); // hrefLink = "";//+ currDecl.getPackageName() + Config.DIR_SEP_CHAR; @@ -482,6 +489,10 @@ class HtmlDecorator { = "" + "
 Advises:"; + String relativePackagePath = + getRelativePathFromHere( + decl.getPackageName().replace('.', '/') + Config.DIR_SEP_CHAR); + List addedNames = new ArrayList(); // for ensuring that we don't add duplciates for (Iterator it = targets.iterator(); it.hasNext(); ) { String currHandle = (String)it.next(); @@ -501,9 +512,10 @@ class HtmlDecorator { packagePath + typeSignature; + // Start the hRefLink with the relative path based on where + // *this* type (i.e. the advisor) is in the package structure. String hrefLink = - rootDir.getAbsolutePath() + "/" -// getRelativePathFromHere(packagePath) + relativePackagePath + packagePath + typeSignature + ".html"; -- cgit v1.2.3