commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gu...@apache.org
Subject svn commit: r945185 [30/42] - in /commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram: ./ META-INF/ bin/ icons/ icons/obj16/ icons/wizban/ src/ src/org/ src/org/apache/ src/org/apache/commons/ src/org/apache/com...
Date Mon, 17 May 2010 14:38:59 GMT
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorContentProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorContentProvider.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorContentProvider.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorContentProvider.java Mon May 17 14:38:45 2010
@@ -0,0 +1,1769 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.scxml.diagram.navigator;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.apache.commons.scxml.diagram.edit.parts.Anchor2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.AnchorEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Assign2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.AssignEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Cancel2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.CancelEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Content2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Content3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Content4EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Content5EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ContentContentCompartment2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ContentContentCompartment3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ContentContentCompartment4EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ContentContentCompartment5EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ContentContentCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ContentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.DataDataCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.DataEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.DataModelDataModelCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.DataModelEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.DonedataDonedataCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.DonedataEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ElseEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ElseIfEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.FinalState2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.FinalStateEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.FinalStateFinalStateCompartment2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.FinalStateFinalStateCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.FinalizeEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.HistoryState2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.HistoryStateEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.If2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.IfEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.IfIfCompartment2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.IfIfCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.InitialState2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.InitialStateEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.InvokeEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.InvokeInvokeCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Log2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.LogEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnEntry2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnEntry3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnEntryEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnEntryOnEntryCompartment2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnEntryOnEntryCompartment3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnEntryOnEntryCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnExit2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnExit3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnExitEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnExitOnExitCompartment2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnExitOnExitCompartment3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnExitOnExitCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Parallel2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Parallel3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ParallelEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ParallelParallelCompartment2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ParallelParallelCompartment3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ParallelParallelCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Param2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Param3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Param4EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Param5EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ParamEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Raise2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.RaiseEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Script2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Script3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ScriptEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Send2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.SendEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.SendSendCompartment2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.SendSendCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ServiceTemplateEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.State2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.State3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.StateEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.StateStateCompartment2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.StateStateCompartment3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.StateStateCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.TranslationEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.Validate2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ValidateEditPart;
+import org.apache.commons.scxml.diagram.part.Messages;
+import org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.navigator.ICommonContentExtensionSite;
+import org.eclipse.ui.navigator.ICommonContentProvider;
+
+/**
+ * @generated
+ */
+public class ScxmlNavigatorContentProvider implements ICommonContentProvider {
+
+	/**
+	 * @generated
+	 */
+	private static final Object[] EMPTY_ARRAY = new Object[0];
+
+	/**
+	 * @generated
+	 */
+	private Viewer myViewer;
+
+	/**
+	 * @generated
+	 */
+	private AdapterFactoryEditingDomain myEditingDomain;
+
+	/**
+	 * @generated
+	 */
+	private WorkspaceSynchronizer myWorkspaceSynchronizer;
+
+	/**
+	 * @generated
+	 */
+	private Runnable myViewerRefreshRunnable;
+
+	/**
+	 * @generated
+	 */
+	public ScxmlNavigatorContentProvider() {
+		TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE
+				.createEditingDomain();
+		myEditingDomain = (AdapterFactoryEditingDomain) editingDomain;
+		myEditingDomain.setResourceToReadOnlyMap(new HashMap() {
+			public Object get(Object key) {
+				if (!containsKey(key)) {
+					put(key, Boolean.TRUE);
+				}
+				return super.get(key);
+			}
+		});
+		myViewerRefreshRunnable = new Runnable() {
+			public void run() {
+				if (myViewer != null) {
+					myViewer.refresh();
+				}
+			}
+		};
+		myWorkspaceSynchronizer = new WorkspaceSynchronizer(editingDomain,
+				new WorkspaceSynchronizer.Delegate() {
+					public void dispose() {
+					}
+
+					public boolean handleResourceChanged(final Resource resource) {
+						for (Iterator it = myEditingDomain.getResourceSet()
+								.getResources().iterator(); it.hasNext();) {
+							Resource nextResource = (Resource) it.next();
+							nextResource.unload();
+						}
+						if (myViewer != null) {
+							myViewer.getControl().getDisplay().asyncExec(
+									myViewerRefreshRunnable);
+						}
+						return true;
+					}
+
+					public boolean handleResourceDeleted(Resource resource) {
+						for (Iterator it = myEditingDomain.getResourceSet()
+								.getResources().iterator(); it.hasNext();) {
+							Resource nextResource = (Resource) it.next();
+							nextResource.unload();
+						}
+						if (myViewer != null) {
+							myViewer.getControl().getDisplay().asyncExec(
+									myViewerRefreshRunnable);
+						}
+						return true;
+					}
+
+					public boolean handleResourceMoved(Resource resource,
+							final URI newURI) {
+						for (Iterator it = myEditingDomain.getResourceSet()
+								.getResources().iterator(); it.hasNext();) {
+							Resource nextResource = (Resource) it.next();
+							nextResource.unload();
+						}
+						if (myViewer != null) {
+							myViewer.getControl().getDisplay().asyncExec(
+									myViewerRefreshRunnable);
+						}
+						return true;
+					}
+				});
+	}
+
+	/**
+	 * @generated
+	 */
+	public void dispose() {
+		myWorkspaceSynchronizer.dispose();
+		myWorkspaceSynchronizer = null;
+		myViewerRefreshRunnable = null;
+		for (Iterator it = myEditingDomain.getResourceSet().getResources()
+				.iterator(); it.hasNext();) {
+			Resource resource = (Resource) it.next();
+			resource.unload();
+		}
+		((TransactionalEditingDomain) myEditingDomain).dispose();
+		myEditingDomain = null;
+	}
+
+	/**
+	 * @generated
+	 */
+	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+		myViewer = viewer;
+	}
+
+	/**
+	 * @generated
+	 */
+	public Object[] getElements(Object inputElement) {
+		return getChildren(inputElement);
+	}
+
+	/**
+	 * @generated
+	 */
+	public void restoreState(IMemento aMemento) {
+	}
+
+	/**
+	 * @generated
+	 */
+	public void saveState(IMemento aMemento) {
+	}
+
+	/**
+	 * @generated
+	 */
+	public void init(ICommonContentExtensionSite aConfig) {
+	}
+
+	/**
+	 * @generated
+	 */
+	public Object[] getChildren(Object parentElement) {
+		if (parentElement instanceof IFile) {
+			IFile file = (IFile) parentElement;
+			URI fileURI = URI.createPlatformResourceURI(file.getFullPath()
+					.toString(), true);
+			Resource resource = myEditingDomain.getResourceSet().getResource(
+					fileURI, true);
+			Collection result = new ArrayList();
+			result.addAll(createNavigatorItems(selectViewsByType(resource
+					.getContents(), ServiceTemplateEditPart.MODEL_ID), file,
+					false));
+			return result.toArray();
+		}
+
+		if (parentElement instanceof ScxmlNavigatorGroup) {
+			ScxmlNavigatorGroup group = (ScxmlNavigatorGroup) parentElement;
+			return group.getChildren();
+		}
+
+		if (parentElement instanceof ScxmlNavigatorItem) {
+			ScxmlNavigatorItem navigatorItem = (ScxmlNavigatorItem) parentElement;
+			if (navigatorItem.isLeaf() || !isOwnView(navigatorItem.getView())) {
+				return EMPTY_ARRAY;
+			}
+			return getViewChildren(navigatorItem.getView(), parentElement);
+		}
+
+		return EMPTY_ARRAY;
+	}
+
+	/**
+	 * @generated
+	 */
+	private Object[] getViewChildren(View view, Object parentElement) {
+		switch (ScxmlVisualIDRegistry.getVisualID(view)) {
+
+		case ServiceTemplateEditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			ScxmlNavigatorGroup links = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_ServiceTemplate_79_links,
+					"icons/linksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view), StateEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					InitialStateEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					ScriptEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					ParallelEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					DataModelEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					FinalStateEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getDiagramLinksByType(Collections.singleton(view),
+					TranslationEditPart.VISUAL_ID);
+			links
+					.addChildren(createNavigatorItems(connectedViews, links,
+							false));
+			if (!links.isEmpty()) {
+				result.add(links);
+			}
+			return result.toArray();
+		}
+
+		case StateEditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			ScxmlNavigatorGroup incominglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_State_1001_incominglinks,
+					"icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			ScxmlNavigatorGroup outgoinglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_State_1001_outgoinglinks,
+					"icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view), StateStateCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					OnEntryEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					OnExitEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					InvokeEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					InitialState2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					HistoryStateEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Parallel2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Anchor2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					FinalState2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					State3EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getIncomingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			incominglinks.addChildren(createNavigatorItems(connectedViews,
+					incominglinks, true));
+			connectedViews = getOutgoingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			outgoinglinks.addChildren(createNavigatorItems(connectedViews,
+					outgoinglinks, true));
+			if (!incominglinks.isEmpty()) {
+				result.add(incominglinks);
+			}
+			if (!outgoinglinks.isEmpty()) {
+				result.add(outgoinglinks);
+			}
+			return result.toArray();
+		}
+
+		case InitialStateEditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			ScxmlNavigatorGroup incominglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_InitialState_1002_incominglinks,
+					"icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			ScxmlNavigatorGroup outgoinglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_InitialState_1002_outgoinglinks,
+					"icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			Collection connectedViews = getIncomingLinksByType(Collections
+					.singleton(view), TranslationEditPart.VISUAL_ID);
+			incominglinks.addChildren(createNavigatorItems(connectedViews,
+					incominglinks, true));
+			connectedViews = getOutgoingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			outgoinglinks.addChildren(createNavigatorItems(connectedViews,
+					outgoinglinks, true));
+			if (!incominglinks.isEmpty()) {
+				result.add(incominglinks);
+			}
+			if (!outgoinglinks.isEmpty()) {
+				result.add(outgoinglinks);
+			}
+			return result.toArray();
+		}
+
+		case ParallelEditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			ScxmlNavigatorGroup incominglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_Parallel_1004_incominglinks,
+					"icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			ScxmlNavigatorGroup outgoinglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_Parallel_1004_outgoinglinks,
+					"icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view),
+					ParallelParallelCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					HistoryState2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					ParallelParallelCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					AnchorEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					ParallelParallelCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Parallel3EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					ParallelParallelCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					OnEntry2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					ParallelParallelCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					OnExit2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					ParallelParallelCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					State2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getIncomingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			incominglinks.addChildren(createNavigatorItems(connectedViews,
+					incominglinks, true));
+			connectedViews = getOutgoingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			outgoinglinks.addChildren(createNavigatorItems(connectedViews,
+					outgoinglinks, true));
+			if (!incominglinks.isEmpty()) {
+				result.add(incominglinks);
+			}
+			if (!outgoinglinks.isEmpty()) {
+				result.add(outgoinglinks);
+			}
+			return result.toArray();
+		}
+
+		case DataModelEditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view),
+					DataModelDataModelCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					DataEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case FinalStateEditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			ScxmlNavigatorGroup incominglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_FinalState_1006_incominglinks,
+					"icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			ScxmlNavigatorGroup outgoinglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_FinalState_1006_outgoinglinks,
+					"icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view),
+					FinalStateFinalStateCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					DonedataEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					FinalStateFinalStateCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					OnEntry3EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					FinalStateFinalStateCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					OnExit3EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getIncomingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			incominglinks.addChildren(createNavigatorItems(connectedViews,
+					incominglinks, true));
+			connectedViews = getOutgoingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			outgoinglinks.addChildren(createNavigatorItems(connectedViews,
+					outgoinglinks, true));
+			if (!incominglinks.isEmpty()) {
+				result.add(incominglinks);
+			}
+			if (!outgoinglinks.isEmpty()) {
+				result.add(outgoinglinks);
+			}
+			return result.toArray();
+		}
+
+		case OnEntryEditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view),
+					OnEntryOnEntryCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					IfEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					AssignEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					RaiseEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					LogEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					ValidateEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					CancelEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					SendEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Param2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Script2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case IfEditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view), IfIfCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					ElseIfEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					IfIfCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					ElseEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case SendEditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view), SendSendCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					ParamEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					SendSendCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					ContentEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case ContentEditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view),
+					ContentContentCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Content2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case Content2EditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view),
+					ContentContentCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Content2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case OnExitEditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view), OnExitOnExitCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					If2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Assign2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Raise2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Log2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Validate2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Cancel2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Param3EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Send2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Script3EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case If2EditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view), IfIfCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					ElseIfEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					IfIfCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					ElseEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case Send2EditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view), SendSendCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					ParamEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					SendSendCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					ContentEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case InvokeEditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view), InvokeInvokeCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					FinalizeEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					InvokeInvokeCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Param4EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					InvokeInvokeCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Content3EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case Content3EditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view),
+					ContentContentCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Content2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case InitialState2EditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			ScxmlNavigatorGroup incominglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_InitialState_2030_incominglinks,
+					"icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			ScxmlNavigatorGroup outgoinglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_InitialState_2030_outgoinglinks,
+					"icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			Collection connectedViews = getIncomingLinksByType(Collections
+					.singleton(view), TranslationEditPart.VISUAL_ID);
+			incominglinks.addChildren(createNavigatorItems(connectedViews,
+					incominglinks, true));
+			connectedViews = getOutgoingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			outgoinglinks.addChildren(createNavigatorItems(connectedViews,
+					outgoinglinks, true));
+			if (!incominglinks.isEmpty()) {
+				result.add(incominglinks);
+			}
+			if (!outgoinglinks.isEmpty()) {
+				result.add(outgoinglinks);
+			}
+			return result.toArray();
+		}
+
+		case HistoryStateEditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			ScxmlNavigatorGroup incominglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_HistoryState_2031_incominglinks,
+					"icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			ScxmlNavigatorGroup outgoinglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_HistoryState_2031_outgoinglinks,
+					"icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			Collection connectedViews = getIncomingLinksByType(Collections
+					.singleton(view), TranslationEditPart.VISUAL_ID);
+			incominglinks.addChildren(createNavigatorItems(connectedViews,
+					incominglinks, true));
+			connectedViews = getOutgoingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			outgoinglinks.addChildren(createNavigatorItems(connectedViews,
+					outgoinglinks, true));
+			if (!incominglinks.isEmpty()) {
+				result.add(incominglinks);
+			}
+			if (!outgoinglinks.isEmpty()) {
+				result.add(outgoinglinks);
+			}
+			return result.toArray();
+		}
+
+		case Parallel2EditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			ScxmlNavigatorGroup incominglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_Parallel_2032_incominglinks,
+					"icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			ScxmlNavigatorGroup outgoinglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_Parallel_2032_outgoinglinks,
+					"icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view),
+					ParallelParallelCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					HistoryState2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					ParallelParallelCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					AnchorEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					ParallelParallelCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Parallel3EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					ParallelParallelCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					OnEntry2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					ParallelParallelCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					OnExit2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					ParallelParallelCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					State2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getIncomingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			incominglinks.addChildren(createNavigatorItems(connectedViews,
+					incominglinks, true));
+			connectedViews = getOutgoingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			outgoinglinks.addChildren(createNavigatorItems(connectedViews,
+					outgoinglinks, true));
+			if (!incominglinks.isEmpty()) {
+				result.add(incominglinks);
+			}
+			if (!outgoinglinks.isEmpty()) {
+				result.add(outgoinglinks);
+			}
+			return result.toArray();
+		}
+
+		case HistoryState2EditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			ScxmlNavigatorGroup incominglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_HistoryState_2033_incominglinks,
+					"icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			ScxmlNavigatorGroup outgoinglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_HistoryState_2033_outgoinglinks,
+					"icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			Collection connectedViews = getIncomingLinksByType(Collections
+					.singleton(view), TranslationEditPart.VISUAL_ID);
+			incominglinks.addChildren(createNavigatorItems(connectedViews,
+					incominglinks, true));
+			connectedViews = getOutgoingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			outgoinglinks.addChildren(createNavigatorItems(connectedViews,
+					outgoinglinks, true));
+			if (!incominglinks.isEmpty()) {
+				result.add(incominglinks);
+			}
+			if (!outgoinglinks.isEmpty()) {
+				result.add(outgoinglinks);
+			}
+			return result.toArray();
+		}
+
+		case Parallel3EditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			ScxmlNavigatorGroup incominglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_Parallel_2035_incominglinks,
+					"icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			ScxmlNavigatorGroup outgoinglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_Parallel_2035_outgoinglinks,
+					"icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view),
+					ParallelParallelCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					HistoryState2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					ParallelParallelCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					AnchorEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					ParallelParallelCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Parallel3EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					ParallelParallelCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					OnEntry2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					ParallelParallelCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					OnExit2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					ParallelParallelCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					State2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getIncomingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			incominglinks.addChildren(createNavigatorItems(connectedViews,
+					incominglinks, true));
+			connectedViews = getOutgoingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			outgoinglinks.addChildren(createNavigatorItems(connectedViews,
+					outgoinglinks, true));
+			if (!incominglinks.isEmpty()) {
+				result.add(incominglinks);
+			}
+			if (!outgoinglinks.isEmpty()) {
+				result.add(outgoinglinks);
+			}
+			return result.toArray();
+		}
+
+		case OnEntry2EditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view),
+					OnEntryOnEntryCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					IfEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					AssignEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					RaiseEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					LogEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					ValidateEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					CancelEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					SendEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Param2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Script2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case OnExit2EditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view),
+					OnExitOnExitCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					If2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Assign2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Raise2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Log2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Validate2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Cancel2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Param3EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Send2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Script3EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case State2EditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			ScxmlNavigatorGroup incominglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_State_2038_incominglinks,
+					"icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			ScxmlNavigatorGroup outgoinglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_State_2038_outgoinglinks,
+					"icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view), StateStateCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					OnEntryEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					OnExitEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					InvokeEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					InitialState2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					HistoryStateEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Parallel2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Anchor2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					FinalState2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartment2EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					State3EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getIncomingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			incominglinks.addChildren(createNavigatorItems(connectedViews,
+					incominglinks, true));
+			connectedViews = getOutgoingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			outgoinglinks.addChildren(createNavigatorItems(connectedViews,
+					outgoinglinks, true));
+			if (!incominglinks.isEmpty()) {
+				result.add(incominglinks);
+			}
+			if (!outgoinglinks.isEmpty()) {
+				result.add(outgoinglinks);
+			}
+			return result.toArray();
+		}
+
+		case FinalState2EditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			ScxmlNavigatorGroup incominglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_FinalState_2040_incominglinks,
+					"icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			ScxmlNavigatorGroup outgoinglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_FinalState_2040_outgoinglinks,
+					"icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view),
+					FinalStateFinalStateCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					DonedataEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					FinalStateFinalStateCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					OnEntry3EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					FinalStateFinalStateCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					OnExit3EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getIncomingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			incominglinks.addChildren(createNavigatorItems(connectedViews,
+					incominglinks, true));
+			connectedViews = getOutgoingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			outgoinglinks.addChildren(createNavigatorItems(connectedViews,
+					outgoinglinks, true));
+			if (!incominglinks.isEmpty()) {
+				result.add(incominglinks);
+			}
+			if (!outgoinglinks.isEmpty()) {
+				result.add(outgoinglinks);
+			}
+			return result.toArray();
+		}
+
+		case DonedataEditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view),
+					DonedataDonedataCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Param5EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					DonedataDonedataCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Content4EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case Content4EditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view),
+					ContentContentCompartment4EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Content2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case OnEntry3EditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view),
+					OnEntryOnEntryCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					IfEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					AssignEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					RaiseEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					LogEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					ValidateEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					CancelEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					SendEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Param2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnEntryOnEntryCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Script2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case OnExit3EditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view),
+					OnExitOnExitCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					If2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Assign2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Raise2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Log2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Validate2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Cancel2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Param3EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Send2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					OnExitOnExitCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Script3EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case State3EditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			ScxmlNavigatorGroup incominglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_State_2046_incominglinks,
+					"icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			ScxmlNavigatorGroup outgoinglinks = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_State_2046_outgoinglinks,
+					"icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view), StateStateCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					OnEntryEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					OnExitEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					InvokeEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					InitialState2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					HistoryStateEditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Parallel2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Anchor2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					FinalState2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getChildrenByType(Collections.singleton(view),
+					StateStateCompartment3EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					State3EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			connectedViews = getIncomingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			incominglinks.addChildren(createNavigatorItems(connectedViews,
+					incominglinks, true));
+			connectedViews = getOutgoingLinksByType(
+					Collections.singleton(view), TranslationEditPart.VISUAL_ID);
+			outgoinglinks.addChildren(createNavigatorItems(connectedViews,
+					outgoinglinks, true));
+			if (!incominglinks.isEmpty()) {
+				result.add(incominglinks);
+			}
+			if (!outgoinglinks.isEmpty()) {
+				result.add(outgoinglinks);
+			}
+			return result.toArray();
+		}
+
+		case DataEditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view), DataDataCompartmentEditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Content5EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case Content5EditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			Collection connectedViews = getChildrenByType(Collections
+					.singleton(view),
+					ContentContentCompartment5EditPart.VISUAL_ID);
+			connectedViews = getChildrenByType(connectedViews,
+					Content2EditPart.VISUAL_ID);
+			result.addAll(createNavigatorItems(connectedViews, parentElement,
+					false));
+			return result.toArray();
+		}
+
+		case TranslationEditPart.VISUAL_ID: {
+			Collection result = new ArrayList();
+			ScxmlNavigatorGroup target = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_Translation_3001_target,
+					"icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			ScxmlNavigatorGroup source = new ScxmlNavigatorGroup(
+					Messages.NavigatorGroupName_Translation_3001_source,
+					"icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+			Collection connectedViews = getLinksTargetByType(Collections
+					.singleton(view), StateEditPart.VISUAL_ID);
+			target.addChildren(createNavigatorItems(connectedViews, target,
+					true));
+			connectedViews = getLinksTargetByType(Collections.singleton(view),
+					InitialStateEditPart.VISUAL_ID);
+			target.addChildren(createNavigatorItems(connectedViews, target,
+					true));
+			connectedViews = getLinksTargetByType(Collections.singleton(view),
+					ParallelEditPart.VISUAL_ID);
+			target.addChildren(createNavigatorItems(connectedViews, target,
+					true));
+			connectedViews = getLinksTargetByType(Collections.singleton(view),
+					FinalStateEditPart.VISUAL_ID);
+			target.addChildren(createNavigatorItems(connectedViews, target,
+					true));
+			connectedViews = getLinksTargetByType(Collections.singleton(view),
+					InitialState2EditPart.VISUAL_ID);
+			target.addChildren(createNavigatorItems(connectedViews, target,
+					true));
+			connectedViews = getLinksTargetByType(Collections.singleton(view),
+					HistoryStateEditPart.VISUAL_ID);
+			target.addChildren(createNavigatorItems(connectedViews, target,
+					true));
+			connectedViews = getLinksTargetByType(Collections.singleton(view),
+					Parallel2EditPart.VISUAL_ID);
+			target.addChildren(createNavigatorItems(connectedViews, target,
+					true));
+			connectedViews = getLinksTargetByType(Collections.singleton(view),
+					HistoryState2EditPart.VISUAL_ID);
+			target.addChildren(createNavigatorItems(connectedViews, target,
+					true));
+			connectedViews = getLinksTargetByType(Collections.singleton(view),
+					Parallel3EditPart.VISUAL_ID);
+			target.addChildren(createNavigatorItems(connectedViews, target,
+					true));
+			connectedViews = getLinksTargetByType(Collections.singleton(view),
+					State2EditPart.VISUAL_ID);
+			target.addChildren(createNavigatorItems(connectedViews, target,
+					true));
+			connectedViews = getLinksTargetByType(Collections.singleton(view),
+					FinalState2EditPart.VISUAL_ID);
+			target.addChildren(createNavigatorItems(connectedViews, target,
+					true));
+			connectedViews = getLinksTargetByType(Collections.singleton(view),
+					State3EditPart.VISUAL_ID);
+			target.addChildren(createNavigatorItems(connectedViews, target,
+					true));
+			connectedViews = getLinksSourceByType(Collections.singleton(view),
+					StateEditPart.VISUAL_ID);
+			source.addChildren(createNavigatorItems(connectedViews, source,
+					true));
+			connectedViews = getLinksSourceByType(Collections.singleton(view),
+					InitialStateEditPart.VISUAL_ID);
+			source.addChildren(createNavigatorItems(connectedViews, source,
+					true));
+			connectedViews = getLinksSourceByType(Collections.singleton(view),
+					ParallelEditPart.VISUAL_ID);
+			source.addChildren(createNavigatorItems(connectedViews, source,
+					true));
+			connectedViews = getLinksSourceByType(Collections.singleton(view),
+					FinalStateEditPart.VISUAL_ID);
+			source.addChildren(createNavigatorItems(connectedViews, source,
+					true));
+			connectedViews = getLinksSourceByType(Collections.singleton(view),
+					InitialState2EditPart.VISUAL_ID);
+			source.addChildren(createNavigatorItems(connectedViews, source,
+					true));
+			connectedViews = getLinksSourceByType(Collections.singleton(view),
+					HistoryStateEditPart.VISUAL_ID);
+			source.addChildren(createNavigatorItems(connectedViews, source,
+					true));
+			connectedViews = getLinksSourceByType(Collections.singleton(view),
+					Parallel2EditPart.VISUAL_ID);
+			source.addChildren(createNavigatorItems(connectedViews, source,
+					true));
+			connectedViews = getLinksSourceByType(Collections.singleton(view),
+					HistoryState2EditPart.VISUAL_ID);
+			source.addChildren(createNavigatorItems(connectedViews, source,
+					true));
+			connectedViews = getLinksSourceByType(Collections.singleton(view),
+					Parallel3EditPart.VISUAL_ID);
+			source.addChildren(createNavigatorItems(connectedViews, source,
+					true));
+			connectedViews = getLinksSourceByType(Collections.singleton(view),
+					State2EditPart.VISUAL_ID);
+			source.addChildren(createNavigatorItems(connectedViews, source,
+					true));
+			connectedViews = getLinksSourceByType(Collections.singleton(view),
+					FinalState2EditPart.VISUAL_ID);
+			source.addChildren(createNavigatorItems(connectedViews, source,
+					true));
+			connectedViews = getLinksSourceByType(Collections.singleton(view),
+					State3EditPart.VISUAL_ID);
+			source.addChildren(createNavigatorItems(connectedViews, source,
+					true));
+			if (!target.isEmpty()) {
+				result.add(target);
+			}
+			if (!source.isEmpty()) {
+				result.add(source);
+			}
+			return result.toArray();
+		}
+		}
+		return EMPTY_ARRAY;
+	}
+
+	/**
+	 * @generated
+	 */
+	private Collection getLinksSourceByType(Collection edges, int visualID) {
+		Collection result = new ArrayList();
+		String type = ScxmlVisualIDRegistry.getType(visualID);
+		for (Iterator it = edges.iterator(); it.hasNext();) {
+			Edge nextEdge = (Edge) it.next();
+			View nextEdgeSource = nextEdge.getSource();
+			if (type.equals(nextEdgeSource.getType())
+					&& isOwnView(nextEdgeSource)) {
+				result.add(nextEdgeSource);
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * @generated
+	 */
+	private Collection getLinksTargetByType(Collection edges, int visualID) {
+		Collection result = new ArrayList();
+		String type = ScxmlVisualIDRegistry.getType(visualID);
+		for (Iterator it = edges.iterator(); it.hasNext();) {
+			Edge nextEdge = (Edge) it.next();
+			View nextEdgeTarget = nextEdge.getTarget();
+			if (type.equals(nextEdgeTarget.getType())
+					&& isOwnView(nextEdgeTarget)) {
+				result.add(nextEdgeTarget);
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * @generated
+	 */
+	private Collection getOutgoingLinksByType(Collection nodes, int visualID) {
+		Collection result = new ArrayList();
+		String type = ScxmlVisualIDRegistry.getType(visualID);
+		for (Iterator it = nodes.iterator(); it.hasNext();) {
+			View nextNode = (View) it.next();
+			result.addAll(selectViewsByType(nextNode.getSourceEdges(), type));
+		}
+		return result;
+	}
+
+	/**
+	 * @generated
+	 */
+	private Collection getIncomingLinksByType(Collection nodes, int visualID) {
+		Collection result = new ArrayList();
+		String type = ScxmlVisualIDRegistry.getType(visualID);
+		for (Iterator it = nodes.iterator(); it.hasNext();) {
+			View nextNode = (View) it.next();
+			result.addAll(selectViewsByType(nextNode.getTargetEdges(), type));
+		}
+		return result;
+	}
+
+	/**
+	 * @generated
+	 */
+	private Collection getChildrenByType(Collection nodes, int visualID) {
+		Collection result = new ArrayList();
+		String type = ScxmlVisualIDRegistry.getType(visualID);
+		for (Iterator it = nodes.iterator(); it.hasNext();) {
+			View nextNode = (View) it.next();
+			result.addAll(selectViewsByType(nextNode.getChildren(), type));
+		}
+		return result;
+	}
+
+	/**
+	 * @generated
+	 */
+	private Collection getDiagramLinksByType(Collection diagrams, int visualID) {
+		Collection result = new ArrayList();
+		String type = ScxmlVisualIDRegistry.getType(visualID);
+		for (Iterator it = diagrams.iterator(); it.hasNext();) {
+			Diagram nextDiagram = (Diagram) it.next();
+			result.addAll(selectViewsByType(nextDiagram.getEdges(), type));
+		}
+		return result;
+	}
+
+	/**
+	 * @generated
+	 */
+	private Collection selectViewsByType(Collection views, String type) {
+		Collection result = new ArrayList();
+		for (Iterator it = views.iterator(); it.hasNext();) {
+			View nextView = (View) it.next();
+			if (type.equals(nextView.getType()) && isOwnView(nextView)) {
+				result.add(nextView);
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * @generated
+	 */
+	private boolean isOwnView(View view) {
+		return ServiceTemplateEditPart.MODEL_ID.equals(ScxmlVisualIDRegistry
+				.getModelID(view));
+	}
+
+	/**
+	 * @generated
+	 */
+	private Collection createNavigatorItems(Collection views, Object parent,
+			boolean isLeafs) {
+		Collection result = new ArrayList();
+		for (Iterator it = views.iterator(); it.hasNext();) {
+			result
+					.add(new ScxmlNavigatorItem((View) it.next(), parent,
+							isLeafs));
+		}
+		return result;
+	}
+
+	/**
+	 * @generated
+	 */
+	public Object getParent(Object element) {
+		if (element instanceof ScxmlAbstractNavigatorItem) {
+			ScxmlAbstractNavigatorItem abstractNavigatorItem = (ScxmlAbstractNavigatorItem) element;
+			return abstractNavigatorItem.getParent();
+		}
+		return null;
+	}
+
+	/**
+	 * @generated
+	 */
+	public boolean hasChildren(Object element) {
+		return element instanceof IFile || getChildren(element).length > 0;
+	}
+
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorContentProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorGroup.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorGroup.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorGroup.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorGroup.java Mon May 17 14:38:45 2010
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.scxml.diagram.navigator;
+
+import java.util.Collection;
+import java.util.LinkedList;
+
+/**
+ * @generated
+ */
+public class ScxmlNavigatorGroup extends ScxmlAbstractNavigatorItem {
+
+	/**
+	 * @generated
+	 */
+	private String myGroupName;
+
+	/**
+	 * @generated
+	 */
+	private String myIcon;
+
+	/**
+	 * @generated
+	 */
+	private Collection myChildren = new LinkedList();
+
+	/**
+	 * @generated
+	 */
+	ScxmlNavigatorGroup(String groupName, String icon, Object parent) {
+		super(parent);
+		myGroupName = groupName;
+		myIcon = icon;
+	}
+
+	/**
+	 * @generated
+	 */
+	public String getGroupName() {
+		return myGroupName;
+	}
+
+	/**
+	 * @generated
+	 */
+	public String getIcon() {
+		return myIcon;
+	}
+
+	/**
+	 * @generated
+	 */
+	public Object[] getChildren() {
+		return myChildren.toArray();
+	}
+
+	/**
+	 * @generated
+	 */
+	public void addChildren(Collection children) {
+		myChildren.addAll(children);
+	}
+
+	/**
+	 * @generated
+	 */
+	public void addChild(Object child) {
+		myChildren.add(child);
+	}
+
+	/**
+	 * @generated
+	 */
+	public boolean isEmpty() {
+		return myChildren.size() == 0;
+	}
+
+	/**
+	 * @generated
+	 */
+	public boolean equals(Object obj) {
+		if (obj instanceof org.apache.commons.scxml.diagram.navigator.ScxmlNavigatorGroup) {
+			org.apache.commons.scxml.diagram.navigator.ScxmlNavigatorGroup anotherGroup = (org.apache.commons.scxml.diagram.navigator.ScxmlNavigatorGroup) obj;
+			if (getGroupName().equals(anotherGroup.getGroupName())) {
+				return getParent().equals(anotherGroup.getParent());
+			}
+		}
+		return super.equals(obj);
+	}
+
+	/**
+	 * @generated
+	 */
+	public int hashCode() {
+		return getGroupName().hashCode();
+	}
+
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorGroup.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorItem.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorItem.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorItem.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorItem.java Mon May 17 14:38:45 2010
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.scxml.diagram.navigator;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class ScxmlNavigatorItem extends ScxmlAbstractNavigatorItem {
+
+	/**
+	 * @generated
+	 */
+	static {
+		final Class[] supportedTypes = new Class[] { View.class, EObject.class };
+		Platform.getAdapterManager().registerAdapters(new IAdapterFactory() {
+
+			public Object getAdapter(Object adaptableObject, Class adapterType) {
+				if (adaptableObject instanceof org.apache.commons.scxml.diagram.navigator.ScxmlNavigatorItem
+						&& (adapterType == View.class || adapterType == EObject.class)) {
+					return ((org.apache.commons.scxml.diagram.navigator.ScxmlNavigatorItem) adaptableObject)
+							.getView();
+				}
+				return null;
+			}
+
+			public Class[] getAdapterList() {
+				return supportedTypes;
+			}
+		}, org.apache.commons.scxml.diagram.navigator.ScxmlNavigatorItem.class);
+	}
+
+	/**
+	 * @generated
+	 */
+	private View myView;
+
+	/**
+	 * @generated
+	 */
+	private boolean myLeaf = false;
+
+	/**
+	 * @generated
+	 */
+	public ScxmlNavigatorItem(View view, Object parent, boolean isLeaf) {
+		super(parent);
+		myView = view;
+		myLeaf = isLeaf;
+	}
+
+	/**
+	 * @generated
+	 */
+	public View getView() {
+		return myView;
+	}
+
+	/**
+	 * @generated
+	 */
+	public boolean isLeaf() {
+		return myLeaf;
+	}
+
+	/**
+	 * @generated
+	 */
+	public boolean equals(Object obj) {
+		if (obj instanceof org.apache.commons.scxml.diagram.navigator.ScxmlNavigatorItem) {
+			return EcoreUtil
+					.getURI(getView())
+					.equals(
+							EcoreUtil
+									.getURI(((org.apache.commons.scxml.diagram.navigator.ScxmlNavigatorItem) obj)
+											.getView()));
+		}
+		return super.equals(obj);
+	}
+
+	/**
+	 * @generated
+	 */
+	public int hashCode() {
+		return EcoreUtil.getURI(getView()).hashCode();
+	}
+
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorItem.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message