import org.aspectj.asm.LinkNode;
import org.aspectj.asm.ProgramElementNode;
import org.aspectj.asm.StructureNode;
+import org.aspectj.bridge.ISourceLocation;
/**
* Responsible for displaying and controlling the configuration and output of a
} else {
currNode = (ProgramElementNode)structureNode;
}
- Ajde.getDefault().getEditorManager().addViewForSourceLine(currNode.getSourceLocation().getSourceFile().getAbsolutePath(),
- currNode.getSourceLocation().getLine());
+ ISourceLocation sourceLoc = currNode.getSourceLocation();
+ if (null != sourceLoc) {
+ Ajde.getDefault().getEditorManager().addViewForSourceLine(
+ sourceLoc.getSourceFile().getAbsolutePath(),
+ sourceLoc.getLine());
+ }
}
}
import org.aspectj.asm.RelationNode;
import org.aspectj.asm.StructureNode;
import org.aspectj.bridge.IMessage;
+import org.aspectj.bridge.ISourceLocation;
/**
* @author Mik Kersten
StructureNode node = viewNode.getStructureNode();
if (node instanceof LinkNode) {
- if (((LinkNode)node).getProgramElementNode().getSourceLocation().getSourceFile().getAbsolutePath() == null) {
- setTextNonSelectionColor(AjdeWidgetStyles.LINK_NODE_NO_SOURCE_COLOR);
- } else {
+ ISourceLocation sourceLoc = ((LinkNode)node).getProgramElementNode().getSourceLocation();
+ if ((null != sourceLoc)
+ && (null != sourceLoc.getSourceFile().getAbsolutePath())) {
setTextNonSelectionColor(AjdeWidgetStyles.LINK_NODE_COLOR);
+ } else {
+ setTextNonSelectionColor(AjdeWidgetStyles.LINK_NODE_NO_SOURCE_COLOR);
}
} else {
setTextNonSelectionColor(new Color(0, 0, 0));
import java.util.*;
import java.io.*;
-import org.aspectj.asm.*;
+
+import org.aspectj.bridge.ISourceLocation;
/**
* @author Mik Kersten
ProgramElementNode peNode = (ProgramElementNode)it.next();
List entries = new ArrayList();
entries.add(peNode);
- Integer hash = new Integer(peNode.getSourceLocation().getLine());
- List existingEntry = (List)annotations.get(hash);
- if (existingEntry != null) {
- entries.addAll(existingEntry);
+ ISourceLocation sourceLoc = peNode.getSourceLocation();
+ if (null != sourceLoc) {
+ Integer hash = new Integer(sourceLoc.getLine());
+ List existingEntry = (List)annotations.get(hash);
+ if (existingEntry != null) {
+ entries.addAll(existingEntry);
+ }
+ annotations.put(hash, entries);
}
- annotations.put(hash, entries);
}
return annotations;
}