From 2be3d4a49e3896f68268c0e6d6eefb648ae2c752 Mon Sep 17 00:00:00 2001 From: Florian Hoelzl <hoelzl@fortiss.org> Date: Wed, 22 Jun 2011 13:59:43 +0000 Subject: [PATCH] fixed model element handler use in navigator --- .../ui/interfaces/IModelElementHandler.java | 27 +++++++++++++++---- .../views/NavigatorTreeContentProvider.java | 6 ++++- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/interfaces/IModelElementHandler.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/interfaces/IModelElementHandler.java index db3f78a62..296376a72 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/interfaces/IModelElementHandler.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/interfaces/IModelElementHandler.java @@ -48,18 +48,35 @@ public interface IModelElementHandler<T extends EObject> extends /** Returns image descriptor to be used as icon image. */ public ImageDescriptor getIconImageDescriptor(); - /** Returns all children acting as nodes. */ + /** + * Returns all children acting as nodes, which are usually displayed as edit + * parts by graphical editors and entries in the navigator tree. + */ List<EObject> getSubnodes(T element); - /** Returns all children acting as connectors. */ + /** + * Returns all children acting as connectors, which are usually display as + * edit parts in graphical editors, but NOT as entries in the navigator + * tree. + */ List<EObject> getConnectors(T element); - /** Returns all connections entering this element. */ + /** + * Returns all connections entering this element, which are usually + * displayed as edit parts in graphical editors. + */ List<EObject> getIncomingConnections(T element); - /** Returns all connections leaving this element. */ + /** + * Returns all connections leaving this element, which are usually displayed + * as edit parts in graphical editors. + */ List<EObject> getOutgoingConnections(T element); - /** Returns all children acting as a (visible) specification. */ + /** + * Returns all children acting as a (visible) specification, which are + * displayed as child entries in the navigator tree, but not as edit parts + * in graphical editors. + */ List<EObject> getSpecifications(T element); } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorTreeContentProvider.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorTreeContentProvider.java index de93fb029..1f955c28e 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorTreeContentProvider.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorTreeContentProvider.java @@ -59,7 +59,11 @@ public class NavigatorTreeContentProvider implements ITreeContentProvider { IModelElementHandler<EObject> handler = IModelElementService.INSTANCE .getModelElementHandler((EObject) parentElement); if (handler != null) { - return handler.getSubnodes((EObject) parentElement).toArray(); + List<EObject> children = handler + .getSubnodes((EObject) parentElement); + children.addAll(handler + .getSpecifications((EObject) parentElement)); + return children.toArray(); } } return new Object[0]; -- GitLab