diff options
author | mkersten <mkersten> | 2003-08-13 20:51:10 +0000 |
---|---|---|
committer | mkersten <mkersten> | 2003-08-13 20:51:10 +0000 |
commit | bffcd4c30591bce89ba938325159374e1ea1ea96 (patch) | |
tree | 29f2247cf0806c7e5ea7e419c33d86b6a3738b38 /ajde/src | |
parent | 11d7649fc3219af5a71d3bf0b9fe004c075c2b4f (diff) | |
download | aspectj-bffcd4c30591bce89ba938325159374e1ea1ea96.tar.gz aspectj-bffcd4c30591bce89ba938325159374e1ea1ea96.zip |
Added support for multiple relationships for a single program element. Renamed model container class.
Diffstat (limited to 'ajde/src')
7 files changed, 32 insertions, 29 deletions
diff --git a/ajde/src/org/aspectj/ajde/ui/StructureModelUtil.java b/ajde/src/org/aspectj/ajde/ui/StructureModelUtil.java index ec0b44a9e..578c04e0c 100644 --- a/ajde/src/org/aspectj/ajde/ui/StructureModelUtil.java +++ b/ajde/src/org/aspectj/ajde/ui/StructureModelUtil.java @@ -114,9 +114,9 @@ public class StructureModelUtil { public static List getPackagesInModel() { List packages = new ArrayList(); - StructureModel model = + AspectJModel model = Ajde.getDefault().getStructureModelManager().getModel(); - if (model.equals(StructureModel.NO_STRUCTURE)) { + if (model.equals(AspectJModel.NO_STRUCTURE)) { return null; } else { return getPackagesHelper( diff --git a/ajde/src/org/aspectj/ajde/ui/StructureSearchManager.java b/ajde/src/org/aspectj/ajde/ui/StructureSearchManager.java index f98f5147e..c1f77c243 100644 --- a/ajde/src/org/aspectj/ajde/ui/StructureSearchManager.java +++ b/ajde/src/org/aspectj/ajde/ui/StructureSearchManager.java @@ -34,8 +34,8 @@ public class StructureSearchManager { IProgramElement.Kind kind) { List matches = new ArrayList(); - StructureModel model = Ajde.getDefault().getStructureModelManager().getModel(); - if (model.equals(StructureModel.NO_STRUCTURE)) { + AspectJModel model = Ajde.getDefault().getStructureModelManager().getModel(); + if (model.equals(AspectJModel.NO_STRUCTURE)) { return null; } else { return findMatchesHelper((IProgramElement)model.getRoot(), pattern, kind, matches); diff --git a/ajde/src/org/aspectj/ajde/ui/StructureViewManager.java b/ajde/src/org/aspectj/ajde/ui/StructureViewManager.java index 7170001ba..7eb9dfa5f 100644 --- a/ajde/src/org/aspectj/ajde/ui/StructureViewManager.java +++ b/ajde/src/org/aspectj/ajde/ui/StructureViewManager.java @@ -36,7 +36,7 @@ public class StructureViewManager { private static final List AVAILABLE_RELATIONS; public final IStructureModelListener VIEW_LISTENER = new IStructureModelListener() { - public void containmentHierarchyUpdated(StructureModel model) { + public void containmentHierarchyUpdated(AspectJModel model) { Ajde.getDefault().logEvent("updating structure views: " + structureViews); // // if (defaultFileView != null) { @@ -44,7 +44,7 @@ public class StructureViewManager { // } for (Iterator it = structureViews.iterator(); it.hasNext(); ) { - treeViewBuilder.buildView((StructureView)it.next(), (StructureModel)model); + treeViewBuilder.buildView((StructureView)it.next(), (AspectJModel)model); } } }; @@ -116,7 +116,7 @@ public class StructureViewManager { */ private void navigationAction(IProgramElement node, boolean recordHistory) { if (node == null - || node == StructureModel.NO_STRUCTURE) { + || node == AspectJModel.NO_STRUCTURE) { Ajde.getDefault().getIdeUIAdapter().displayStatusInformation("Source not available for node: " + node.getName()); return; } diff --git a/ajde/src/org/aspectj/ajde/ui/StructureViewNodeFactory.java b/ajde/src/org/aspectj/ajde/ui/StructureViewNodeFactory.java index 2cb822827..2339614ab 100644 --- a/ajde/src/org/aspectj/ajde/ui/StructureViewNodeFactory.java +++ b/ajde/src/org/aspectj/ajde/ui/StructureViewNodeFactory.java @@ -37,22 +37,25 @@ public abstract class StructureViewNodeFactory { AbstractIcon icon = iconRegistry.getStructureIcon(node.getKind(), node.getAccessibility()); IStructureViewNode svNode = createDeclaration(node, icon, children); - IRelationship rel = AsmManager.getDefault().getMapper().get(node); - if (rel != null && rel.getTargets().size() > 0) { - IStructureViewNode relNode = createRelationship( - rel, - iconRegistry.getIcon(rel.getKind()) - ); - svNode.add(relNode, 0); - - for (Iterator it = rel.getTargets().iterator(); it.hasNext(); ) { - IProgramElement link = (IProgramElement)it.next(); - IStructureViewNode linkNode = createLink( - link, - iconRegistry.getStructureIcon(link.getKind(), link.getAccessibility()) - ); - relNode.add(linkNode); - + List relationships = AsmManager.getDefault().getMapper().get(node); + for (Iterator it = relationships.iterator(); it.hasNext(); ) { + IRelationship rel = (IRelationship)it.next(); + if (rel != null && rel.getTargets().size() > 0) { + IStructureViewNode relNode = createRelationship( + rel, + iconRegistry.getIcon(rel.getKind()) + ); + svNode.add(relNode, 0); + + for (Iterator it2 = rel.getTargets().iterator(); it2.hasNext(); ) { + IProgramElement link = (IProgramElement)it2.next(); + IStructureViewNode linkNode = createLink( + link, + iconRegistry.getStructureIcon(link.getKind(), link.getAccessibility()) + ); + relNode.add(linkNode); + + } } } return svNode; diff --git a/ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java b/ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java index cdbd5a11d..239628176 100644 --- a/ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java +++ b/ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java @@ -34,14 +34,14 @@ public class TreeStructureViewBuilder { /** * @todo get rid of instanceof tests */ - public void buildView(StructureView view, StructureModel model) { + public void buildView(StructureView view, AspectJModel model) { StructureViewProperties properties = view.getViewProperties(); IProgramElement modelRoot = null; boolean noStructure = false; if (isFileView(view)) { FileStructureView fileView = (FileStructureView)view; if (fileView.getSourceFile() == null) { - modelRoot = StructureModel.NO_STRUCTURE; + modelRoot = AspectJModel.NO_STRUCTURE; noStructure = true; } else { modelRoot = model.findRootNodeForSourceFile(fileView.getSourceFile()); @@ -197,7 +197,7 @@ public class TreeStructureViewBuilder { } } - private IStructureViewNode buildCustomTree(GlobalStructureView view, StructureModel model) { + private IStructureViewNode buildCustomTree(GlobalStructureView view, AspectJModel model) { IProgramElement rootNode = model.getRoot(); IStructureViewNode treeNode = nodeFactory.createNode(rootNode); diff --git a/ajde/src/org/aspectj/ajde/ui/swing/SimpleStructureViewToolPanel.java b/ajde/src/org/aspectj/ajde/ui/swing/SimpleStructureViewToolPanel.java index dc9b5cd76..66c3a0e0a 100644 --- a/ajde/src/org/aspectj/ajde/ui/swing/SimpleStructureViewToolPanel.java +++ b/ajde/src/org/aspectj/ajde/ui/swing/SimpleStructureViewToolPanel.java @@ -33,7 +33,7 @@ import org.aspectj.ajde.Ajde; import org.aspectj.ajde.ui.StructureView; import org.aspectj.ajde.ui.StructureViewProperties; import org.aspectj.asm.IProgramElement; -import org.aspectj.asm.StructureModel; +import org.aspectj.asm.AspectJModel; import org.aspectj.asm.IStructureModelListener; public class SimpleStructureViewToolPanel extends JPanel { @@ -61,7 +61,7 @@ public class SimpleStructureViewToolPanel extends JPanel { BorderLayout borderLayout4 = new BorderLayout(); public final IStructureModelListener MODEL_LISTENER = new IStructureModelListener() { - public void containmentHierarchyUpdated(StructureModel model) { + public void containmentHierarchyUpdated(AspectJModel model) { String path = Ajde.getDefault().getConfigurationManager().getActiveConfigFile(); String fileName = "<no active config>"; if (path != null) fileName = new File(path).getName(); diff --git a/ajde/src/org/aspectj/ajde/ui/swing/StructureTreeManager.java b/ajde/src/org/aspectj/ajde/ui/swing/StructureTreeManager.java index 29871bf8d..efb786b7f 100644 --- a/ajde/src/org/aspectj/ajde/ui/swing/StructureTreeManager.java +++ b/ajde/src/org/aspectj/ajde/ui/swing/StructureTreeManager.java @@ -35,7 +35,7 @@ class StructureTreeManager { private TreeSelectionListener treeListener = null; private final StructureTreeModel NO_STRUCTURE_MODEL - = new StructureTreeModel(new SwingTreeViewNode(StructureModel.NO_STRUCTURE, new AbstractIcon(null), new ArrayList())); + = new StructureTreeModel(new SwingTreeViewNode(AspectJModel.NO_STRUCTURE, new AbstractIcon(null), new ArrayList())); /** * @todo should probably avoid that MouseListener cast |