From a970bab6673faa4b184de307bc6f8b43b7c3dda0 Mon Sep 17 00:00:00 2001 From: Christian W. Damus Date: Wed, 11 Feb 2015 17:48:29 -0500 Subject: Bug 451230: Modeling assistants customization for profiles https://bugs.eclipse.org/bugs/show_bug.cgi?id=451230 Add a relationshipTypes subset of the elementTypes collection of the assistant provider to reliably determine which element types are relationships, because deriving this from the modeled connection assistants would omit element types for which there is no assistant. Update the assistants-model generators to reliably generate the relationshipTypes collection based on (a) links defined in the GMFGen model or (b) UML metaclasses conforming to Relationship in a profile. Re-generate the Class and Use Case assistants models. --- .../generator/ModelingAssistantProviderRule.xtend | 4 +- .../plugin.properties | 2 + .../ModelingAssistantProviderItemProvider.java | 177 +++++++++++++++++++++ .../model/assistant.ecore | 23 +++ .../model/assistant.genmodel | 10 ++ .../model/assistant.merged.uml | 55 +++++-- .../model/assistant.notation | 84 ++++++---- .../model/assistant.uml | 31 ++++ .../papyrus/infra/gmfdiag/assistant/Assistant.java | 4 +- .../infra/gmfdiag/assistant/AssistantPackage.java | 126 ++++++++++++++- .../assistant/AssistedElementTypeFilter.java | 4 +- .../gmfdiag/assistant/ConnectionAssistant.java | 10 +- .../infra/gmfdiag/assistant/ElementTypeFilter.java | 4 +- .../assistant/ModelingAssistantProvider.java | 61 ++++++- .../infra/gmfdiag/assistant/PopupAssistant.java | 8 +- .../gmfdiag/assistant/impl/AssistantImpl.java | 4 +- .../assistant/impl/AssistantPackageImpl.java | 79 +++++++++ .../impl/AssistedElementTypeFilterImpl.java | 4 +- .../assistant/impl/ConnectionAssistantImpl.java | 4 +- .../assistant/impl/ElementTypeFilterImpl.java | 4 +- .../impl/ModelingAssistantProviderImpl.java | 153 +++++++++++++++--- .../gmfdiag/assistant/impl/PopupAssistantImpl.java | 4 +- .../internal/operations/AssistantOperations.java | 6 +- .../AssistedElementTypeFilterOperations.java | 6 +- .../operations/ElementTypeFilterOperations.java | 6 +- .../ModelingAssistantProviderOperations.java | 70 +++++++- .../assistant/core/util/ModelingAssistantUtil.java | 16 -- .../generator/ModelingAssistantProviderRule.xtend | 1 + .../model/classdiagram.assistants | 24 +++ .../models/usecaseDiagram.assistants | 12 ++ .../resources/j2ee-all.assistants | 2 + .../resources/j2ee-usecase.assistants | 2 + .../resources/test.assistants | 2 + .../tests/AssistedElementTypeFilterTest.java | 3 - .../tests/ModelingAssistantProviderTest.java | 32 ++++ 35 files changed, 903 insertions(+), 134 deletions(-) diff --git a/plugins/developer/org.eclipse.papyrus.dev.assistants.codegen/src/org/eclipse/papyrus/dev/assistants/codegen/generator/ModelingAssistantProviderRule.xtend b/plugins/developer/org.eclipse.papyrus.dev.assistants.codegen/src/org/eclipse/papyrus/dev/assistants/codegen/generator/ModelingAssistantProviderRule.xtend index 2f5530fdf7d..d6e4ef71e3e 100644 --- a/plugins/developer/org.eclipse.papyrus.dev.assistants.codegen/src/org/eclipse/papyrus/dev/assistants/codegen/generator/ModelingAssistantProviderRule.xtend +++ b/plugins/developer/org.eclipse.papyrus.dev.assistants.codegen/src/org/eclipse/papyrus/dev/assistants/codegen/generator/ModelingAssistantProviderRule.xtend @@ -42,6 +42,7 @@ class ModelingAssistantProviderRule extends org.eclipse.papyrus.uml.profile.assi // Popup assistants to create non-relationships popupAssistants.add(type.toPopupAssistant) } else { + relationshipTypeIDs.add(type.identifier) connectionAssistants.add(type.toConnectionAssistant) } ] @@ -50,7 +51,8 @@ class ModelingAssistantProviderRule extends org.eclipse.papyrus.uml.profile.assi def create createModelingAssistantProvider toModelingAssistantProvider(GenEditorGenerator editor) { name = editor.modelID elementTypeIDs.addAll(editor.diagram.validNodes.map[elementType?.uniqueIdentifier].filterNull) - elementTypeIDs.addAll(editor.diagram.validLinks.map[elementType?.uniqueIdentifier].filterNull) + relationshipTypeIDs.addAll(editor.diagram.validLinks.map[elementType?.uniqueIdentifier].filterNull) + elementTypeIDs.addAll(relationshipTypeIDs) popupAssistants.addAll(editor.diagram.validNodes.map[toPopupAssistant]) connectionAssistants.addAll(editor.diagram.validLinks.map[toConnectionAssistant]) diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.edit/plugin.properties b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.edit/plugin.properties index 11862325c22..f4054557eb3 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.edit/plugin.properties +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.edit/plugin.properties @@ -61,3 +61,5 @@ _UI_AssistedElementTypeFilter_type = Assisted Element Type Filter _UI_AssistedElementTypeFilter_provider_feature = Provider _UI_ModelingAssistantProvider_excludedElementType_feature = Excluded Element Type _UI_ModelingAssistantProvider_excludedElementTypeID_feature = Excluded Element Type ID +_UI_ModelingAssistantProvider_relationshipType_feature = Relationship Type +_UI_ModelingAssistantProvider_relationshipTypeID_feature = Relationship Type ID diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.edit/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/provider/ModelingAssistantProviderItemProvider.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.edit/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/provider/ModelingAssistantProviderItemProvider.java index a746a53399d..9a16604b3af 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.edit/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/provider/ModelingAssistantProviderItemProvider.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.edit/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/provider/ModelingAssistantProviderItemProvider.java @@ -12,15 +12,24 @@ package org.eclipse.papyrus.infra.gmfdiag.assistant.provider; +import java.util.ArrayList; import java.util.Collection; +import java.util.HashSet; import java.util.List; import java.util.Objects; +import java.util.Set; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.CompoundCommand; import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.ResourceLocator; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.command.AddCommand; +import org.eclipse.emf.edit.command.RemoveCommand; import org.eclipse.emf.edit.command.SetCommand; import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; @@ -40,6 +49,9 @@ import org.eclipse.papyrus.infra.filters.FiltersFactory; import org.eclipse.papyrus.infra.gmfdiag.assistant.AssistantFactory; import org.eclipse.papyrus.infra.gmfdiag.assistant.AssistantPackage; import org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider; +import org.eclipse.uml2.common.edit.command.SubsetAddCommand; +import org.eclipse.uml2.common.edit.command.SubsetSupersetReplaceCommand; +import org.eclipse.uml2.common.edit.command.SupersetRemoveCommand; /** * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider} object. @@ -82,6 +94,8 @@ public class ModelingAssistantProviderItemProvider extends ItemProviderAdapter i addClientContextIDPropertyDescriptor(object); addExcludedElementTypePropertyDescriptor(object); addExcludedElementTypeIDPropertyDescriptor(object); + addRelationshipTypePropertyDescriptor(object); + addRelationshipTypeIDPropertyDescriptor(object); } return itemPropertyDescriptors; } @@ -303,6 +317,55 @@ public class ModelingAssistantProviderItemProvider extends ItemProviderAdapter i null)); } + /** + * This adds a property descriptor for the Relationship Type feature. + * + * + * + * @generated + */ + protected void addRelationshipTypePropertyDescriptor(Object object) + { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ModelingAssistantProvider_relationshipType_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_ModelingAssistantProvider_relationshipType_feature", "_UI_ModelingAssistantProvider_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE, + false, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + new String[] { "org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ + })); + } + + /** + * This adds a property descriptor for the Relationship Type ID feature. + * + * + * + * @generated + */ + protected void addRelationshipTypeIDPropertyDescriptor(Object object) + { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ModelingAssistantProvider_relationshipTypeID_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_ModelingAssistantProvider_relationshipTypeID_feature", "_UI_ModelingAssistantProvider_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE_ID, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + /** * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. @@ -399,6 +462,8 @@ public class ModelingAssistantProviderItemProvider extends ItemProviderAdapter i case AssistantPackage.MODELING_ASSISTANT_PROVIDER__CLIENT_CONTEXT_ID: case AssistantPackage.MODELING_ASSISTANT_PROVIDER__EXCLUDED_ELEMENT_TYPE: case AssistantPackage.MODELING_ASSISTANT_PROVIDER__EXCLUDED_ELEMENT_TYPE_ID: + case AssistantPackage.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE: + case AssistantPackage.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE_ID: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case AssistantPackage.MODELING_ASSISTANT_PROVIDER__OWNED_FILTER: @@ -465,4 +530,116 @@ public class ModelingAssistantProviderItemProvider extends ItemProviderAdapter i return ((IChildCreationExtender) adapterFactory).getResourceLocator(); } + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createAddCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection, int) + * + * + * @generated + */ + @Override + protected Command createAddCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection, int index) { + if (feature == AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE_ID) { + return new SubsetAddCommand(domain, owner, feature, new EStructuralFeature[] { AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE_ID }, collection, index); + } + return super.createAddCommand(domain, owner, feature, collection, index); + } + + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createRemoveCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection) + * + * + * @generated + */ + @Override + protected Command createRemoveCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection) { + if (feature == AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE_ID) { + return new SupersetRemoveCommand(domain, owner, feature, new EStructuralFeature[] { AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE_ID }, collection); + } + return super.createRemoveCommand(domain, owner, feature, collection); + } + + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createReplaceCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.lang.Object, java.util.Collection) + * + * + * @generated + */ + @Override + protected Command createReplaceCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Object value, Collection collection) { + if (feature == AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE_ID) { + return new SubsetSupersetReplaceCommand(domain, owner, feature, new EStructuralFeature[] { AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE_ID }, null, value, collection); + } + if (feature == AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE_ID) { + return new SubsetSupersetReplaceCommand(domain, owner, feature, null, new EStructuralFeature[] { AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE_ID }, value, collection); + } + return super.createReplaceCommand(domain, owner, feature, value, collection); + } + + // + // FIXME Work-around for UML2 bug 459723 + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=459723 + // Replace with generated code when available + // + + @Override + protected Command createSetCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Object value) { + if (feature == AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE_ID) { + return createSetSubsetListCommand(domain, owner, feature, new EStructuralFeature[] { AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE_ID }, value); + } + if (feature == AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE_ID) { + return createSetSupersetListCommand(domain, owner, feature, new EStructuralFeature[] { AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE_ID }, value); + } + return super.createSetCommand(domain, owner, feature, value); + } + + protected Command createSetSubsetListCommand(EditingDomain domain, EObject owner, EStructuralFeature subset, EStructuralFeature[] supersets, Object value) { + List result = new ArrayList<>(supersets.length + 1); + + EList newList = (EList) value; + result.add(new SetCommand(domain, owner, subset, newList)); + + for (int i = 0; i < supersets.length; i++) { + EStructuralFeature superset = supersets[i]; + EList toAdd = new BasicEList<>(newList.size()); + Set current = new HashSet<>((EList) owner.eGet(superset)); + for (Object next : newList) { + if (!current.contains(next)) { + toAdd.add(next); + } + } + if (!toAdd.isEmpty()) { + result.add(AddCommand.create(domain, owner, superset, toAdd)); + } + } + + return (result.size() == 1) ? result.get(0) : new CompoundCommand(0, result); + } + + protected Command createSetSupersetListCommand(EditingDomain domain, EObject owner, EStructuralFeature superset, EStructuralFeature[] subsets, Object value) { + List result = new ArrayList<>(subsets.length + 1); + + EList newList = (EList) value; + result.add(new SetCommand(domain, owner, superset, newList)); + + // What are we removing? + EList toRemove = new BasicEList<>((EList) owner.eGet(superset)); + toRemove.removeAll(newList); + + if (!toRemove.isEmpty()) { + for (int i = 0; i < subsets.length; i++) { + EStructuralFeature subset = subsets[i]; + EList toRemoveFromSubset = new BasicEList<>((EList) owner.eGet(subset)); + toRemoveFromSubset.retainAll(toRemove); + if (!toRemoveFromSubset.isEmpty()) { + result.add(RemoveCommand.create(domain, owner, subset, toRemoveFromSubset)); + } + } + } + + return (result.size() == 1) ? result.get(0) : new CompoundCommand(0, result); + } + + // + // End work-around + // } diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.ecore b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.ecore index 03f67d72805..3aecc7a63a1 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.ecore +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.ecore @@ -37,6 +37,14 @@
+ + +
+ + + + + + + +
+ + + + + +
+ + + diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.genmodel b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.genmodel index 7bbeb3a6db3..01e9256b610 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.genmodel +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.genmodel @@ -76,6 +76,11 @@ org.eclipse.ui.views.properties.expert + + org.eclipse.ui.views.properties.expert + + + + + + diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.merged.uml b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.merged.uml index bcbac553ead..d533bf3e8fc 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.merged.uml +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.merged.uml @@ -266,6 +266,21 @@ This implies that inferred element types specializing any of these excluded type + + + The element types supported by the provider. + + + + + + + The identifiers of element types supported by the provider. + + + + + @@ -291,6 +306,18 @@ This implies that inferred element types specializing any of these excluded type + + + + + + + + + + + + @@ -407,17 +434,19 @@ This implies that inferred element types specializing any of these excluded type - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.notation b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.notation index 90b4a8780dc..a19a2ae7874 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.notation +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.notation @@ -31,6 +31,14 @@ + + + + + + + + @@ -53,6 +61,14 @@ + + + + + + + + @@ -65,7 +81,7 @@ - + @@ -88,7 +104,7 @@ - + @@ -153,7 +169,7 @@ - + @@ -187,7 +203,7 @@ - + @@ -226,7 +242,7 @@ - + @@ -301,12 +317,12 @@ - + - + @@ -339,8 +355,8 @@ - - + + @@ -349,8 +365,8 @@ - - + + @@ -360,7 +376,7 @@ - + @@ -372,8 +388,8 @@ - - + + @@ -383,7 +399,7 @@ - + @@ -398,7 +414,7 @@ - + @@ -422,8 +438,8 @@ - - + + @@ -448,7 +464,7 @@ - + @@ -472,8 +488,8 @@ - - + + @@ -497,8 +513,8 @@ - - + + @@ -522,7 +538,7 @@ - + @@ -547,8 +563,8 @@ - - + + @@ -571,9 +587,9 @@ - - - + + + @@ -585,15 +601,15 @@ - - + + - + @@ -617,7 +633,7 @@ - - + + diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.uml b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.uml index d67f65a3789..b1cc00cd3e3 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.uml +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/model/assistant.uml @@ -80,6 +80,21 @@ This implies that inferred element types specializing any of these excluded type + + + The element types supported by the provider. + + + + + + + The identifiers of element types supported by the provider. + + + + + @@ -106,6 +121,20 @@ This implies that inferred element types specializing any of these excluded type + + + + + + + + + + + + + + @@ -283,4 +312,6 @@ This implies that inferred element types specializing any of these excluded type + + diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/Assistant.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/Assistant.java index 36b92ccd124..b5b880768ac 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/Assistant.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/Assistant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2014 Christian W. Damus and others. + * Copyright (c) 2014, 2015 Christian W. Damus and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -22,12 +22,12 @@ import org.eclipse.gmf.runtime.emf.type.core.IElementType; * *

* The following features are supported: + *

*
    *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.Assistant#getElementTypeID Element Type ID}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.Assistant#getElementType Element Type}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.Assistant#getProvider Provider}
  • *
- *

* * @see org.eclipse.papyrus.infra.gmfdiag.assistant.AssistantPackage#getAssistant() * @model abstract="true" diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/AssistantPackage.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/AssistantPackage.java index 751a48f83e9..9a069db6049 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/AssistantPackage.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/AssistantPackage.java @@ -582,6 +582,26 @@ public interface AssistantPackage extends EPackage */ int MODELING_ASSISTANT_PROVIDER__EXCLUDED_ELEMENT_TYPE_ID = IMODELING_ASSISTANT_PROVIDER_FEATURE_COUNT + 10; + /** + * The feature id for the 'Relationship Type' attribute list. + * + * + * + * @generated + * @ordered + */ + int MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE = IMODELING_ASSISTANT_PROVIDER_FEATURE_COUNT + 11; + + /** + * The feature id for the 'Relationship Type ID' attribute list. + * + * + * + * @generated + * @ordered + */ + int MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE_ID = IMODELING_ASSISTANT_PROVIDER_FEATURE_COUNT + 12; + /** * The number of structural features of the 'Modeling Assistant Provider' class. * @@ -590,7 +610,7 @@ public interface AssistantPackage extends EPackage * @generated * @ordered */ - int MODELING_ASSISTANT_PROVIDER_FEATURE_COUNT = IMODELING_ASSISTANT_PROVIDER_FEATURE_COUNT + 11; + int MODELING_ASSISTANT_PROVIDER_FEATURE_COUNT = IMODELING_ASSISTANT_PROVIDER_FEATURE_COUNT + 13; /** * The operation id for the 'Provides' operation. @@ -772,6 +792,26 @@ public interface AssistantPackage extends EPackage */ int MODELING_ASSISTANT_PROVIDER___GET_EXCLUDED_ELEMENT_TYPES = IMODELING_ASSISTANT_PROVIDER_OPERATION_COUNT + 3; + /** + * The operation id for the 'Get Relationship Types' operation. + * + * + * + * @generated + * @ordered + */ + int MODELING_ASSISTANT_PROVIDER___GET_RELATIONSHIP_TYPES = IMODELING_ASSISTANT_PROVIDER_OPERATION_COUNT + 4; + + /** + * The operation id for the 'Is Relationship Type' operation. + * + * + * + * @generated + * @ordered + */ + int MODELING_ASSISTANT_PROVIDER___IS_RELATIONSHIP_TYPE__IELEMENTTYPE = IMODELING_ASSISTANT_PROVIDER_OPERATION_COUNT + 5; + /** * The number of operations of the 'Modeling Assistant Provider' class. * @@ -780,7 +820,7 @@ public interface AssistantPackage extends EPackage * @generated * @ordered */ - int MODELING_ASSISTANT_PROVIDER_OPERATION_COUNT = IMODELING_ASSISTANT_PROVIDER_OPERATION_COUNT + 4; + int MODELING_ASSISTANT_PROVIDER_OPERATION_COUNT = IMODELING_ASSISTANT_PROVIDER_OPERATION_COUNT + 6; /** * The feature id for the 'Element Type ID' attribute. @@ -1364,6 +1404,30 @@ public interface AssistantPackage extends EPackage */ EAttribute getModelingAssistantProvider_ExcludedElementTypeID(); + /** + * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getRelationshipTypes Relationship Type}'. + * + * + * + * @return the meta object for the attribute list 'Relationship Type'. + * @see org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getRelationshipTypes() + * @see #getModelingAssistantProvider() + * @generated + */ + EAttribute getModelingAssistantProvider_RelationshipType(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getRelationshipTypeIDs Relationship Type ID}'. + * + * + * + * @return the meta object for the attribute list 'Relationship Type ID'. + * @see org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getRelationshipTypeIDs() + * @see #getModelingAssistantProvider() + * @generated + */ + EAttribute getModelingAssistantProvider_RelationshipTypeID(); + /** * Returns the meta object for the '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getElementTypes() Get Element Types}' operation. * @@ -1408,6 +1472,28 @@ public interface AssistantPackage extends EPackage */ EOperation getModelingAssistantProvider__GetExcludedElementTypes(); + /** + * Returns the meta object for the '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getRelationshipTypes() Get Relationship Types}' operation. + * + * + * + * @return the meta object for the 'Get Relationship Types' operation. + * @see org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getRelationshipTypes() + * @generated + */ + EOperation getModelingAssistantProvider__GetRelationshipTypes(); + + /** + * Returns the meta object for the '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#isRelationshipType(org.eclipse.gmf.runtime.emf.type.core.IElementType) Is Relationship Type}' operation. + * + * + * + * @return the meta object for the 'Is Relationship Type' operation. + * @see org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#isRelationshipType(org.eclipse.gmf.runtime.emf.type.core.IElementType) + * @generated + */ + EOperation getModelingAssistantProvider__IsRelationshipType__IElementType(); + /** * Returns the meta object for class '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.Assistant Assistant}'. * @@ -2073,6 +2159,24 @@ public interface AssistantPackage extends EPackage */ EAttribute MODELING_ASSISTANT_PROVIDER__EXCLUDED_ELEMENT_TYPE_ID = eINSTANCE.getModelingAssistantProvider_ExcludedElementTypeID(); + /** + * The meta object literal for the 'Relationship Type' attribute list feature. + * + * + * + * @generated + */ + EAttribute MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE = eINSTANCE.getModelingAssistantProvider_RelationshipType(); + + /** + * The meta object literal for the 'Relationship Type ID' attribute list feature. + * + * + * + * @generated + */ + EAttribute MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE_ID = eINSTANCE.getModelingAssistantProvider_RelationshipTypeID(); + /** * The meta object literal for the 'Get Element Types' operation. * @@ -2109,6 +2213,24 @@ public interface AssistantPackage extends EPackage */ EOperation MODELING_ASSISTANT_PROVIDER___GET_EXCLUDED_ELEMENT_TYPES = eINSTANCE.getModelingAssistantProvider__GetExcludedElementTypes(); + /** + * The meta object literal for the 'Get Relationship Types' operation. + * + * + * + * @generated + */ + EOperation MODELING_ASSISTANT_PROVIDER___GET_RELATIONSHIP_TYPES = eINSTANCE.getModelingAssistantProvider__GetRelationshipTypes(); + + /** + * The meta object literal for the 'Is Relationship Type' operation. + * + * + * + * @generated + */ + EOperation MODELING_ASSISTANT_PROVIDER___IS_RELATIONSHIP_TYPE__IELEMENTTYPE = eINSTANCE.getModelingAssistantProvider__IsRelationshipType__IElementType(); + /** * The meta object literal for the '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.AssistantImpl Assistant}' class. * diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/AssistedElementTypeFilter.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/AssistedElementTypeFilter.java index 44e20e6598a..d831904bc1e 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/AssistedElementTypeFilter.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/AssistedElementTypeFilter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2014 Christian W. Damus and others. + * Copyright (c) 2014, 2015 Christian W. Damus and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -24,10 +24,10 @@ import org.eclipse.papyrus.infra.filters.Filter; * *

* The following features are supported: + *

*
    *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.AssistedElementTypeFilter#getProvider Provider}
  • *
- *

* * @see org.eclipse.papyrus.infra.gmfdiag.assistant.AssistantPackage#getAssistedElementTypeFilter() * @model diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/ConnectionAssistant.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/ConnectionAssistant.java index a5325a5a0c7..302e28f59f1 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/ConnectionAssistant.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/ConnectionAssistant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2014 Christian W. Damus and others. + * Copyright (c) 2014, 2015 Christian W. Damus and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -22,6 +22,7 @@ import org.eclipse.papyrus.infra.filters.Filter; * *

* The following features are supported: + *

*
    *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ConnectionAssistant#getSourceFilter Source Filter}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ConnectionAssistant#getOwnedSourceFilter Owned Source Filter}
  • @@ -29,7 +30,6 @@ import org.eclipse.papyrus.infra.filters.Filter; *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ConnectionAssistant#getOwnedTargetFilter Owned Target Filter}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ConnectionAssistant#getOwningProvider Owning Provider}
  • *
- *

* * @see org.eclipse.papyrus.infra.gmfdiag.assistant.AssistantPackage#getConnectionAssistant() * @model @@ -42,10 +42,10 @@ public interface ConnectionAssistant extends Assistant * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getConnectionAssistants Connection Assistant}'. *

* This feature subsets the following features: + *

*
    *
  • '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.Assistant#getProvider() Provider}'
  • *
- *

* *

* If the meaning of the 'Owning Provider' container reference isn't clear, there really should be more of a description here... @@ -105,10 +105,10 @@ public interface ConnectionAssistant extends Assistant * Returns the value of the 'Owned Source Filter' containment reference. *

* This feature subsets the following features: + *

*
    *
  • '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.ConnectionAssistant#getSourceFilter() Source Filter}'
  • *
- *

* *

* If the meaning of the 'Owned Source Filter' containment reference isn't clear, there really should be more of a description here... @@ -182,10 +182,10 @@ public interface ConnectionAssistant extends Assistant * Returns the value of the 'Owned Target Filter' containment reference. *

* This feature subsets the following features: + *

*
    *
  • '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.ConnectionAssistant#getTargetFilter() Target Filter}'
  • *
- *

* *

* If the meaning of the 'Owned Target Filter' containment reference isn't clear, there really should be more of a description here... diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/ElementTypeFilter.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/ElementTypeFilter.java index 0ff7267f920..3d40ef17a3a 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/ElementTypeFilter.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/ElementTypeFilter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2014 Christian W. Damus and others. + * Copyright (c) 2014, 2015 Christian W. Damus and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -22,12 +22,12 @@ import org.eclipse.papyrus.infra.filters.Filter; * *

* The following features are supported: + *

*
    *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ElementTypeFilter#getElementTypeID Element Type ID}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ElementTypeFilter#getElementType Element Type}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ElementTypeFilter#getProvider Provider}
  • *
- *

* * @see org.eclipse.papyrus.infra.gmfdiag.assistant.AssistantPackage#getElementTypeFilter() * @model diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/ModelingAssistantProvider.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/ModelingAssistantProvider.java index 5e2353859d3..835297c573e 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/ModelingAssistantProvider.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/ModelingAssistantProvider.java @@ -34,6 +34,7 @@ import org.eclipse.papyrus.infra.filters.Filter; * *

* The following features are supported: + *

*
    *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getName Name}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getAssistants Assistant}
  • @@ -46,8 +47,9 @@ import org.eclipse.papyrus.infra.filters.Filter; *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getClientContextID Client Context ID}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getExcludedElementTypes Excluded Element Type}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getExcludedElementTypeIDs Excluded Element Type ID}
  • + *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getRelationshipTypes Relationship Type}
  • + *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getRelationshipTypeIDs Relationship Type ID}
  • *
- *

* * @see org.eclipse.papyrus.infra.gmfdiag.assistant.AssistantPackage#getModelingAssistantProvider() * @model superTypes="org.eclipse.papyrus.infra.gmfdiag.assistant.IModelingAssistantProvider" @@ -111,6 +113,15 @@ public interface ModelingAssistantProvider extends EObject, IModelingAssistantPr */ IElementType getElementType(String id); + /** + * + * + * + * @model dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false" elementTypeDataType="org.eclipse.papyrus.infra.gmfdiag.assistant.ElementType" elementTypeRequired="true" elementTypeOrdered="false" + * @generated + */ + boolean isRelationshipType(IElementType elementType); + /** * Returns the value of the 'Owned Filter' containment reference list. * The list contents are of type {@link org.eclipse.papyrus.infra.filters.Filter}. @@ -180,10 +191,10 @@ public interface ModelingAssistantProvider extends EObject, IModelingAssistantPr * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.PopupAssistant#getOwningProvider Owning Provider}'. *

* This feature subsets the following features: + *

*
    *
  • '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getAssistants() Assistant}'
  • *
- *

* *

* If the meaning of the 'Popup Assistant' containment reference list isn't clear, there really should be more of a description here... @@ -215,10 +226,10 @@ public interface ModelingAssistantProvider extends EObject, IModelingAssistantPr * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.ConnectionAssistant#getOwningProvider Owning Provider}'. *

* This feature subsets the following features: + *

*
    *
  • '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getAssistants() Assistant}'
  • *
- *

* *

* If the meaning of the 'Connection Assistant' containment reference list isn't clear, there really should be more of a description here... @@ -353,4 +364,48 @@ public interface ModelingAssistantProvider extends EObject, IModelingAssistantPr */ EList getExcludedElementTypeIDs(); + /** + * Returns the value of the 'Relationship Type' attribute list. + * The list contents are of type {@link org.eclipse.gmf.runtime.emf.type.core.IElementType}. + *

+ * This feature subsets the following features: + *

+ *
    + *
  • '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getElementTypes() Element Type}'
  • + *
+ * + * + * + * The element types supported by the provider. + * + * + * @return the value of the 'Relationship Type' attribute list. + * @see org.eclipse.papyrus.infra.gmfdiag.assistant.AssistantPackage#getModelingAssistantProvider_RelationshipType() + * @model unique="false" dataType="org.eclipse.papyrus.infra.gmfdiag.assistant.ElementType" transient="true" changeable="false" volatile="true" derived="true" ordered="false" + * @generated + */ + EList getRelationshipTypes(); + + /** + * Returns the value of the 'Relationship Type ID' attribute list. + * The list contents are of type {@link java.lang.String}. + *

+ * This feature subsets the following features: + *

+ *
    + *
  • '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getElementTypeIDs() Element Type ID}'
  • + *
+ * + * + * + * The identifiers of element types supported by the provider. + * + * + * @return the value of the 'Relationship Type ID' attribute list. + * @see org.eclipse.papyrus.infra.gmfdiag.assistant.AssistantPackage#getModelingAssistantProvider_RelationshipTypeID() + * @model dataType="org.eclipse.uml2.types.String" ordered="false" + * @generated + */ + EList getRelationshipTypeIDs(); + } // ModelingAssistantProvider diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/PopupAssistant.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/PopupAssistant.java index e6c5f27940e..869653de62d 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/PopupAssistant.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/PopupAssistant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2014 Christian W. Damus and others. + * Copyright (c) 2014, 2015 Christian W. Damus and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -22,12 +22,12 @@ import org.eclipse.papyrus.infra.filters.Filter; * *

* The following features are supported: + *

*
    *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.PopupAssistant#getFilter Filter}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.PopupAssistant#getOwnedFilter Owned Filter}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.PopupAssistant#getOwningProvider Owning Provider}
  • *
- *

* * @see org.eclipse.papyrus.infra.gmfdiag.assistant.AssistantPackage#getPopupAssistant() * @model @@ -67,10 +67,10 @@ public interface PopupAssistant extends Assistant * Returns the value of the 'Owned Filter' containment reference. *

* This feature subsets the following features: + *

*
    *
  • '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.PopupAssistant#getFilter() Filter}'
  • *
- *

* *

* If the meaning of the 'Owned Filter' containment reference isn't clear, there really should be more of a description here... @@ -117,10 +117,10 @@ public interface PopupAssistant extends Assistant * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getPopupAssistants Popup Assistant}'. *

* This feature subsets the following features: + *

*
    *
  • '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.Assistant#getProvider() Provider}'
  • *
- *

* *

* If the meaning of the 'Owning Provider' container reference isn't clear, there really should be more of a description here... diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantImpl.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantImpl.java index 7789c03dd3f..35eea1c6c3c 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantImpl.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2014 Christian W. Damus and others. + * Copyright (c) 2014, 2015 Christian W. Damus and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -38,12 +38,12 @@ import org.eclipse.uml2.common.util.CacheAdapter; * *

* The following features are implemented: + *

*
    *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.AssistantImpl#getProvider Provider}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.AssistantImpl#getElementTypeID Element Type ID}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.AssistantImpl#getElementType Element Type}
  • *
- *

* * @generated */ diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantPackageImpl.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantPackageImpl.java index 6b21b70c168..f38a5b5d153 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantPackageImpl.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistantPackageImpl.java @@ -405,6 +405,30 @@ public class AssistantPackageImpl extends EPackageImpl implements AssistantPacka return (EAttribute) modelingAssistantProviderEClass.getEStructuralFeatures().get(10); } + /** + * + * + * + * @generated + */ + @Override + public EAttribute getModelingAssistantProvider_RelationshipType() + { + return (EAttribute) modelingAssistantProviderEClass.getEStructuralFeatures().get(11); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getModelingAssistantProvider_RelationshipTypeID() + { + return (EAttribute) modelingAssistantProviderEClass.getEStructuralFeatures().get(12); + } + /** * * @@ -453,6 +477,30 @@ public class AssistantPackageImpl extends EPackageImpl implements AssistantPacka return modelingAssistantProviderEClass.getEOperations().get(3); } + /** + * + * + * + * @generated + */ + @Override + public EOperation getModelingAssistantProvider__GetRelationshipTypes() + { + return modelingAssistantProviderEClass.getEOperations().get(4); + } + + /** + * + * + * + * @generated + */ + @Override + public EOperation getModelingAssistantProvider__IsRelationshipType__IElementType() + { + return modelingAssistantProviderEClass.getEOperations().get(5); + } + /** * * @@ -1021,10 +1069,14 @@ public class AssistantPackageImpl extends EPackageImpl implements AssistantPacka createEAttribute(modelingAssistantProviderEClass, MODELING_ASSISTANT_PROVIDER__CLIENT_CONTEXT_ID); createEAttribute(modelingAssistantProviderEClass, MODELING_ASSISTANT_PROVIDER__EXCLUDED_ELEMENT_TYPE); createEAttribute(modelingAssistantProviderEClass, MODELING_ASSISTANT_PROVIDER__EXCLUDED_ELEMENT_TYPE_ID); + createEAttribute(modelingAssistantProviderEClass, MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE); + createEAttribute(modelingAssistantProviderEClass, MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE_ID); createEOperation(modelingAssistantProviderEClass, MODELING_ASSISTANT_PROVIDER___GET_ELEMENT_TYPES); createEOperation(modelingAssistantProviderEClass, MODELING_ASSISTANT_PROVIDER___GET_CLIENT_CONTEXT); createEOperation(modelingAssistantProviderEClass, MODELING_ASSISTANT_PROVIDER___GET_ELEMENT_TYPE__STRING); createEOperation(modelingAssistantProviderEClass, MODELING_ASSISTANT_PROVIDER___GET_EXCLUDED_ELEMENT_TYPES); + createEOperation(modelingAssistantProviderEClass, MODELING_ASSISTANT_PROVIDER___GET_RELATIONSHIP_TYPES); + createEOperation(modelingAssistantProviderEClass, MODELING_ASSISTANT_PROVIDER___IS_RELATIONSHIP_TYPE__IELEMENTTYPE); assistantEClass = createEClass(ASSISTANT); createEAttribute(assistantEClass, ASSISTANT__ELEMENT_TYPE_ID); @@ -1150,6 +1202,10 @@ public class AssistantPackageImpl extends EPackageImpl implements AssistantPacka "excludedElementType", null, 0, -1, ModelingAssistantProvider.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ initEAttribute(getModelingAssistantProvider_ExcludedElementTypeID(), theTypesPackage.getString(), "excludedElementTypeID", null, 0, -1, ModelingAssistantProvider.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEAttribute(getModelingAssistantProvider_RelationshipType(), this.getElementType(), + "relationshipType", null, 0, -1, ModelingAssistantProvider.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEAttribute(getModelingAssistantProvider_RelationshipTypeID(), theTypesPackage.getString(), + "relationshipTypeID", null, 0, -1, ModelingAssistantProvider.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ initEOperation(getModelingAssistantProvider__GetElementTypes(), this.getElementType(), "getElementTypes", 0, -1, IS_UNIQUE, !IS_ORDERED); //$NON-NLS-1$ @@ -1160,6 +1216,11 @@ public class AssistantPackageImpl extends EPackageImpl implements AssistantPacka initEOperation(getModelingAssistantProvider__GetExcludedElementTypes(), this.getElementType(), "getExcludedElementTypes", 0, -1, IS_UNIQUE, !IS_ORDERED); //$NON-NLS-1$ + initEOperation(getModelingAssistantProvider__GetRelationshipTypes(), this.getElementType(), "getRelationshipTypes", 0, -1, IS_UNIQUE, !IS_ORDERED); //$NON-NLS-1$ + + op = initEOperation(getModelingAssistantProvider__IsRelationshipType__IElementType(), theTypesPackage.getBoolean(), "isRelationshipType", 1, 1, IS_UNIQUE, !IS_ORDERED); //$NON-NLS-1$ + addEParameter(op, this.getElementType(), "elementType", 1, 1, IS_UNIQUE, !IS_ORDERED); //$NON-NLS-1$ + initEClass(assistantEClass, Assistant.class, "Assistant", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEAttribute(getAssistant_ElementTypeID(), theTypesPackage.getString(), "elementTypeID", null, 1, 1, Assistant.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ initEAttribute(getAssistant_ElementType(), this.getElementType(), "elementType", null, 1, 1, Assistant.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ @@ -1296,6 +1357,24 @@ public class AssistantPackageImpl extends EPackageImpl implements AssistantPacka { URI.createURI(eNS_URI).appendFragment("//ModelingAssistantProvider/assistant") //$NON-NLS-1$ }); + addAnnotation(getModelingAssistantProvider_RelationshipType(), + source, + new String[] + { + }, + new URI[] + { + URI.createURI(eNS_URI).appendFragment("//ModelingAssistantProvider/elementType") //$NON-NLS-1$ + }); + addAnnotation(getModelingAssistantProvider_RelationshipTypeID(), + source, + new String[] + { + }, + new URI[] + { + URI.createURI(eNS_URI).appendFragment("//ModelingAssistantProvider/elementTypeID") //$NON-NLS-1$ + }); addAnnotation(getPopupAssistant_OwnedFilter(), source, new String[] diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistedElementTypeFilterImpl.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistedElementTypeFilterImpl.java index 1822d999fb9..12121ccd49c 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistedElementTypeFilterImpl.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/AssistedElementTypeFilterImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2014 Christian W. Damus and others. + * Copyright (c) 2014, 2015 Christian W. Damus and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -40,11 +40,11 @@ import org.eclipse.uml2.common.util.CacheAdapter; * *

* The following features are implemented: + *

*
    *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.AssistedElementTypeFilterImpl#getName Name}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.AssistedElementTypeFilterImpl#getProvider Provider}
  • *
- *

* * @generated */ diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ConnectionAssistantImpl.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ConnectionAssistantImpl.java index 1c242f7e11f..4a0c1264224 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ConnectionAssistantImpl.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ConnectionAssistantImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2014 Christian W. Damus and others. + * Copyright (c) 2014, 2015 Christian W. Damus and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -34,6 +34,7 @@ import org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider; * *

* The following features are implemented: + *

*
    *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ConnectionAssistantImpl#getProvider Provider}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ConnectionAssistantImpl#getSourceFilter Source Filter}
  • @@ -42,7 +43,6 @@ import org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider; *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ConnectionAssistantImpl#getOwnedTargetFilter Owned Target Filter}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ConnectionAssistantImpl#getOwningProvider Owning Provider}
  • *
- *

* * @generated */ diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ElementTypeFilterImpl.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ElementTypeFilterImpl.java index b5408df7093..4f948e6d660 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ElementTypeFilterImpl.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ElementTypeFilterImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2014 Christian W. Damus and others. + * Copyright (c) 2014, 2015 Christian W. Damus and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -33,13 +33,13 @@ import org.eclipse.uml2.common.util.CacheAdapter; * *

* The following features are implemented: + *

*
    *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ElementTypeFilterImpl#getName Name}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ElementTypeFilterImpl#getElementTypeID Element Type ID}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ElementTypeFilterImpl#getElementType Element Type}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ElementTypeFilterImpl#getProvider Provider}
  • *
- *

* * @generated */ diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ModelingAssistantProviderImpl.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ModelingAssistantProviderImpl.java index 66c4a298bff..3589a8d3e2e 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ModelingAssistantProviderImpl.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/ModelingAssistantProviderImpl.java @@ -56,21 +56,23 @@ import org.eclipse.uml2.common.util.DerivedUnionEObjectEList; * *

* The following features are implemented: + *

*
    *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl#getListeners Listener}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl#getAssistants Assistant}
  • + *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl#getElementTypeIDs Element Type ID}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl#getName Name}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl#getOwnedFilters Owned Filter}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl#getPopupAssistants Popup Assistant}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl#getConnectionAssistants Connection Assistant}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl#getElementTypes Element Type}
  • - *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl#getElementTypeIDs Element Type ID}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl#getClientContext Client Context}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl#getClientContextID Client Context ID}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl#getExcludedElementTypes Excluded Element Type}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl#getExcludedElementTypeIDs Excluded Element Type ID}
  • + *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl#getRelationshipTypes Relationship Type}
  • + *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl#getRelationshipTypeIDs Relationship Type ID}
  • *
- *

* * @generated */ @@ -87,6 +89,17 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container */ protected EList listeners; + /** + * The cached value of the '{@link #getElementTypeIDs() Element Type ID}' attribute list. + * + * + * + * @see #getElementTypeIDs() + * @generated + * @ordered + */ + protected EList elementTypeIDs; + /** * The default value of the '{@link #getName() Name}' attribute. * @@ -142,17 +155,6 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container */ protected EList connectionAssistants; - /** - * The cached value of the '{@link #getElementTypeIDs() Element Type ID}' attribute list. - * - * - * - * @see #getElementTypeIDs() - * @generated - * @ordered - */ - protected EList elementTypeIDs; - /** * The default value of the '{@link #getClientContext() Client Context}' attribute. * @@ -197,6 +199,17 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container */ protected EList excludedElementTypeIDs; + /** + * The cached value of the '{@link #getRelationshipTypeIDs() Relationship Type ID}' attribute list. + * + * + * + * @see #getRelationshipTypeIDs() + * @generated + * @ordered + */ + protected EList relationshipTypeIDs; + /** * * @@ -465,6 +478,17 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container return elementTypeIDs; } + /** + * The array of subset feature identifiers for the '{@link #getElementTypeIDs() Element Type ID}' attribute list. + * + * + * + * @see #getElementTypeIDs() + * @generated + * @ordered + */ + protected static final int[] ELEMENT_TYPE_ID_ESUBSETS = new int[] { AssistantPackage.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE_ID }; + /** * * @@ -555,6 +579,56 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container return excludedElementTypeIDs; } + /** + * + * + * + * @generated + */ + @Override + public EList getRelationshipTypes() + { + CacheAdapter cache = getCacheAdapter(); + if (cache != null) + { + @SuppressWarnings("unchecked") + EList result = (EList) cache.get(eResource(), this, AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE); + if (result == null) + { + cache.put(eResource(), this, AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE, result = ModelingAssistantProviderOperations.getRelationshipTypes(this)); + } + return result; + } + return ModelingAssistantProviderOperations.getRelationshipTypes(this); + } + + /** + * + * + * + * @generated + */ + @Override + public EList getRelationshipTypeIDs() + { + if (relationshipTypeIDs == null) + { + relationshipTypeIDs = new EDataTypeUniqueEList(String.class, this, AssistantPackage.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE_ID); + } + return relationshipTypeIDs; + } + + /** + * The array of superset feature identifiers for the '{@link #getRelationshipTypeIDs() Relationship Type ID}' attribute list. + * + * + * + * @see #getRelationshipTypeIDs() + * @generated + * @ordered + */ + protected static final int[] RELATIONSHIP_TYPE_ID_ESUPERSETS = new int[] { AssistantPackage.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE_ID }; + /** * * @@ -735,6 +809,18 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container return ModelingAssistantProviderOperations.getElementType(this, id); } + /** + * + * + * + * @generated + */ + @Override + public boolean isRelationshipType(IElementType elementType) + { + return ModelingAssistantProviderOperations.isRelationshipType(this, elementType); + } + /** * * @@ -791,6 +877,8 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container return getListeners(); case AssistantPackage.MODELING_ASSISTANT_PROVIDER__ASSISTANT: return getAssistants(); + case AssistantPackage.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE_ID: + return getElementTypeIDs(); case AssistantPackage.MODELING_ASSISTANT_PROVIDER__NAME: return getName(); case AssistantPackage.MODELING_ASSISTANT_PROVIDER__OWNED_FILTER: @@ -801,8 +889,6 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container return getConnectionAssistants(); case AssistantPackage.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE: return getElementTypes(); - case AssistantPackage.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE_ID: - return getElementTypeIDs(); case AssistantPackage.MODELING_ASSISTANT_PROVIDER__CLIENT_CONTEXT: return getClientContext(); case AssistantPackage.MODELING_ASSISTANT_PROVIDER__CLIENT_CONTEXT_ID: @@ -811,6 +897,10 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container return getExcludedElementTypes(); case AssistantPackage.MODELING_ASSISTANT_PROVIDER__EXCLUDED_ELEMENT_TYPE_ID: return getExcludedElementTypeIDs(); + case AssistantPackage.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE: + return getRelationshipTypes(); + case AssistantPackage.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE_ID: + return getRelationshipTypeIDs(); } return super.eGet(featureID, resolve, coreType); } @@ -831,6 +921,10 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container getListeners().clear(); getListeners().addAll((Collection) newValue); return; + case AssistantPackage.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE_ID: + getElementTypeIDs().clear(); + getElementTypeIDs().addAll((Collection) newValue); + return; case AssistantPackage.MODELING_ASSISTANT_PROVIDER__NAME: setName((String) newValue); return; @@ -846,10 +940,6 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container getConnectionAssistants().clear(); getConnectionAssistants().addAll((Collection) newValue); return; - case AssistantPackage.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE_ID: - getElementTypeIDs().clear(); - getElementTypeIDs().addAll((Collection) newValue); - return; case AssistantPackage.MODELING_ASSISTANT_PROVIDER__CLIENT_CONTEXT_ID: setClientContextID((String) newValue); return; @@ -857,6 +947,10 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container getExcludedElementTypeIDs().clear(); getExcludedElementTypeIDs().addAll((Collection) newValue); return; + case AssistantPackage.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE_ID: + getRelationshipTypeIDs().clear(); + getRelationshipTypeIDs().addAll((Collection) newValue); + return; } super.eSet(featureID, newValue); } @@ -875,6 +969,9 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container case AssistantPackage.MODELING_ASSISTANT_PROVIDER__LISTENER: getListeners().clear(); return; + case AssistantPackage.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE_ID: + getElementTypeIDs().clear(); + return; case AssistantPackage.MODELING_ASSISTANT_PROVIDER__NAME: setName(NAME_EDEFAULT); return; @@ -887,15 +984,15 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container case AssistantPackage.MODELING_ASSISTANT_PROVIDER__CONNECTION_ASSISTANT: getConnectionAssistants().clear(); return; - case AssistantPackage.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE_ID: - getElementTypeIDs().clear(); - return; case AssistantPackage.MODELING_ASSISTANT_PROVIDER__CLIENT_CONTEXT_ID: setClientContextID(CLIENT_CONTEXT_ID_EDEFAULT); return; case AssistantPackage.MODELING_ASSISTANT_PROVIDER__EXCLUDED_ELEMENT_TYPE_ID: getExcludedElementTypeIDs().clear(); return; + case AssistantPackage.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE_ID: + getRelationshipTypeIDs().clear(); + return; } super.eUnset(featureID); } @@ -915,6 +1012,8 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container return listeners != null && !listeners.isEmpty(); case AssistantPackage.MODELING_ASSISTANT_PROVIDER__ASSISTANT: return isSetAssistants(); + case AssistantPackage.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE_ID: + return elementTypeIDs != null && !elementTypeIDs.isEmpty(); case AssistantPackage.MODELING_ASSISTANT_PROVIDER__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case AssistantPackage.MODELING_ASSISTANT_PROVIDER__OWNED_FILTER: @@ -925,8 +1024,6 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container return connectionAssistants != null && !connectionAssistants.isEmpty(); case AssistantPackage.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE: return !getElementTypes().isEmpty(); - case AssistantPackage.MODELING_ASSISTANT_PROVIDER__ELEMENT_TYPE_ID: - return elementTypeIDs != null && !elementTypeIDs.isEmpty(); case AssistantPackage.MODELING_ASSISTANT_PROVIDER__CLIENT_CONTEXT: return CLIENT_CONTEXT_EDEFAULT == null ? getClientContext() != null : !CLIENT_CONTEXT_EDEFAULT.equals(getClientContext()); case AssistantPackage.MODELING_ASSISTANT_PROVIDER__CLIENT_CONTEXT_ID: @@ -935,6 +1032,10 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container return !getExcludedElementTypes().isEmpty(); case AssistantPackage.MODELING_ASSISTANT_PROVIDER__EXCLUDED_ELEMENT_TYPE_ID: return excludedElementTypeIDs != null && !excludedElementTypeIDs.isEmpty(); + case AssistantPackage.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE: + return !getRelationshipTypes().isEmpty(); + case AssistantPackage.MODELING_ASSISTANT_PROVIDER__RELATIONSHIP_TYPE_ID: + return relationshipTypeIDs != null && !relationshipTypeIDs.isEmpty(); } return super.eIsSet(featureID); } @@ -982,6 +1083,8 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container return getTypesForPopupBar((IAdaptable) arguments.get(0)); case AssistantPackage.MODELING_ASSISTANT_PROVIDER___GET_ELEMENT_TYPE__STRING: return getElementType((String) arguments.get(0)); + case AssistantPackage.MODELING_ASSISTANT_PROVIDER___IS_RELATIONSHIP_TYPE__IELEMENTTYPE: + return isRelationshipType((IElementType) arguments.get(0)); } return super.eInvoke(operationID, arguments); } @@ -1010,6 +1113,8 @@ public class ModelingAssistantProviderImpl extends MinimalEObjectImpl.Container result.append(clientContextID); result.append(", excludedElementTypeID: "); //$NON-NLS-1$ result.append(excludedElementTypeIDs); + result.append(", relationshipTypeID: "); //$NON-NLS-1$ + result.append(relationshipTypeIDs); result.append(')'); return result.toString(); } diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/PopupAssistantImpl.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/PopupAssistantImpl.java index ba7c216ee48..668be44144d 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/PopupAssistantImpl.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/impl/PopupAssistantImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2014 Christian W. Damus and others. + * Copyright (c) 2014, 2015 Christian W. Damus and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -34,13 +34,13 @@ import org.eclipse.papyrus.infra.gmfdiag.assistant.PopupAssistant; * *

* The following features are implemented: + *

*
    *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.PopupAssistantImpl#getProvider Provider}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.PopupAssistantImpl#getFilter Filter}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.PopupAssistantImpl#getOwnedFilter Owned Filter}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.impl.PopupAssistantImpl#getOwningProvider Owning Provider}
  • *
- *

* * @generated */ diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/AssistantOperations.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/AssistantOperations.java index aa3cdb5dd7d..466cd0b80b0 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/AssistantOperations.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/AssistantOperations.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2014 Christian W. Damus and others. + * Copyright (c) 2014, 2015 Christian W. Damus and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -22,10 +22,10 @@ import org.eclipse.papyrus.infra.gmfdiag.assistant.Assistant; * *

* The following operations are supported: + *

*
    *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.Assistant#getElementType() Get Element Type}
  • *
- *

* * @generated */ @@ -63,4 +63,4 @@ public class AssistantOperations return result; } -} // AssistantOperations \ No newline at end of file +} // AssistantOperations diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/AssistedElementTypeFilterOperations.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/AssistedElementTypeFilterOperations.java index 4be323aef90..2059c2a0ec7 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/AssistedElementTypeFilterOperations.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/AssistedElementTypeFilterOperations.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2014 Christian W. Damus and others. + * Copyright (c) 2014, 2015 Christian W. Damus and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -30,11 +30,11 @@ import com.google.common.collect.Sets; * *

* The following operations are supported: + *

*
    *
  • {@link org.eclipse.papyrus.infra.filters.Filter#matches(java.lang.Object) Matches}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.AssistedElementTypeFilter#getProvider() Get Provider}
  • *
- *

* * @generated */ @@ -104,4 +104,4 @@ public class AssistedElementTypeFilterOperations return result; } -} // AssistedElementTypeFilterOperations \ No newline at end of file +} // AssistedElementTypeFilterOperations diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/ElementTypeFilterOperations.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/ElementTypeFilterOperations.java index 66b8c568000..d147d51bceb 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/ElementTypeFilterOperations.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/ElementTypeFilterOperations.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2014 Christian W. Damus and others. + * Copyright (c) 2014, 2015 Christian W. Damus and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -25,12 +25,12 @@ import org.eclipse.papyrus.infra.gmfdiag.assistant.core.util.ModelingAssistantUt * *

* The following operations are supported: + *

*
    *
  • {@link org.eclipse.papyrus.infra.filters.Filter#matches(java.lang.Object) Matches}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ElementTypeFilter#getElementType() Get Element Type}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ElementTypeFilter#getProvider() Get Provider}
  • *
- *

* * @generated */ @@ -106,4 +106,4 @@ public class ElementTypeFilterOperations return result; } -} // ElementTypeFilterOperations \ No newline at end of file +} // ElementTypeFilterOperations diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/ModelingAssistantProviderOperations.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/ModelingAssistantProviderOperations.java index ff88e81ecae..a265af5ed9b 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/ModelingAssistantProviderOperations.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/internal/operations/ModelingAssistantProviderOperations.java @@ -13,7 +13,6 @@ package org.eclipse.papyrus.infra.gmfdiag.assistant.internal.operations; import static org.eclipse.papyrus.infra.gmfdiag.assistant.core.util.ModelingAssistantUtil.alphabetical; import static org.eclipse.papyrus.infra.gmfdiag.assistant.core.util.ModelingAssistantUtil.filterConnectionTypes; -import static org.eclipse.papyrus.infra.gmfdiag.assistant.core.util.ModelingAssistantUtil.isRelationship; import java.util.Collection; import java.util.List; @@ -37,6 +36,7 @@ import org.eclipse.gmf.runtime.notation.View; import org.eclipse.papyrus.infra.core.utils.AdapterUtils; import org.eclipse.papyrus.infra.emf.utils.ECollections2; import org.eclipse.papyrus.infra.emf.utils.ECollections2.ImmutableEListBuilder; +import org.eclipse.papyrus.infra.gmfdiag.assistant.AssistantPackage; import org.eclipse.papyrus.infra.gmfdiag.assistant.ConnectionAssistant; import org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider; import org.eclipse.papyrus.infra.gmfdiag.assistant.PopupAssistant; @@ -44,10 +44,12 @@ import org.eclipse.papyrus.infra.gmfdiag.assistant.core.util.ModelingAssistantUt import org.eclipse.papyrus.infra.gmfdiag.assistant.impl.ModelingAssistantProviderImpl; import org.eclipse.papyrus.infra.gmfdiag.assistant.internal.core.util.ProviderCache; import org.eclipse.papyrus.infra.services.edit.utils.ElementTypeUtils; +import org.eclipse.uml2.common.util.CacheAdapter; import com.google.common.base.Function; import com.google.common.base.Objects; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.collect.Sets; @@ -58,6 +60,7 @@ import com.google.common.collect.Sets; * *

* The following operations are supported: + *

*
    *
  • {@link org.eclipse.gmf.runtime.common.core.service.IProvider#provides(org.eclipse.gmf.runtime.common.core.service.IOperation) Provides}
  • *
  • {@link org.eclipse.gmf.runtime.common.core.service.IProvider#addProviderChangeListener(org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener) Add Provider Change Listener}
  • @@ -79,8 +82,9 @@ import com.google.common.collect.Sets; *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getClientContext() Get Client Context}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getElementType(java.lang.String) Get Element Type}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getExcludedElementTypes() Get Excluded Element Types}
  • + *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getRelationshipTypes() Get Relationship Types}
  • + *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#isRelationshipType(org.eclipse.gmf.runtime.emf.type.core.IElementType) Is Relationship Type}
  • *
- *

* * @generated */ @@ -293,7 +297,7 @@ public class ModelingAssistantProviderOperations // The filter, if any, needs to match but we also don't want to propose connections // from relationships (only node-like things) if (((next.getSourceFilter() == null) || next.getSourceFilter().matches(sourceType)) - && !isRelationship(modelingAssistantProvider, sourceType)) { + && !modelingAssistantProvider.isRelationshipType(sourceType)) { ModelingAssistantUtil.collectAllConcreteSubtypes(sourceType, modelingAssistantProvider, types); } } @@ -335,7 +339,7 @@ public class ModelingAssistantProviderOperations // The filter, if any, needs to match but we also don't want to propose connections // to relationships (only node-like things) if (((next.getTargetFilter() == null) || next.getTargetFilter().matches(targetType)) - && !isRelationship(modelingAssistantProvider, targetType)) { + && !modelingAssistantProvider.isRelationshipType(targetType)) { ModelingAssistantUtil.collectAllConcreteSubtypes(targetType, modelingAssistantProvider, types); } } @@ -536,4 +540,62 @@ public class ModelingAssistantProviderOperations return result.sort(alphabetical()).build(); } + /** + * + * + * + * @generated NOT + */ + public static EList getRelationshipTypes(ModelingAssistantProvider modelingAssistantProvider) + { + Set types = Sets.newLinkedHashSet(); + for (String next : modelingAssistantProvider.getRelationshipTypeIDs()) { + IElementType type = modelingAssistantProvider.getElementType(next); + if (type != null) { + types.add(type); + } + } + + ImmutableEListBuilder result = ECollections2.immutableEListBuilder(); + result.addAll(types); + return result.sort(alphabetical()).build(); + } + + /** + * + * + * + * @generated NOT + */ + @SuppressWarnings("unchecked") + public static boolean isRelationshipType(ModelingAssistantProvider modelingAssistantProvider, IElementType elementType) + { + Set relationshipTypes; + CacheAdapter cache = CacheAdapter.getCacheAdapter(modelingAssistantProvider); + if (cache == null) { + relationshipTypes = ImmutableSet.copyOf(modelingAssistantProvider.getRelationshipTypes()); + } else { + // We aren't going to use this EOperation having a parameter for any other cache, so use it for this + relationshipTypes = (Set) cache.get(modelingAssistantProvider.eResource(), modelingAssistantProvider, AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER___IS_RELATIONSHIP_TYPE__IELEMENTTYPE); + if (relationshipTypes == null) { + cache.put(modelingAssistantProvider.eResource(), modelingAssistantProvider, AssistantPackage.Literals.MODELING_ASSISTANT_PROVIDER___IS_RELATIONSHIP_TYPE__IELEMENTTYPE, + relationshipTypes = ImmutableSet.copyOf(modelingAssistantProvider.getRelationshipTypes())); + } + } + + boolean result = relationshipTypes.contains(elementType); + + if (!result) { + // Maybe it's a specialization of a relationship type + IElementType[] allSupers = elementType.getAllSuperTypes(); + + // The super types have the more specific types after the more general + for (int i = allSupers.length - 1; !result && (i >= 0); i--) { + result = relationshipTypes.contains(allSupers[i]); + } + } + + return result; + } + } // ModelingAssistantProviderOperations diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/core/util/ModelingAssistantUtil.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/core/util/ModelingAssistantUtil.java index bb176208ce9..602b6739d12 100644 --- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/core/util/ModelingAssistantUtil.java +++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/core/util/ModelingAssistantUtil.java @@ -34,7 +34,6 @@ import org.eclipse.gmf.runtime.emf.type.core.ISpecializationType; import org.eclipse.gmf.runtime.notation.Edge; import org.eclipse.gmf.runtime.notation.View; import org.eclipse.papyrus.infra.core.utils.AdapterUtils; -import org.eclipse.papyrus.infra.gmfdiag.assistant.ConnectionAssistant; import org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider; import org.eclipse.papyrus.infra.gmfdiag.assistant.internal.core.util.ProxyElementType; import org.eclipse.papyrus.infra.gmfdiag.common.commands.SemanticElementAdapter; @@ -345,19 +344,4 @@ public class ModelingAssistantUtil { collator.setStrength(Collator.PRIMARY); return Ordering.from(collator).onResultOf(primaryNameFunction()).compound(Ordering.natural().onResultOf(visualIDFunction())); } - - public static boolean isRelationship(ModelingAssistantProvider provider, IElementType elementType) { - boolean result = false; - - // A relationship is a type for which we provide connection assistants - for (ConnectionAssistant next : provider.getConnectionAssistants()) { - IElementType relationshipType = next.getElementType(); - if ((relationshipType != null) && isSubtype(elementType, relationshipType)) { - result = true; - break; - } - } - - return result; - } } diff --git a/plugins/uml/assistants/org.eclipse.papyrus.uml.profile.assistants.generator/src/org/eclipse/papyrus/uml/profile/assistants/generator/ModelingAssistantProviderRule.xtend b/plugins/uml/assistants/org.eclipse.papyrus.uml.profile.assistants.generator/src/org/eclipse/papyrus/uml/profile/assistants/generator/ModelingAssistantProviderRule.xtend index 5027642b9d8..c9cb22d39d9 100644 --- a/plugins/uml/assistants/org.eclipse.papyrus.uml.profile.assistants.generator/src/org/eclipse/papyrus/uml/profile/assistants/generator/ModelingAssistantProviderRule.xtend +++ b/plugins/uml/assistants/org.eclipse.papyrus.uml.profile.assistants.generator/src/org/eclipse/papyrus/uml/profile/assistants/generator/ModelingAssistantProviderRule.xtend @@ -57,6 +57,7 @@ class ModelingAssistantProviderRule { popupAssistants.addAll(ext.metaclass.diagramSpecificElementTypes.map[ext.toPopupAssistant(it)]) } else { // Connection assistants to create relationships + relationshipTypeIDs.addAll(profileElementTypes) connectionAssistants.addAll(ext.metaclass.diagramSpecificElementTypes.map[ext.toConnectionAssistant(it)]) } ] diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/model/classdiagram.assistants b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/model/classdiagram.assistants index b656fe9e8d8..08f47f01b2f 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/model/classdiagram.assistants +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/model/classdiagram.assistants @@ -518,4 +518,28 @@ org.eclipse.papyrus.uml.diagram.clazz.Dependency_2014 org.eclipse.papyrus.uml.diagram.clazz.Association_2015 org.eclipse.papyrus.uml.diagram.clazz.Dependency_2014 + org.eclipse.papyrus.uml.diagram.clazz.AssociationClass_4017 + org.eclipse.papyrus.uml.diagram.clazz.Association_4001 + org.eclipse.papyrus.uml.diagram.clazz.Association_4019 + org.eclipse.papyrus.uml.diagram.clazz.Generalization_4002 + org.eclipse.papyrus.uml.diagram.clazz.InterfaceRealization_4003 + org.eclipse.papyrus.uml.diagram.clazz.Substitution_4004 + org.eclipse.papyrus.uml.diagram.clazz.Realization_4005 + org.eclipse.papyrus.uml.diagram.clazz.Abstraction_4006 + org.eclipse.papyrus.uml.diagram.clazz.Usage_4007 + org.eclipse.papyrus.uml.diagram.clazz.Dependency_4008 + org.eclipse.papyrus.uml.diagram.clazz.Dependency_4018 + org.eclipse.papyrus.uml.diagram.clazz.ElementImport_4009 + org.eclipse.papyrus.uml.diagram.clazz.PackageImport_4010 + org.eclipse.papyrus.uml.diagram.clazz.PackageMerge_4011 + org.eclipse.papyrus.uml.diagram.clazz.ProfileApplication_4012 + org.eclipse.papyrus.uml.diagram.clazz.CommentAnnotatedElement_4013 + org.eclipse.papyrus.uml.diagram.clazz.ConstraintConstrainedElement_4014 + org.eclipse.papyrus.uml.diagram.clazz.TemplateBinding_4015 + org.eclipse.papyrus.uml.diagram.clazz.GeneralizationSet_4020 + org.eclipse.papyrus.uml.diagram.clazz.InstanceSpecificationLink_4021 + org.eclipse.papyrus.uml.diagram.clazz.TimeObservationEvent_4024 + org.eclipse.papyrus.uml.diagram.clazz.DurationObservationEvent_4025 + org.eclipse.papyrus.uml.diagram.clazz.InformationFlow_4026 + org.eclipse.papyrus.uml.diagram.clazz.ConstraintContext_8500 diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/models/usecaseDiagram.assistants b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/models/usecaseDiagram.assistants index 5e086a526a1..6df4285f75d 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/models/usecaseDiagram.assistants +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.usecase/models/usecaseDiagram.assistants @@ -217,4 +217,16 @@ org.eclipse.papyrus.uml.diagram.usecase.Realization_4017 org.eclipse.papyrus.uml.diagram.usecase.PackageMerge_4018 org.eclipse.papyrus.uml.diagram.usecase.PackageImport_4019 + org.eclipse.papyrus.uml.diagram.usecase.Include_4008 + org.eclipse.papyrus.uml.diagram.usecase.Extend_4009 + org.eclipse.papyrus.uml.diagram.usecase.Generalization_4010 + org.eclipse.papyrus.uml.diagram.usecase.Association_4011 + org.eclipse.papyrus.uml.diagram.usecase.ConstraintConstrainedElement_4012 + org.eclipse.papyrus.uml.diagram.usecase.Dependency_4013 + org.eclipse.papyrus.uml.diagram.usecase.CommentAnnotatedElement_4014 + org.eclipse.papyrus.uml.diagram.usecase.Abstraction_4015 + org.eclipse.papyrus.uml.diagram.usecase.Usage_4016 + org.eclipse.papyrus.uml.diagram.usecase.Realization_4017 + org.eclipse.papyrus.uml.diagram.usecase.PackageMerge_4018 + org.eclipse.papyrus.uml.diagram.usecase.PackageImport_4019 diff --git a/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/resources/j2ee-all.assistants b/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/resources/j2ee-all.assistants index 2fc1faa9cfd..6773b06aee8 100644 --- a/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/resources/j2ee-all.assistants +++ b/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/resources/j2ee-all.assistants @@ -268,4 +268,6 @@ org.eclipse.papyrus.uml.diagram.clazz.Association_2015 org.eclipse.papyrus.uml.diagram.clazz.Dependency_4018 org.eclipse.papyrus.uml.diagram.clazz.Dependency_2014 + org.eclipse.papyrus.example.j2ee.Import + org.eclipse.papyrus.example.j2ee.Web diff --git a/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/resources/j2ee-usecase.assistants b/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/resources/j2ee-usecase.assistants index 7a583335c82..ac81b0d7075 100644 --- a/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/resources/j2ee-usecase.assistants +++ b/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/resources/j2ee-usecase.assistants @@ -122,4 +122,6 @@ org.eclipse.papyrus.example.j2ee.WebScenario_3012 org.eclipse.papyrus.example.j2ee.WebScenario_2013 org.eclipse.papyrus.example.j2ee.WebScenario_2014 + org.eclipse.papyrus.example.j2ee.Import_4013 + org.eclipse.papyrus.example.j2ee.Web_4011 diff --git a/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/resources/test.assistants b/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/resources/test.assistants index a92253b3e28..52043825be4 100644 --- a/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/resources/test.assistants +++ b/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/resources/test.assistants @@ -14,4 +14,6 @@ org.eclipse.papyrus.uml.Package org.eclipse.papyrus.uml.Generalization org.eclipse.papyrus.uml.AssociationClass + org.eclipse.papyrus.uml.Usage + org.eclipse.papyrus.uml.Generalization diff --git a/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/AssistedElementTypeFilterTest.java b/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/AssistedElementTypeFilterTest.java index 88dfd8893e7..cac460ceaaa 100644 --- a/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/AssistedElementTypeFilterTest.java +++ b/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/AssistedElementTypeFilterTest.java @@ -15,12 +15,9 @@ import static org.eclipse.papyrus.infra.gmfdiag.assistant.tests.ElementTypesUtil import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.MatcherAssert.assertThat; - import java.util.Arrays; - import junit.framework.TestCase; import junit.textui.TestRunner; - import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.ResourceSet; diff --git a/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/ModelingAssistantProviderTest.java b/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/ModelingAssistantProviderTest.java index c54f45d5d29..cf66119a9db 100644 --- a/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/ModelingAssistantProviderTest.java +++ b/tests/junit/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant.tests/src-gen/org/eclipse/papyrus/infra/gmfdiag/assistant/tests/ModelingAssistantProviderTest.java @@ -53,6 +53,7 @@ import org.hamcrest.CoreMatchers; *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getElementTypes() Element Type}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getClientContext() Client Context}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getExcludedElementTypes() Excluded Element Type}
  • + *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getRelationshipTypes() Relationship Type}
  • * *

    *

    @@ -75,6 +76,7 @@ import org.hamcrest.CoreMatchers; * } *

  • {@link org.eclipse.gmf.runtime.emf.ui.services.modelingassistant.IModelingAssistantProvider#getTypesForPopupBar(org.eclipse.core.runtime.IAdaptable) Get Types For Popup Bar}
  • *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getElementType(java.lang.String) Get Element Type}
  • + *
  • {@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#isRelationshipType(org.eclipse.gmf.runtime.emf.type.core.IElementType) Is Relationship Type}
  • * *

    * @@ -215,6 +217,21 @@ public class ModelingAssistantProviderTest extends TestCase { assertThat(getFixture().getExcludedElementTypes(), hasItem(canonicalize(UMLElementTypes.ASSOCIATION_CLASS))); } + /** + * Tests the '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getRelationshipTypes() Relationship Type}' feature getter. + * + * + * + * @see org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#getRelationshipTypes() + * @generated NOT + */ + public void testGetRelationshipTypes() + { + assertThat(getFixture().getRelationshipTypes(), hasItem(canonicalize(UMLElementTypes.USAGE))); + assertThat(getFixture().getRelationshipTypes(), hasItem(canonicalize(UMLElementTypes.GENERALIZATION))); + assertThat(getFixture().getRelationshipTypes(), not(hasItem(canonicalize(UMLElementTypes.CLASS)))); + } + /** * Tests the '{@link org.eclipse.gmf.runtime.common.core.service.IProvider#provides(org.eclipse.gmf.runtime.common.core.service.IOperation) Provides}' operation. * @@ -480,4 +497,19 @@ public class ModelingAssistantProviderTest extends TestCase { assertThat(canonicalize(UMLElementTypes.CLASS), is(getFixture().getElementType("org.eclipse.papyrus.uml.Class"))); } + /** + * Tests the '{@link org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#isRelationshipType(org.eclipse.gmf.runtime.emf.type.core.IElementType) Is Relationship Type}' operation. + * + * + * + * @see org.eclipse.papyrus.infra.gmfdiag.assistant.ModelingAssistantProvider#isRelationshipType(org.eclipse.gmf.runtime.emf.type.core.IElementType) + * @generated NOT + */ + public void testIsRelationshipType__IElementType() + { + assertThat(getFixture().isRelationshipType(canonicalize(UMLElementTypes.USAGE)), is(true)); + assertThat(getFixture().isRelationshipType(canonicalize(UMLElementTypes.GENERALIZATION)), is(true)); + assertThat(getFixture().isRelationshipType(canonicalize(UMLElementTypes.CLASS)), is(false)); + } + } // ModelingAssistantProviderTest -- cgit v1.2.3