| package org.eclipse.uml2.diagram.deploy.navigator; |
| |
| import java.util.ArrayList; |
| import java.util.Collection; |
| import java.util.Collections; |
| import java.util.HashMap; |
| import java.util.Iterator; |
| |
| 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; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.Artifact2EditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.Artifact3EditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.ArtifactEditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.CommunicationPathEditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.DependencyEditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.DeploymentConfigurationEditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.DeploymentEditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.DeploymentSpecificationEditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.DeploymentSpecificationPropertiesEditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.Device2EditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.DeviceDevicecontents2EditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.DeviceDevicecontentsEditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.DeviceEditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.ElementImportEditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.ExecutionEnvironment2EditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.ExecutionEnvironmentArtifacts2EditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.ExecutionEnvironmentArtifactsEditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.ExecutionEnvironmentEditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.ManifestationEditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.Node2EditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.NodeEditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.Package2EditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.PackageEditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.PackageImportsEditPart; |
| import org.eclipse.uml2.diagram.deploy.edit.parts.PropertyEditPart; |
| import org.eclipse.uml2.diagram.deploy.part.Messages; |
| import org.eclipse.uml2.diagram.deploy.part.UMLVisualIDRegistry; |
| |
| /** |
| * @generated |
| */ |
| public class UMLNavigatorContentProvider 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 UMLNavigatorContentProvider() { |
| 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(), PackageEditPart.MODEL_ID), file, false)); |
| return result.toArray(); |
| } |
| |
| if (parentElement instanceof UMLNavigatorGroup) { |
| UMLNavigatorGroup group = (UMLNavigatorGroup) parentElement; |
| return group.getChildren(); |
| } |
| |
| if (parentElement instanceof UMLNavigatorItem) { |
| UMLNavigatorItem navigatorItem = (UMLNavigatorItem) 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 (UMLVisualIDRegistry.getVisualID(view)) { |
| |
| case PackageEditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup links = new UMLNavigatorGroup(Messages.NavigatorGroupName_Package_1000_links, "icons/linksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getChildrenByType(Collections.singleton(view), Package2EditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getChildrenByType(Collections.singleton(view), DeviceEditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getChildrenByType(Collections.singleton(view), NodeEditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getChildrenByType(Collections.singleton(view), ExecutionEnvironmentEditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getChildrenByType(Collections.singleton(view), Artifact2EditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getChildrenByType(Collections.singleton(view), DeploymentSpecificationEditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getDiagramLinksByType(Collections.singleton(view), DeploymentEditPart.VISUAL_ID); |
| links.addChildren(createNavigatorItems(connectedViews, links, false)); |
| connectedViews = getDiagramLinksByType(Collections.singleton(view), ManifestationEditPart.VISUAL_ID); |
| links.addChildren(createNavigatorItems(connectedViews, links, false)); |
| connectedViews = getDiagramLinksByType(Collections.singleton(view), DeploymentConfigurationEditPart.VISUAL_ID); |
| links.addChildren(createNavigatorItems(connectedViews, links, false)); |
| connectedViews = getDiagramLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| links.addChildren(createNavigatorItems(connectedViews, links, false)); |
| connectedViews = getDiagramLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| links.addChildren(createNavigatorItems(connectedViews, links, false)); |
| if (!links.isEmpty()) { |
| result.add(links); |
| } |
| return result.toArray(); |
| } |
| |
| case Package2EditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Package_2001_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Package_2001_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getChildrenByType(Collections.singleton(view), PackageImportsEditPart.VISUAL_ID); |
| connectedViews = getChildrenByType(connectedViews, ElementImportEditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), ManifestationEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| if (!incominglinks.isEmpty()) { |
| result.add(incominglinks); |
| } |
| if (!outgoinglinks.isEmpty()) { |
| result.add(outgoinglinks); |
| } |
| return result.toArray(); |
| } |
| |
| case DeviceEditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Device_2003_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Device_2003_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getChildrenByType(Collections.singleton(view), DeviceDevicecontentsEditPart.VISUAL_ID); |
| connectedViews = getChildrenByType(connectedViews, Device2EditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getChildrenByType(Collections.singleton(view), DeviceDevicecontentsEditPart.VISUAL_ID); |
| connectedViews = getChildrenByType(connectedViews, ArtifactEditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getChildrenByType(Collections.singleton(view), DeviceDevicecontentsEditPart.VISUAL_ID); |
| connectedViews = getChildrenByType(connectedViews, ExecutionEnvironment2EditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getChildrenByType(Collections.singleton(view), DeviceDevicecontentsEditPart.VISUAL_ID); |
| connectedViews = getChildrenByType(connectedViews, Node2EditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), DeploymentEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), ManifestationEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| if (!outgoinglinks.isEmpty()) { |
| result.add(outgoinglinks); |
| } |
| if (!incominglinks.isEmpty()) { |
| result.add(incominglinks); |
| } |
| return result.toArray(); |
| } |
| |
| case NodeEditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Node_2004_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Node_2004_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getOutgoingLinksByType(Collections.singleton(view), DeploymentEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), ManifestationEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| if (!outgoinglinks.isEmpty()) { |
| result.add(outgoinglinks); |
| } |
| if (!incominglinks.isEmpty()) { |
| result.add(incominglinks); |
| } |
| return result.toArray(); |
| } |
| |
| case ExecutionEnvironmentEditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ExecutionEnvironment_2005_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ExecutionEnvironment_2005_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getChildrenByType(Collections.singleton(view), ExecutionEnvironmentArtifactsEditPart.VISUAL_ID); |
| connectedViews = getChildrenByType(connectedViews, Artifact3EditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), DeploymentEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), ManifestationEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| if (!outgoinglinks.isEmpty()) { |
| result.add(outgoinglinks); |
| } |
| if (!incominglinks.isEmpty()) { |
| result.add(incominglinks); |
| } |
| return result.toArray(); |
| } |
| |
| case Artifact2EditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Artifact_2006_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Artifact_2006_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), DeploymentEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), ManifestationEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), ManifestationEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| if (!incominglinks.isEmpty()) { |
| result.add(incominglinks); |
| } |
| if (!outgoinglinks.isEmpty()) { |
| result.add(outgoinglinks); |
| } |
| return result.toArray(); |
| } |
| |
| case DeploymentSpecificationEditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_DeploymentSpecification_2007_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_DeploymentSpecification_2007_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getChildrenByType(Collections.singleton(view), DeploymentSpecificationPropertiesEditPart.VISUAL_ID); |
| connectedViews = getChildrenByType(connectedViews, PropertyEditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), DeploymentEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), ManifestationEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), ManifestationEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), DeploymentConfigurationEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| if (!incominglinks.isEmpty()) { |
| result.add(incominglinks); |
| } |
| if (!outgoinglinks.isEmpty()) { |
| result.add(outgoinglinks); |
| } |
| return result.toArray(); |
| } |
| |
| case Device2EditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Device_3004_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Device_3004_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getChildrenByType(Collections.singleton(view), DeviceDevicecontents2EditPart.VISUAL_ID); |
| connectedViews = getChildrenByType(connectedViews, Device2EditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getChildrenByType(Collections.singleton(view), DeviceDevicecontents2EditPart.VISUAL_ID); |
| connectedViews = getChildrenByType(connectedViews, ArtifactEditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getChildrenByType(Collections.singleton(view), DeviceDevicecontents2EditPart.VISUAL_ID); |
| connectedViews = getChildrenByType(connectedViews, ExecutionEnvironment2EditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getChildrenByType(Collections.singleton(view), DeviceDevicecontents2EditPart.VISUAL_ID); |
| connectedViews = getChildrenByType(connectedViews, Node2EditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), DeploymentEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), ManifestationEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| if (!outgoinglinks.isEmpty()) { |
| result.add(outgoinglinks); |
| } |
| if (!incominglinks.isEmpty()) { |
| result.add(incominglinks); |
| } |
| return result.toArray(); |
| } |
| |
| case ArtifactEditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Artifact_3002_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Artifact_3002_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), DeploymentEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), ManifestationEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), ManifestationEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| if (!incominglinks.isEmpty()) { |
| result.add(incominglinks); |
| } |
| if (!outgoinglinks.isEmpty()) { |
| result.add(outgoinglinks); |
| } |
| return result.toArray(); |
| } |
| |
| case ExecutionEnvironment2EditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ExecutionEnvironment_3005_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_ExecutionEnvironment_3005_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getChildrenByType(Collections.singleton(view), ExecutionEnvironmentArtifacts2EditPart.VISUAL_ID); |
| connectedViews = getChildrenByType(connectedViews, Artifact3EditPart.VISUAL_ID); |
| result.addAll(createNavigatorItems(connectedViews, parentElement, false)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), DeploymentEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), ManifestationEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| if (!outgoinglinks.isEmpty()) { |
| result.add(outgoinglinks); |
| } |
| if (!incominglinks.isEmpty()) { |
| result.add(incominglinks); |
| } |
| return result.toArray(); |
| } |
| |
| case Artifact3EditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Artifact_3006_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Artifact_3006_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), DeploymentEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), ManifestationEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), ManifestationEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| if (!incominglinks.isEmpty()) { |
| result.add(incominglinks); |
| } |
| if (!outgoinglinks.isEmpty()) { |
| result.add(outgoinglinks); |
| } |
| return result.toArray(); |
| } |
| |
| case Node2EditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Node_3007_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Node_3007_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getOutgoingLinksByType(Collections.singleton(view), DeploymentEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), ManifestationEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), CommunicationPathEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| if (!outgoinglinks.isEmpty()) { |
| result.add(outgoinglinks); |
| } |
| if (!incominglinks.isEmpty()) { |
| result.add(incominglinks); |
| } |
| return result.toArray(); |
| } |
| |
| case PropertyEditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Property_3003_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| UMLNavigatorGroup incominglinks = new UMLNavigatorGroup(Messages.NavigatorGroupName_Property_3003_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getOutgoingLinksByType(Collections.singleton(view), DeploymentEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| connectedViews = getIncomingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true)); |
| connectedViews = getOutgoingLinksByType(Collections.singleton(view), DependencyEditPart.VISUAL_ID); |
| outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true)); |
| if (!outgoinglinks.isEmpty()) { |
| result.add(outgoinglinks); |
| } |
| if (!incominglinks.isEmpty()) { |
| result.add(incominglinks); |
| } |
| return result.toArray(); |
| } |
| |
| case DeploymentEditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup target = new UMLNavigatorGroup(Messages.NavigatorGroupName_Deployment_4001_target, "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| UMLNavigatorGroup source = new UMLNavigatorGroup(Messages.NavigatorGroupName_Deployment_4001_source, "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getLinksTargetByType(Collections.singleton(view), Artifact2EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), DeploymentSpecificationEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), ArtifactEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), Artifact3EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), DeviceEditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), NodeEditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), ExecutionEnvironmentEditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), Device2EditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), ExecutionEnvironment2EditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), Node2EditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), PropertyEditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| if (!target.isEmpty()) { |
| result.add(target); |
| } |
| if (!source.isEmpty()) { |
| result.add(source); |
| } |
| return result.toArray(); |
| } |
| |
| case ManifestationEditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup target = new UMLNavigatorGroup(Messages.NavigatorGroupName_Manifestation_4002_target, "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| UMLNavigatorGroup source = new UMLNavigatorGroup(Messages.NavigatorGroupName_Manifestation_4002_source, "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getLinksTargetByType(Collections.singleton(view), Package2EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), DeviceEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), NodeEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), ExecutionEnvironmentEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), Artifact2EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), DeploymentSpecificationEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), Device2EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), ArtifactEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), ExecutionEnvironment2EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), Artifact3EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), Node2EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), Artifact2EditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), DeploymentSpecificationEditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), ArtifactEditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), Artifact3EditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| if (!target.isEmpty()) { |
| result.add(target); |
| } |
| if (!source.isEmpty()) { |
| result.add(source); |
| } |
| return result.toArray(); |
| } |
| |
| case DeploymentConfigurationEditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup target = new UMLNavigatorGroup(Messages.NavigatorGroupName_DeploymentConfiguration_4003_target, "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getLinksTargetByType(Collections.singleton(view), DeploymentSpecificationEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| if (!target.isEmpty()) { |
| result.add(target); |
| } |
| return result.toArray(); |
| } |
| |
| case CommunicationPathEditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup target = new UMLNavigatorGroup(Messages.NavigatorGroupName_CommunicationPath_4004_target, "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| UMLNavigatorGroup source = new UMLNavigatorGroup(Messages.NavigatorGroupName_CommunicationPath_4004_source, "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getLinksTargetByType(Collections.singleton(view), DeviceEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), NodeEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), ExecutionEnvironmentEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), Artifact2EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), DeploymentSpecificationEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), Device2EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), ArtifactEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), ExecutionEnvironment2EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), Artifact3EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), Node2EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), DeviceEditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), NodeEditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), ExecutionEnvironmentEditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), Artifact2EditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), DeploymentSpecificationEditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), Device2EditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), ArtifactEditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), ExecutionEnvironment2EditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), Artifact3EditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), Node2EditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| if (!target.isEmpty()) { |
| result.add(target); |
| } |
| if (!source.isEmpty()) { |
| result.add(source); |
| } |
| return result.toArray(); |
| } |
| |
| case DependencyEditPart.VISUAL_ID: { |
| Collection result = new ArrayList(); |
| UMLNavigatorGroup target = new UMLNavigatorGroup(Messages.NavigatorGroupName_Dependency_4005_target, "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| UMLNavigatorGroup source = new UMLNavigatorGroup(Messages.NavigatorGroupName_Dependency_4005_source, "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$ |
| Collection connectedViews = getLinksTargetByType(Collections.singleton(view), Package2EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), DeviceEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), NodeEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), ExecutionEnvironmentEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), Artifact2EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), DeploymentSpecificationEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), Device2EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), ArtifactEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), ExecutionEnvironment2EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), Artifact3EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), Node2EditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksTargetByType(Collections.singleton(view), PropertyEditPart.VISUAL_ID); |
| target.addChildren(createNavigatorItems(connectedViews, target, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), Package2EditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), DeviceEditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), NodeEditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), ExecutionEnvironmentEditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), Artifact2EditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), DeploymentSpecificationEditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), Device2EditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), ArtifactEditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), ExecutionEnvironment2EditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), Artifact3EditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), Node2EditPart.VISUAL_ID); |
| source.addChildren(createNavigatorItems(connectedViews, source, true)); |
| connectedViews = getLinksSourceByType(Collections.singleton(view), PropertyEditPart.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 = UMLVisualIDRegistry.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 = UMLVisualIDRegistry.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 = UMLVisualIDRegistry.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 = UMLVisualIDRegistry.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 = UMLVisualIDRegistry.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 = UMLVisualIDRegistry.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 PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.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 UMLNavigatorItem((View) it.next(), parent, isLeafs)); |
| } |
| return result; |
| } |
| |
| /** |
| * @generated |
| */ |
| public Object getParent(Object element) { |
| if (element instanceof UMLAbstractNavigatorItem) { |
| UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem) element; |
| return abstractNavigatorItem.getParent(); |
| } |
| return null; |
| } |
| |
| /** |
| * @generated |
| */ |
| public boolean hasChildren(Object element) { |
| return element instanceof IFile || getChildren(element).length > 0; |
| } |
| |
| } |