aboutsummaryrefslogtreecommitdiffstats
path: root/ajde/src
diff options
context:
space:
mode:
authormkersten <mkersten>2003-08-16 08:51:11 +0000
committermkersten <mkersten>2003-08-16 08:51:11 +0000
commit3a495aad88865d64d3e8ee005241e7edbe5a7a82 (patch)
treecdf50cf9c24640170898a00ec11e95b8c539253c /ajde/src
parenteb12f56518d08c54fc17047749a5d2d66b3c4181 (diff)
downloadaspectj-3a495aad88865d64d3e8ee005241e7edbe5a7a82.tar.gz
aspectj-3a495aad88865d64d3e8ee005241e7edbe5a7a82.zip
Fixed AJDT bug with truncation of labels (there was a weird substring call in AdviceActionDelegate). Fixed ASM/AJDT modifiers bug. Fixed ASM static initializers bug (we may want to change the way they show up, i.e. Added imports to ASM containment hierarchy. Fixed numerous AJBrwoser, JBuilder and NetBeans bugs.
Diffstat (limited to 'ajde/src')
-rw-r--r--ajde/src/org/aspectj/ajde/ui/AbstractIconRegistry.java2
-rw-r--r--ajde/src/org/aspectj/ajde/ui/GlobalViewProperties.java2
-rw-r--r--ajde/src/org/aspectj/ajde/ui/StructureViewNodeFactory.java12
-rw-r--r--ajde/src/org/aspectj/ajde/ui/StructureViewProperties.java2
-rw-r--r--ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java15
-rw-r--r--ajde/src/org/aspectj/ajde/ui/swing/StructureTreeManager.java7
-rw-r--r--ajde/src/org/aspectj/ajde/ui/swing/StructureViewPanel.java2
-rw-r--r--ajde/src/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java5
8 files changed, 38 insertions, 9 deletions
diff --git a/ajde/src/org/aspectj/ajde/ui/AbstractIconRegistry.java b/ajde/src/org/aspectj/ajde/ui/AbstractIconRegistry.java
index f73ed7874..ea57729d2 100644
--- a/ajde/src/org/aspectj/ajde/ui/AbstractIconRegistry.java
+++ b/ajde/src/org/aspectj/ajde/ui/AbstractIconRegistry.java
@@ -133,6 +133,8 @@ public abstract class AbstractIconRegistry {
return CODE;
} else if (kind == IProgramElement.Kind.ERROR) {
return ERROR;
+ } else if (kind == IProgramElement.Kind.IMPORT_REFERENCE) {
+ return RELATION_REFERENCE_FORWARD;
} else {
System.err.println("AJDE Message: unresolved icon kind " + kind);
return null;
diff --git a/ajde/src/org/aspectj/ajde/ui/GlobalViewProperties.java b/ajde/src/org/aspectj/ajde/ui/GlobalViewProperties.java
index a6b8ee3e5..fc203fc73 100644
--- a/ajde/src/org/aspectj/ajde/ui/GlobalViewProperties.java
+++ b/ajde/src/org/aspectj/ajde/ui/GlobalViewProperties.java
@@ -19,7 +19,7 @@ package org.aspectj.ajde.ui;
*/
public class GlobalViewProperties extends StructureViewProperties {
- private StructureViewProperties.Granularity granularity = StructureViewProperties.Granularity.MEMBER;
+ private StructureViewProperties.Granularity granularity = StructureViewProperties.Granularity.DECLARED_ELEMENTS;
private StructureViewProperties.Hierarchy hierarchy = StructureViewProperties.Hierarchy.DECLARATION;
public GlobalViewProperties(StructureViewProperties.Hierarchy hierarchy) {
diff --git a/ajde/src/org/aspectj/ajde/ui/StructureViewNodeFactory.java b/ajde/src/org/aspectj/ajde/ui/StructureViewNodeFactory.java
index 828d419ef..4f32eedc7 100644
--- a/ajde/src/org/aspectj/ajde/ui/StructureViewNodeFactory.java
+++ b/ajde/src/org/aspectj/ajde/ui/StructureViewNodeFactory.java
@@ -81,4 +81,16 @@ public abstract class StructureViewNodeFactory {
* Implementors must override this method in order to create new nodes.
*/
protected abstract IStructureViewNode createDeclaration(IProgramElement node, AbstractIcon icon, List children);
+
+ /**
+ * Don't show code elements under types since they show under the corresponding initializers.
+ */
+ public static boolean acceptNode(IProgramElement parent, IProgramElement child) {
+ if (parent.getKind() == IProgramElement.Kind.CLASS
+ && child.getKind() == IProgramElement.Kind.CODE) {
+ return false;
+ } else {
+ return true;
+ }
+ }
}
diff --git a/ajde/src/org/aspectj/ajde/ui/StructureViewProperties.java b/ajde/src/org/aspectj/ajde/ui/StructureViewProperties.java
index 519d928a7..20d8ae66c 100644
--- a/ajde/src/org/aspectj/ajde/ui/StructureViewProperties.java
+++ b/ajde/src/org/aspectj/ajde/ui/StructureViewProperties.java
@@ -42,7 +42,7 @@ public class StructureViewProperties {
private List filteredMemberKinds = new ArrayList();
private List grouping = new ArrayList();
private Sorting sorting = Sorting.DECLARATIONAL;
- private Granularity granularity = Granularity.MEMBER;
+ private Granularity granularity = StructureViewProperties.Granularity.DECLARED_ELEMENTS;
public List getRelations() {
return relations;
diff --git a/ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java b/ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java
index fe1d31bc0..88b3f31a9 100644
--- a/ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java
+++ b/ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java
@@ -21,6 +21,8 @@ import org.aspectj.asm.*;
import org.aspectj.asm.internal.*;
import org.aspectj.asm.internal.ProgramElement;
+import sun.security.krb5.internal.crypto.p;
+
/**
* @author Mik Kersten
*/
@@ -379,13 +381,22 @@ public class TreeStructureViewBuilder {
}
}
+ /**
+ * Does not sort imports alphabetically.
+ */
private static final Comparator ALPHABETICAL_COMPARATOR = new Comparator() {
public int compare(Object o1, Object o2) {
IProgramElement sv1 = ((IStructureViewNode)o1).getStructureNode();
IProgramElement sv2 = ((IStructureViewNode)o2).getStructureNode();
+
if (sv1 instanceof IProgramElement && sv2 instanceof IProgramElement) {
+
IProgramElement p1 = (IProgramElement)sv1;
IProgramElement p2 = (IProgramElement)sv2;
+
+ if (p2.getKind() == IProgramElement.Kind.IMPORT_REFERENCE) return 1;
+ if (p1.getKind() == IProgramElement.Kind.IMPORT_REFERENCE) return -1;
+
return p1.getName().compareTo(p2.getName());
} else {
return 0;
@@ -400,7 +411,9 @@ public class TreeStructureViewBuilder {
if (sv1 instanceof IProgramElement && sv2 instanceof IProgramElement) {
IProgramElement p1 = (IProgramElement)sv1;
IProgramElement p2 = (IProgramElement)sv2;
- if (p1.getSourceLocation() == null) {
+ if (p2.getKind() == IProgramElement.Kind.IMPORT_REFERENCE) return 1;
+ if (p1.getKind() == IProgramElement.Kind.IMPORT_REFERENCE) return -1;
+ if (p1.getSourceLocation() == null || p2.getSourceLocation() == null) {
return 0;
} else if (p1.getSourceLocation().getLine() < p2.getSourceLocation().getLine()) {
return -1;
diff --git a/ajde/src/org/aspectj/ajde/ui/swing/StructureTreeManager.java b/ajde/src/org/aspectj/ajde/ui/swing/StructureTreeManager.java
index 9a32c26e5..3143b06c1 100644
--- a/ajde/src/org/aspectj/ajde/ui/swing/StructureTreeManager.java
+++ b/ajde/src/org/aspectj/ajde/ui/swing/StructureTreeManager.java
@@ -69,9 +69,8 @@ class StructureTreeManager {
private void highlightNode(SwingTreeViewNode parent, IProgramElement node) {
for (int i = 0; i < parent.getChildCount(); i++) {
SwingTreeViewNode currNode = (SwingTreeViewNode)parent.getChildAt(i);
- IProgramElement sNode = (IProgramElement)currNode.getUserObject();
- if (sNode instanceof IProgramElement &&
- ((IProgramElement)sNode).equals(node)) {
+ IProgramElement sNode = (IProgramElement)currNode.getStructureNode();
+ if (sNode != null && sNode.equals(node) && currNode.getKind() != IStructureViewNode.Kind.LINK) {
TreePath path = new TreePath(currNode.getPath());
structureTree.setSelectionPath(path);
int currRow = structureTree.getRowForPath(path);
@@ -156,7 +155,7 @@ class StructureTreeManager {
for (int i = 0; i < structureTree.getRowCount(); i++) {
TreePath path = structureTree.getPathForRow(i);
SwingTreeViewNode node = (SwingTreeViewNode)path.getLastPathComponent();
- if (path.getPath().length-1 > depth || node.getUserObject() instanceof IRelationship) {
+ if (path.getPath().length-1 > depth || node.getKind() == IStructureViewNode.Kind.RELATIONSHIP) {
structureTree.collapsePath(path);
} else {
structureTree.expandPath(path);
diff --git a/ajde/src/org/aspectj/ajde/ui/swing/StructureViewPanel.java b/ajde/src/org/aspectj/ajde/ui/swing/StructureViewPanel.java
index b52e23884..acaf8dd4e 100644
--- a/ajde/src/org/aspectj/ajde/ui/swing/StructureViewPanel.java
+++ b/ajde/src/org/aspectj/ajde/ui/swing/StructureViewPanel.java
@@ -90,7 +90,7 @@ public class StructureViewPanel extends JPanel implements StructureViewRenderer
public void setActiveNode(IStructureViewNode node, int lineOffset) {
if (node == null) return;
- if (!(node.getStructureNode() instanceof IProgramElement)) return;
+// if (!(node.getStructureNode() instanceof IProgramElement)) return;
IProgramElement pNode = (IProgramElement)node.getStructureNode();
treeManager.highlightNode(pNode);
if (pNode.getSourceLocation() != null) {
diff --git a/ajde/src/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java b/ajde/src/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java
index de4da1406..5fc5ae9b0 100644
--- a/ajde/src/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java
+++ b/ajde/src/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java
@@ -43,7 +43,10 @@ public class SwingTreeViewNode extends DefaultMutableTreeNode implements IStruct
if (children != null) {
for (Iterator it = children.iterator(); it.hasNext(); ) {
- super.add((SwingTreeViewNode)it.next());
+ SwingTreeViewNode child = (SwingTreeViewNode)it.next();
+ if (StructureViewNodeFactory.acceptNode(programElement, child.getStructureNode())) {
+ super.add(child);
+ }
}
}
}