summaryrefslogtreecommitdiffstats
path: root/ajdoc/src
diff options
context:
space:
mode:
authormkersten <mkersten>2004-03-30 17:14:39 +0000
committermkersten <mkersten>2004-03-30 17:14:39 +0000
commitf716a6fbdd5c9977dc6faae8f40d94f4717c269e (patch)
tree42130b808005446fa9afe5cb434787cec04fe9c0 /ajdoc/src
parentf114f42d16a86d034960f9bc2107bdd093c1d29e (diff)
downloadaspectj-f716a6fbdd5c9977dc6faae8f40d94f4717c269e.tar.gz
aspectj-f716a6fbdd5c9977dc6faae8f40d94f4717c269e.zip
Improved link layout and removed generation of duplicates.
Diffstat (limited to 'ajdoc/src')
-rw-r--r--ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java34
-rw-r--r--ajdoc/src/org/aspectj/tools/ajdoc/Main.java10
2 files changed, 25 insertions, 19 deletions
diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java b/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java
index 26eb12728..7517f4f4e 100644
--- a/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java
+++ b/ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java
@@ -417,8 +417,9 @@ class HtmlDecorator {
String adviceDoc
= "<TABLE WIDTH=\"100%\" BGCOLOR=#FFFFFF><TR>" +
- "<TD width=\"15%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000>&nbsp;Advised by:</font></b></td><td>";
+ "<TD width=\"15%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000>&nbsp;Advised&nbsp;by:</font></b></td><td>";
+ List addedNames = new ArrayList();
for (Iterator it = targets.iterator(); it.hasNext(); ) {
String currHandle = (String)it.next();
IProgramElement currDecl = AsmManager.getDefault().getHierarchy().findElementForHandle(currHandle);
@@ -436,11 +437,14 @@ class HtmlDecorator {
hrefLink += currDecl.getParent().toLinkLabelString() + ".html"
+ "#" + currDecl.toLabelString();
- adviceDoc = adviceDoc +
- "<A HREF=\"" + hrefLink + "\"><tt>"
- + hrefName.replace('/', '.') + "</tt></A>";
-
- if (it.hasNext()) adviceDoc += ", ";
+ if (!addedNames.contains(hrefName)) {
+ adviceDoc = adviceDoc +
+ "<A HREF=\"" + hrefLink + "\"><tt>"
+ + hrefName.replace('/', '.') + "</tt></A>";
+
+ if (it.hasNext()) adviceDoc += ", ";
+ addedNames.add(hrefName);
+ }
}
adviceDoc += "</TR></TD></TABLE>\n";
fileContentsBuffer.insert( index, adviceDoc );
@@ -459,6 +463,7 @@ class HtmlDecorator {
= "<TABLE WIDTH=\"100%\" BGCOLOR=#FFFFFF><TR>" +
"<TD width=\"10%\" bgcolor=\"#FFD8B0\"><B><FONT COLOR=000000>&nbsp;Advises:</b></font></td><td>";
+ List addedNames = new ArrayList(); // for ensuring that we don't add duplciates
for (Iterator it = targets.iterator(); it.hasNext(); ) {
String currHandle = (String)it.next();
IProgramElement currDecl = AsmManager.getDefault().getHierarchy().findElementForHandle(currHandle);
@@ -485,16 +490,13 @@ class HtmlDecorator {
linkRef = currDecl.getParent().getParent().getName() + "." + linkRef;
}
}
- entry += "<A HREF=\"" + linkRef +
- "\"><tt>" + linkName.replace('/', '.') + "</tt></A>"; // !!! don't replace
- if (it.hasNext()) entry += ", ";
-// if ( isIntroduction ) {
-// if ( !addedDecls.contains(currDecl.getSourceSignature() ) ) {
-// //addedDecls.add(currDecl.getPackageName() + "." + currDecl.getSignature());
-// addedDecls.add(packageName + currDecl.getSourceSignature());
-// }
-// }
- }
+ if (!addedNames.contains(linkName)) {
+ entry += "<A HREF=\"" + linkRef +
+ "\"><tt>" + linkName.replace('/', '.') + "</tt></A>"; // !!! don't replace
+ if (it.hasNext()) entry += ", ";
+ addedNames.add(linkName);
+ }
+ }
}
entry += "</B></FONT></TD></TR></TABLE>\n</TR></TD>\n";
return entry;
diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/Main.java b/ajdoc/src/org/aspectj/tools/ajdoc/Main.java
index 0e8b3f06d..22d875ea5 100644
--- a/ajdoc/src/org/aspectj/tools/ajdoc/Main.java
+++ b/ajdoc/src/org/aspectj/tools/ajdoc/Main.java
@@ -80,10 +80,12 @@ public class Main implements Config {
public static void main(String[] args) {
aborted = false;
-
+
+// System.err.println("> command invoked: " + Arrays.asList(args).toString());
+
// STEP 1: parse the command line and do other global setup
sourcepath.addElement("."); // add the current directory to the classapth
- parseCommandLine(args);
+ parseCommandLine(args);
rootDir = getRootDir();
symbolManager = SymbolManager.getDefault();
File[] inputFiles = new File[filenames.size()];
@@ -361,6 +363,8 @@ public class Main implements Config {
static void parseCommandLine(String[] args) {
if (args.length == 0) {
displayHelpAndExit( null );
+ } else if (args.length == 1 && args[0].startsWith("@")) {
+ System.err.println("!!!!!!!!");
}
List vargs = new LinkedList(Arrays.asList(args));
@@ -553,7 +557,7 @@ public class Main implements Config {
else {
// didn't find it on that element of the classpath but that's ok
}
- }
+ }
}
}
}