Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael ADAM2017-06-22 07:05:23 +0000
committervincent lorenzo2017-07-04 09:02:54 +0000
commitc37be71eef998f263b92368aceb9041b4afbc427 (patch)
treec5b9b9077488f1207c53cb9e0c2367c03e1d29d6
parent0628737af1be216d0baecc210622299e0887ebad (diff)
downloadorg.eclipse.papyrus-c37be71eef998f263b92368aceb9041b4afbc427.tar.gz
org.eclipse.papyrus-c37be71eef998f263b92368aceb9041b4afbc427.tar.xz
org.eclipse.papyrus-c37be71eef998f263b92368aceb9041b4afbc427.zip
Bug 517679 - [Diagram] Papyrus must provide a way to draw reference link
between elements https://bugs.eclipse.org/bugs/show_bug.cgi?id=517679 Change-Id: I8564c8c0b5e55cee0b3828f466f78c02dab449c9 Signed-off-by: Mickael ADAM <mickael.adam@all4tec.net> Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
-rwxr-xr-xplugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ReferenceEdgeEditPart.java118
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ReferenceEdgeNameEditPart.java381
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/AbstractShowHideRelatedLinkEditPolicy.java5
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/DefaultSemanticEditPolicy.java5
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/EdgeWithNoSemanticElementRepresentationImpl.java22
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/StereotypePropertyReferenceEdgeRepresentation.java117
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/TextSelectionEditPolicy.java232
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/edge/ReferenceEdgeFigure.java109
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/updater/UpdaterLinkDescriptor.java42
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/Domain2Notation.java15
-rw-r--r--plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/pom.xml2
-rw-r--r--plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/src/org/eclipse/papyrus/infra/gmfdiag/paletteconfiguration/widgets/editors/PaletteToolActionsPropertyEditor.java86
-rw-r--r--plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration/src/org/eclipse/papyrus/infra/gmfdiag/paletteconfiguration/messages/messages.properties8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/pom.xml2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/StereotypePropertyReferenceEdgeEditPart.java51
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractUMLShowHideRelatedLinkEditPolicy.java105
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/StereotypePropertyReferenceEdgeCleaningEditPolicy.java258
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/Messages.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/messages.properties1
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/StereotypePropertyReferenceEdgeEditPartFactory.java57
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/StereotypePropertyReferenceEdgeEditPartProvider.java108
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/StereotypePropertyReferenceEdgeViewFactory.java202
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/StereotypePropertyReferenceEdgeViewProvider.java101
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/stereotype/IStereotypePropertyReferenceEdgeAdvice.java56
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ShowHideRelatedLinkSelectionDialog.java14
-rwxr-xr-x[-rw-r--r--]plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLElementAdapter.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLElementProviderFactory.java1
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLTypedElementProviderFactory.java4
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/.classpath16
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations11
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/model/umldi.elementtypesconfigurations3
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/pom.xml2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/StereotypePropertyReferenceDestroyCommand.java178
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/StereotypePropertyReferenceReorientCommand.java357
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractFeatureRelationshipReorientEditHelperAdvice.java11
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractReferenceDeleteRelationshipEditHelperAdvice.java15
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/StereotypePropertyReferenceDestroyEditHelperAdvice.java89
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/StereotypePropertyReferenceReorientEditHelperAdvice.java45
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/StereotypePropertyReferenceSetEditHelperAdvice.java99
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ElementUtil.java47
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/.classpath2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/META-INF/MANIFEST.MF19
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/icons/full/ctool16/CreateElementTypeSetConfiguration_adviceBindingsConfigurations_StereotypePropertyReferenceEdgeAdviceConfiguration.gifbin0 -> 223 bytes
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/icons/full/obj16/StereotypePropertyReferenceEdgeAdviceConfiguration.gifbin0 -> 129 bytes
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/model/StereotypePropertyReferenceEdgeAdvice.ecore13
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/model/StereotypePropertyReferenceEdgeAdvice.genmodel16
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/plugin.properties5
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/plugin.xml41
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/pom.xml2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/StereotypePropertyReferenceEdgeAdviceConfiguration.java104
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/StereotypePropertyReferenceEdgeAdviceFactory.java42
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/StereotypePropertyReferenceEdgeAdvicePackage.java290
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/impl/StereotypePropertyReferenceEdgeAdviceConfigurationImpl.java272
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/impl/StereotypePropertyReferenceEdgeAdviceFactoryImpl.java95
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/impl/StereotypePropertyReferenceEdgeAdvicePackageImpl.java211
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/provider/StereotypePropertyReferenceEdgeAdviceConfigurationItemProvider.java195
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/provider/StereotypePropertyReferenceEdgeAdviceEditPlugin.java95
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/provider/StereotypePropertyReferenceEdgeAdviceItemProviderAdapterFactory.java303
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/util/StereotypePropertyReferenceEdgeAdviceAdapterFactory.java197
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/util/StereotypePropertyReferenceEdgeAdviceSwitch.java179
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/src/org/eclipse/papyrus/uml/types/core/advices/stereotypereferencelink/StereotypePropertyReferenceEdgeAdviceConfigurationFactory.java54
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/src/org/eclipse/papyrus/uml/types/core/advices/stereotypereferencelink/StereotypePropertyReferenceEdgeAdviceEditHelperAdvice.java208
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/src/org/eclipse/papyrus/uml/types/core/commands/EditStereotypePropertyReferenceCommand.java191
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/src/org/eclipse/papyrus/uml/types/core/commands/StereotypePropertyReferenceEdgeUtil.java423
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/plugin.xml4
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/pom.xml2
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/properties/StereotypePropertyReferenceEdgeAdvice.ctx32
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/properties/ui/SingleStereotypePropertyReferenceEdgeAdviceConfiguration.xwt20
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/src/org/eclipse/papyrus/uml/types/ui/properties/widgets/FeatureToSetNamePropertyEditor.java101
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/src/org/eclipse/papyrus/uml/types/ui/properties/widgets/FeatureToSetNameValueEditor.java5
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/.classpath14
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/pom.xml2
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/ElementUtil.java29
84 files changed, 6059 insertions, 184 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
index 6bbf1a5ef2f..ee9c075732f 100755
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
@@ -74,7 +74,7 @@ Require-Bundle: org.eclipse.emf.ecore.edit;bundle-version="[2.9.0,3.0.0)",
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
-Bundle-Version: 3.0.0.qualifier
+Bundle-Version: 3.1.0.qualifier
Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-Activator: org.eclipse.papyrus.infra.gmfdiag.common.Activator
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml
index a58268e02b4..4dcd3082aad 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/pom.xml
@@ -7,6 +7,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.gmfdiag.common</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ReferenceEdgeEditPart.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ReferenceEdgeEditPart.java
new file mode 100644
index 00000000000..00d1561336e
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ReferenceEdgeEditPart.java
@@ -0,0 +1,118 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.common.editpart;
+
+import org.eclipse.draw2d.Connection;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.edge.ReferenceEdgeFigure;
+
+/**
+ * {@link ConnectionEditPart} for Reference edge.
+ *
+ * @author Mickael ADAM
+ *
+ * @since 3.1
+ */
+public class ReferenceEdgeEditPart extends ConnectionEditPart implements ITreeBranchEditPart {
+
+ /**
+ * The visual Id.
+ */
+ public static final String VISUAL_ID = "ReferenceLink";//$NON-NLS-1$
+
+ /**
+ * Constructor.
+ *
+ * @param view
+ * The view.
+ */
+ public ReferenceEdgeEditPart(final View view) {
+ super(view);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.editpart.ConnectionEditPart#createDefaultEditPolicies()
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+ }
+
+ /**
+ * Add fixed child.
+ */
+ protected boolean addFixedChild(final EditPart childEditPart) {
+ if (childEditPart instanceof ReferenceEdgeNameEditPart) {
+ ((ReferenceEdgeNameEditPart) childEditPart).setLabel(getPrimaryShape().getEdgeLabel());
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#addChildVisual(org.eclipse.gef.EditPart, int)
+ */
+ protected void addChildVisual(final EditPart childEditPart, final int index) {
+ if (addFixedChild(childEditPart)) {
+ return;
+ }
+ super.addChildVisual(childEditPart, -1);
+ }
+
+ /**
+ * Remove fixed child.
+ */
+ protected boolean removeFixedChild(final EditPart childEditPart) {
+ if (childEditPart instanceof ReferenceEdgeNameEditPart) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#removeChildVisual(org.eclipse.gef.EditPart)
+ */
+ protected void removeChildVisual(final EditPart childEditPart) {
+ if (removeFixedChild(childEditPart)) {
+ return;
+ }
+ super.removeChildVisual(childEditPart);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart#createConnectionFigure()
+ */
+ protected Connection createConnectionFigure() {
+ return new ReferenceEdgeFigure();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart#getPrimaryShape()
+ */
+ public ReferenceEdgeFigure getPrimaryShape() {
+ return (ReferenceEdgeFigure) getFigure();
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ReferenceEdgeNameEditPart.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ReferenceEdgeNameEditPart.java
new file mode 100644
index 00000000000..267ed6b3f0a
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ReferenceEdgeNameEditPart.java
@@ -0,0 +1,381 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.common.editpart;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.PapyrusLinkLabelDragPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.TextSelectionEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * {@link PapyrusLabelEditPart} for the Reference edge.
+ *
+ * @since 3.1
+ */
+public class ReferenceEdgeNameEditPart extends PapyrusLabelEditPart {
+
+ /** The Constant FEATURE_TO_SET_KEY. */
+ private static final String FEATURE_TO_SET_KEY = "featureToSet"; //$NON-NLS-1$
+
+ /** The Constant EDGE_LABEL_KEY. */
+ private static final String EDGE_LABEL_KEY = "edgeLabel"; //$NON-NLS-1$
+
+ /** The Constant STEREOTYPE_PROPERTY_REFERENCE_EDGE_KEY. */
+ private static final String STEREOTYPE_PROPERTY_REFERENCE_EDGE_KEY = "StereotypePropertyReferenceEdge"; //$NON-NLS-1$
+
+ /** The Constant CSS_LABEL_VALUE_ATTRIBUTE_KEY. */
+ public static final String CSS_LABEL_VALUE_ATTRIBUTE_KEY = "label"; //$NON-NLS-1$
+
+ /**
+ * The Visual Id.
+ */
+ public static final String VISUAL_ID = "StereotypePropertyReferenceEdgeName"; //$NON-NLS-1$
+
+ /**
+ * The default text.
+ */
+ private String defaultText;
+
+
+ /**
+ * Register the snap back position;
+ */
+ static {
+ registerSnapBackPosition(ReferenceEdgeNameEditPart.VISUAL_ID, new Point(0, 60));
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param view
+ * The view.
+ */
+ public ReferenceEdgeNameEditPart(final View view) {
+ super(view);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart#createDefaultEditPolicies()
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new TextSelectionEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PapyrusLinkLabelDragPolicy());
+ }
+
+
+ /**
+ * Gets the label text helper.
+ *
+ * @param figure
+ * the figure
+ * @return the label text helper
+ */
+ protected String getLabelTextHelper(final IFigure figure) {
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else {
+ return ((Label) figure).getText();
+ }
+ }
+
+
+ /**
+ * Sets the label text helper.
+ *
+ * @param figure
+ * the figure
+ * @param text
+ * the text
+ */
+ protected void setLabelTextHelper(final IFigure figure, final String text) {
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setText(text);
+ } else {
+ ((Label) figure).setText(text);
+ }
+ }
+
+ /**
+ * Gets the label icon helper.
+ *
+ * @param figure
+ * the figure
+ * @return the label icon helper
+ */
+ protected Image getLabelIconHelper(final IFigure figure) {
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else {
+ return ((Label) figure).getIcon();
+ }
+ }
+
+ /**
+ * Sets the label icon helper.
+ *
+ * @param figure
+ * the figure
+ * @param icon
+ * the icon
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if (figure instanceof WrappingLabel) {
+ ((WrappingLabel) figure).setIcon(icon);
+ } else {
+ ((Label) figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * Set the label {@link IFigure}.
+ *
+ * @param figure
+ * the new label
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#getModelChildren()
+ */
+ protected List<?> getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#getChildBySemanticHint(java.lang.String)
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+
+ /**
+ * Gets the label icon.
+ *
+ * @return the label icon
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * Gets the label text.
+ *
+ * @return the label text
+ */
+ protected String getLabelText() {
+ String text = null;
+ // Get Text from Notation/CSS
+ if (text == null || text.length() == 0) {
+ text = NotationUtils.getStringValue((View) getParent().getModel(), CSS_LABEL_VALUE_ATTRIBUTE_KEY, null);
+ }
+ if (text == null || text.length() == 0) {
+ EAnnotation eAnnotation = ((View) getParent().getModel()).getEAnnotation(STEREOTYPE_PROPERTY_REFERENCE_EDGE_KEY);
+ if (eAnnotation != null) {
+ // Get Text from Advice link label value
+ text = eAnnotation.getDetails().get(EDGE_LABEL_KEY);
+ if (text == null || text.length() == 0) {
+ // Get Text from feature name
+ text = eAnnotation.getDetails().get(FEATURE_TO_SET_KEY);
+ }
+ }
+ }
+
+ if (text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * Sets the label text.
+ *
+ * @param text
+ * the new label text
+ */
+ public void setLabelText(final String text) {
+ setLabelTextHelper(getFigure(), text);
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart#refreshVisuals()
+ *
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * Refresh label.
+ */
+ protected void refreshLabel() {
+
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if (maskLabelPolicy == null) {
+ maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
+ }
+ if (maskLabelPolicy == null) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof TextSelectionEditPolicy) {
+ ((TextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if (sfEditPolicy instanceof TextSelectionEditPolicy) {
+ ((TextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * Refresh underline.
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ /**
+ * Refresh strike through.
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#refreshFont()
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#setFontColor(org.eclipse.swt.graphics.Color)
+ */
+ protected void setFontColor(final Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#addSemanticListeners()
+ */
+ protected void addSemanticListeners() {
+ // Do nothing
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#removeSemanticListeners()
+ */
+ protected void removeSemanticListeners() {
+ // Do nothing
+ }
+
+ /**
+ * Get the Font Style Owner View.
+ *
+ * @return the font style owner view
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart#handleNotificationEvent(org.eclipse.emf.common.notify.Notification)
+ */
+ protected void handleNotificationEvent(final Notification event) {
+ Object feature = event.getFeature();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ refreshUnderline();
+ } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
+ refreshStrikeThrough();
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
+ || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ refreshFont();
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart#createFigure()
+ */
+ protected IFigure createFigure() {
+ // Parent should assign one using setLabel() method
+ return null;
+ }
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/AbstractShowHideRelatedLinkEditPolicy.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/AbstractShowHideRelatedLinkEditPolicy.java
index aa729046467..ef66a0a0e2d 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/AbstractShowHideRelatedLinkEditPolicy.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/AbstractShowHideRelatedLinkEditPolicy.java
@@ -551,11 +551,6 @@ public abstract class AbstractShowHideRelatedLinkEditPolicy extends AbstractEdit
// we look for the link descriptor
UpdaterLinkDescriptor descriptor = getLinkDescriptor(linkToShow, linkDescriptors);
- if (linkToShow instanceof EdgeWithNoSemanticElementRepresentationImpl) {
- // we replace the specific link descriptor by a new one, with no model element (if not the view provider refuse to create the view
- final IElementType elementType = descriptor.getSemanticAdapter().getAdapter(IElementType.class);
- descriptor = new UpdaterLinkDescriptor(descriptor.getSource(), descriptor.getDestination(), elementType, descriptor.getVisualID());
- }
if (descriptor != null) {
Set<View> sourceViewList = domain2NotationMap.get(descriptor.getSource());
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/DefaultSemanticEditPolicy.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/DefaultSemanticEditPolicy.java
index 27aba0fa7ca..1583b58b0e7 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/DefaultSemanticEditPolicy.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/DefaultSemanticEditPolicy.java
@@ -107,6 +107,7 @@ public class DefaultSemanticEditPolicy extends SemanticEditPolicy {
String type = ((Connector) model).getType();
if (type != null) {
result.setParameter(RequestParameterConstants.VIEW_VISUAL_ID, type);
+ result.setParameter(RequestParameterConstants.AFFECTED_VIEW, model);
}
}
}
@@ -241,14 +242,14 @@ public class DefaultSemanticEditPolicy extends SemanticEditPolicy {
private Command getDefaultSemanticCommand(IEditCommandRequest req, Object context) {
try {
IClientContext clientContext = TypeContext.getContext(getEditingDomain());
-
+
IElementEditService commandService;
if (context != null) {
commandService = ElementEditServiceUtils.getCommandProvider(context, clientContext);
} else {
commandService = ElementEditServiceUtils.getCommandProvider(((IGraphicalEditPart) getHost()).resolveSemanticElement(), clientContext);
}
-
+
if (commandService != null) {
ICommand semanticCommand = commandService.getEditCommand(req);
if ((semanticCommand != null) && (semanticCommand.canExecute())) {
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/EdgeWithNoSemanticElementRepresentationImpl.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/EdgeWithNoSemanticElementRepresentationImpl.java
index 12f7c8f7020..84731711fae 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/EdgeWithNoSemanticElementRepresentationImpl.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/EdgeWithNoSemanticElementRepresentationImpl.java
@@ -27,17 +27,17 @@ public class EdgeWithNoSemanticElementRepresentationImpl extends EObjectImpl {
/**
* the semantic hint for the represented element
*/
- private String semanticHint;
+ protected String semanticHint;
/**
* the source of the link
*/
- private final EObject source;
+ protected final EObject source;
/**
* the target of the link
*/
- private final EObject target;
+ protected final EObject target;
/**
*
@@ -59,7 +59,7 @@ public class EdgeWithNoSemanticElementRepresentationImpl extends EObjectImpl {
/**
*
* @return
- * the source of the represented link
+ * the source of the represented link
*/
public EObject getSource() {
return source;
@@ -68,7 +68,7 @@ public class EdgeWithNoSemanticElementRepresentationImpl extends EObjectImpl {
/**
*
* @return
- * the target of the represented link
+ * the target of the represented link
*/
public EObject getTarget() {
return target;
@@ -77,7 +77,7 @@ public class EdgeWithNoSemanticElementRepresentationImpl extends EObjectImpl {
/**
*
* @return
- * a view for this link
+ * a view for this link
*/
public String getSemanticHint() {
return semanticHint;
@@ -90,14 +90,14 @@ public class EdgeWithNoSemanticElementRepresentationImpl extends EObjectImpl {
* @see java.lang.Object#hashCode()
*
* @return
- * the hashcode
+ * the hashcode
*/
@Override
public int hashCode() {
int result = 1;
- result= result + ((this.target == null) ? 0 : this.target.hashCode());
- result= result + 7 * ((this.source == null) ? 0 : this.source.hashCode());
- result= result + 11 * ((this.semanticHint == null) ? 0 : this.semanticHint.hashCode());
+ result = result + ((this.target == null) ? 0 : this.target.hashCode());
+ result = result + 7 * ((this.source == null) ? 0 : this.source.hashCode());
+ result = result + 11 * ((this.semanticHint == null) ? 0 : this.semanticHint.hashCode());
return result;
}
@@ -108,7 +108,7 @@ public class EdgeWithNoSemanticElementRepresentationImpl extends EObjectImpl {
* @param obj
* an object
* @return
- * <code>true</code> if this object is the same than the other one
+ * <code>true</code> if this object is the same than the other one
*/
@Override
public boolean equals(final Object obj) {
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/StereotypePropertyReferenceEdgeRepresentation.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/StereotypePropertyReferenceEdgeRepresentation.java
new file mode 100644
index 00000000000..4fa7bc3316b
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/StereotypePropertyReferenceEdgeRepresentation.java
@@ -0,0 +1,117 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.gmfdiag.common.editpolicies;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * Representation for stereotype property reference edge.
+ *
+ * @author Mickael ADAM
+ * @since 3.1
+ */
+public class StereotypePropertyReferenceEdgeRepresentation extends EdgeWithNoSemanticElementRepresentationImpl {
+
+ /** The hint for stereotype property reference edge< */
+ private static final String REFERENCE_LINK_HINT = "StereotypePropertyReferenceEdge";//$NON-NLS-1$
+
+ /** The stereotype Qualified name of the source. */
+ private String stereotypeQualifiedName;
+
+ /** The feature set into the source's stereotype application. */
+ private String featureToSet;
+
+ /** The edge label. */
+ private String edgeLabel;
+
+ /**
+ * Constructor.
+ *
+ * @param source
+ * The source of the edge.
+ * @param target
+ * The target of the edge.
+ * @param stereotype
+ * QualifiedName The stereotype qualified name of the source.
+ * @param featureToSet
+ * The feature set into the source's stereotype application.
+ */
+ public StereotypePropertyReferenceEdgeRepresentation(final EObject source, final EObject target, final String stereotypeQualifiedName, final String featureToSet, final String edgeLabel) {
+ super(source, target, REFERENCE_LINK_HINT);
+ this.stereotypeQualifiedName = stereotypeQualifiedName;
+ this.featureToSet = featureToSet;
+ this.edgeLabel = edgeLabel;
+ }
+
+ /**
+ * @return the stereotypeToSet
+ */
+ public String getStereotypeQualifiedName() {
+ return stereotypeQualifiedName;
+ }
+
+
+ /**
+ * @return the feature
+ */
+ public String getFeatureToSet() {
+ return featureToSet;
+ }
+
+
+ /**
+ * Calculate the hashcode in order to allows to have the same hashcode for 2 {@link StereotypePropertyReferenceEdgeRepresentation} with the same
+ * field values.
+ *
+ * @see java.lang.Object#hashCode()
+ *
+ * @return
+ * the hashcode
+ */
+ @Override
+ public int hashCode() {
+ int result = 17;
+ int constant = 37;
+ result = result + ((this.target == null) ? 0 : this.target.hashCode());
+ result = result * constant + ((this.source == null) ? 0 : this.source.hashCode());
+ result = result * constant + ((this.stereotypeQualifiedName == null) ? 0 : this.stereotypeQualifiedName.hashCode());
+ result = result * constant + ((this.featureToSet == null) ? 0 : this.featureToSet.hashCode());
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(final Object obj) {
+ if (obj instanceof StereotypePropertyReferenceEdgeRepresentation) {
+ final StereotypePropertyReferenceEdgeRepresentation otherLink = (StereotypePropertyReferenceEdgeRepresentation) obj;
+ return this.source == otherLink.getSource()
+ && this.target == otherLink.getTarget()
+ && this.stereotypeQualifiedName.equals(otherLink.getStereotypeQualifiedName())
+ && this.featureToSet.equals(otherLink.getFeatureToSet())
+ && this.semanticHint.equals(otherLink.getSemanticHint());
+ }
+ return false;
+ }
+
+ /**
+ * @return the edge label.
+ */
+ public String getEdgeLabel() {
+ return edgeLabel;
+ }
+
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/TextSelectionEditPolicy.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/TextSelectionEditPolicy.java
new file mode 100644
index 00000000000..cf6f07b363b
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/TextSelectionEditPolicy.java
@@ -0,0 +1,232 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.common.editpolicies;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FigureListener;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.editpolicies.SelectionEditPolicy;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+
+/**
+ * Non diagram-specific class generated by GMF Tooling.
+ *
+ * @since 3.1
+ */
+public class TextSelectionEditPolicy extends SelectionEditPolicy {
+
+ /** The selection feedback figure. */
+ private IFigure selectionFeedbackFigure;
+
+ /** The focus feedback figure. */
+ private IFigure focusFeedbackFigure;
+
+ /** The host position listener. */
+ private FigureListener hostPositionListener;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void showPrimarySelection() {
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setSelected(true);
+ ((WrappingLabel) getHostFigure()).setFocus(true);
+ } else {
+ showSelection();
+ showFocus();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void showSelection() {
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setSelected(true);
+ ((WrappingLabel) getHostFigure()).setFocus(false);
+ } else {
+ hideSelection();
+ addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
+ getHostFigure().addFigureListener(getHostPositionListener());
+ refreshSelectionFeedback();
+ hideFocus();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void hideSelection() {
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setSelected(false);
+ ((WrappingLabel) getHostFigure()).setFocus(false);
+ } else {
+ if (selectionFeedbackFigure != null) {
+ removeFeedback(selectionFeedbackFigure);
+ getHostFigure().removeFigureListener(getHostPositionListener());
+ selectionFeedbackFigure = null;
+ }
+ hideFocus();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void showFocus() {
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setFocus(true);
+ } else {
+ hideFocus();
+ addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
+ refreshFocusFeedback();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void hideFocus() {
+ if (getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getHostFigure()).setFocus(false);
+ } else {
+ if (focusFeedbackFigure != null) {
+ removeFeedback(focusFeedbackFigure);
+ focusFeedbackFigure = null;
+ }
+ }
+ }
+
+ /**
+ * Gets the feedback bounds.
+ *
+ * @return the feedback bounds
+ */
+ protected Rectangle getFeedbackBounds() {
+ Rectangle bounds;
+ if (getHostFigure() instanceof Label) {
+ bounds = ((Label) getHostFigure()).getTextBounds();
+ bounds.intersect(getHostFigure().getBounds());
+ } else {
+ bounds = getHostFigure().getBounds().getCopy();
+ }
+ getHostFigure().getParent().translateToAbsolute(bounds);
+ getFeedbackLayer().translateToRelative(bounds);
+ return bounds;
+ }
+
+ /**
+ * Creates the selection feedback figure.
+ *
+ * @return the {@link IFigure}
+ */
+ protected IFigure createSelectionFeedbackFigure() {
+ if (getHostFigure() instanceof Label) {
+ Label feedbackFigure = new Label();
+ feedbackFigure.setOpaque(true);
+ feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
+ feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
+ return feedbackFigure;
+ } else {
+ RectangleFigure feedbackFigure = new RectangleFigure();
+ feedbackFigure.setFill(false);
+ return feedbackFigure;
+ }
+ }
+
+ /**
+ * Creates the focus feedback figure.
+ *
+ * @return the {@link IFigure}
+ */
+ protected IFigure createFocusFeedbackFigure() {
+ return new Figure() {
+
+ @Override
+ protected void paintFigure(Graphics graphics) {
+ graphics.drawFocus(getBounds().getResized(-1, -1));
+ }
+ };
+ }
+
+ /**
+ * Update label.
+ *
+ * @param target
+ * the target
+ */
+ protected void updateLabel(final Label target) {
+ Label source = (Label) getHostFigure();
+ target.setText(source.getText());
+ target.setTextAlignment(source.getTextAlignment());
+ target.setFont(source.getFont());
+ }
+
+ /**
+ * Refresh selection feedback.
+ */
+ protected void refreshSelectionFeedback() {
+ if (selectionFeedbackFigure != null) {
+ if (selectionFeedbackFigure instanceof Label) {
+ updateLabel((Label) selectionFeedbackFigure);
+ selectionFeedbackFigure.setBounds(getFeedbackBounds());
+ } else {
+ selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
+ }
+ }
+ }
+
+ /**
+ * Refresh focus feedback.
+ */
+ protected void refreshFocusFeedback() {
+ if (focusFeedbackFigure != null) {
+ focusFeedbackFigure.setBounds(getFeedbackBounds());
+ }
+ }
+
+ /**
+ * Refresh feedback.
+ */
+ public void refreshFeedback() {
+ refreshSelectionFeedback();
+ refreshFocusFeedback();
+ }
+
+ /**
+ * Gets the host position listener.
+ *
+ * @return the host position listener
+ */
+ private FigureListener getHostPositionListener() {
+ if (hostPositionListener == null) {
+ hostPositionListener = new FigureListener() {
+
+ @Override
+ public void figureMoved(IFigure source) {
+ refreshFeedback();
+ }
+ };
+ }
+ return hostPositionListener;
+ }
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/edge/ReferenceEdgeFigure.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/edge/ReferenceEdgeFigure.java
new file mode 100644
index 00000000000..d1a05d1677c
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/edge/ReferenceEdgeFigure.java
@@ -0,0 +1,109 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.common.figure.edge;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.PolylineDecoration;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel;
+
+/**
+ * {@link PapyrusEdgeFigure} for references.
+ *
+ * @author Mickael ADAM
+ * @since 3.1
+ */
+public final class ReferenceEdgeFigure extends PapyrusEdgeFigure {
+
+ /**
+ * Creates a new DashEdgeFigure.
+ */
+ public ReferenceEdgeFigure() {
+ super();
+ setArrow(true);
+ setupDefaultStyle();
+ createContents();
+ }
+
+ /**
+ * Dashes used to paint line.
+ */
+ private final int[] dashes = new int[10];
+ /**
+ * use to if the arrow will be displayed
+ */
+ protected boolean arrow = false;
+
+ /**
+ * The name label.
+ */
+ private WrappingLabel nameLabel;
+
+ /**
+ * Get the name label.
+ */
+ public WrappingLabel getEdgeLabel() {
+ return nameLabel;
+ }
+
+ /**
+ * use to display the arrow of the edge
+ *
+ * @param arrow
+ * true if the arrow will be displayed
+ */
+ public void setArrow(final Boolean arrow) {
+ this.arrow = arrow;
+ }
+
+ /**
+ * Create the content.
+ */
+ protected void createContents() {
+ nameLabel = new PapyrusWrappingLabel();
+ nameLabel.setText("");//$NON-NLS-1$
+ this.add(nameLabel);
+ }
+
+ /**
+ * Resets the style of this figure to its default implementation
+ */
+ @Override
+ public void resetStyle() {
+ setupDefaultStyle();
+ }
+
+ /**
+ * Sets initial Style for the figure. It does not give any special Color for
+ * Background and Foreground. This is the style used for classic arrows:
+ * ------>
+ * This method should not be overridden as it defines the default style for the arrow.
+ * Instead, custom styles should be defined by overriding the resetStyle method.
+ */
+ protected final void setupDefaultStyle() {
+ if (arrow) {
+ PolylineDecoration dec = new PolylineDecoration();
+ dec.setScale(15, 5);
+ dec.setLineWidth(1);
+ this.setTargetDecoration(dec);
+ } else {
+ this.setTargetDecoration(null);
+ } // arrow at target endpoint
+ this.setLineStyle(Graphics.LINE_CUSTOM); // line drawing style
+
+ // set dashes
+ for (int i = 0; i < 10; i++) {
+ dashes[i] = 5;
+ }
+ setLineDash(dashes);
+ }
+} \ No newline at end of file
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/updater/UpdaterLinkDescriptor.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/updater/UpdaterLinkDescriptor.java
index e3d3d4807b2..3a6b793f8e2 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/updater/UpdaterLinkDescriptor.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/updater/UpdaterLinkDescriptor.java
@@ -8,6 +8,7 @@
*
* Contributors:
* CEA LIST - Initial API and implementation
+ * Mickaël ADAM (ALL4TEC) - mickael.adam@all4tec.net - Bug 517679
*
*****************************************************************************/
@@ -17,6 +18,7 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.EdgeWithNoSemanticElementRepresentationImpl;
/**
* @since 2.0
@@ -36,29 +38,35 @@ public class UpdaterLinkDescriptor extends UpdaterNodeDescriptor {
}
public UpdaterLinkDescriptor(EObject source, EObject destination, final IElementType elementType, String linkVID) {
- this(source, destination, (EObject) null, linkVID);
- mySemanticAdapter = new IAdaptable() {
-
- public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
- if (IElementType.class.equals(adapter)) {
- return elementType;
- }
- return null;
- }
- };
+ this(source, destination, (EObject) null, elementType, linkVID);
}
public UpdaterLinkDescriptor(EObject source, EObject destination, EObject linkElement, final IElementType elementType, String linkVID) {
this(source, destination, linkElement, linkVID);
- mySemanticAdapter = new EObjectAdapter(linkElement) {
- public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
- if (IElementType.class.equals(adapter)) {
- return elementType;
+ if (null != linkElement && !(linkElement instanceof EdgeWithNoSemanticElementRepresentationImpl)) {
+ mySemanticAdapter = new EObjectAdapter(linkElement) {
+
+ public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
+ if (IElementType.class.equals(adapter)) {
+ return elementType;
+ }
+ return super.getAdapter(adapter);
+ }
+ };
+ } else {
+ mySemanticAdapter = new IAdaptable() {
+
+ public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
+ if (IElementType.class.equals(adapter)) {
+ return elementType;
+ } else if (UpdaterLinkDescriptor.class.equals(adapter)) {
+ return UpdaterLinkDescriptor.this;
+ }
+ return null;
}
- return super.getAdapter(adapter);
- }
- };
+ };
+ }
}
public EObject getSource() {
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/Domain2Notation.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/Domain2Notation.java
index 15db6da9b59..e23ce5eeed7 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/Domain2Notation.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/Domain2Notation.java
@@ -9,6 +9,7 @@
*
* Contributors:
* Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ * Mickaël ADAM (ALL4TEC) - mickael.adam@all4tec.net - Bug 517679
*
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.utils;
@@ -18,12 +19,14 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.BasicCompartment;
import org.eclipse.gmf.runtime.notation.Connector;
import org.eclipse.gmf.runtime.notation.Shape;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.EdgeWithNoSemanticElementRepresentationImpl;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.StereotypePropertyReferenceEdgeRepresentation;
/**
@@ -67,7 +70,17 @@ public class Domain2Notation extends HashMap<EObject, Set<View>> {
if (element == null && view instanceof Connector) {
final EObject source = ((Connector) view).getSource().getElement();
final EObject target = ((Connector) view).getTarget().getElement();
- element = new EdgeWithNoSemanticElementRepresentationImpl(source, target, view.getType());
+ if (view.getType().equals("StereotypePropertyReferenceEdge")) {//$NON-NLS-1$
+ EAnnotation eAnnotation = view.getEAnnotation("StereotypePropertyReferenceEdge");//$NON-NLS-1$
+ if (null != eAnnotation) {
+ String stereotypeQualifyName = eAnnotation.getDetails().get("stereotypeQualifiedName");//$NON-NLS-1$
+ String featureToSet = eAnnotation.getDetails().get("featureToSet");//$NON-NLS-1$
+ String linkLabel = eAnnotation.getDetails().get("edgeLabel");//$NON-NLS-1$
+ element = new StereotypePropertyReferenceEdgeRepresentation(source, target, stereotypeQualifyName, featureToSet, linkLabel);
+ }
+ } else {
+ element = new EdgeWithNoSemanticElementRepresentationImpl(source, target, view.getType());
+ }
} else if (element == null) {
return;
}
diff --git a/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/META-INF/MANIFEST.MF
index e1a52548218..0078589111f 100644
--- a/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor;singleton:=true
-Bundle-Version: 3.0.0.qualifier
+Bundle-Version: 3.1.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.presentation.PaletteConfigurationEditorPlugin$Implementation
Bundle-Vendor: %providerName
diff --git a/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/pom.xml b/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/pom.xml
index 519e807e4c0..8acb217f887 100644
--- a/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/pom.xml
+++ b/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/pom.xml
@@ -8,6 +8,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/src/org/eclipse/papyrus/infra/gmfdiag/paletteconfiguration/widgets/editors/PaletteToolActionsPropertyEditor.java b/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/src/org/eclipse/papyrus/infra/gmfdiag/paletteconfiguration/widgets/editors/PaletteToolActionsPropertyEditor.java
index 70db2677b02..0f4064543a1 100644
--- a/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/src/org/eclipse/papyrus/infra/gmfdiag/paletteconfiguration/widgets/editors/PaletteToolActionsPropertyEditor.java
+++ b/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor/src/org/eclipse/papyrus/infra/gmfdiag/paletteconfiguration/widgets/editors/PaletteToolActionsPropertyEditor.java
@@ -53,7 +53,10 @@ import org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.editor.messages.Me
import org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.provider.ToolConfigurationItemProvider;
import org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration.utils.CreatePaletteItemUtil;
import org.eclipse.papyrus.infra.properties.ui.modelelement.DataSource;
+import org.eclipse.papyrus.infra.properties.ui.modelelement.DataSourceChangedEvent;
+import org.eclipse.papyrus.infra.properties.ui.modelelement.DataSourceFactory;
import org.eclipse.papyrus.infra.properties.ui.modelelement.EMFModelElement;
+import org.eclipse.papyrus.infra.properties.ui.modelelement.IDataSourceListener;
import org.eclipse.papyrus.infra.properties.ui.modelelement.ModelElement;
import org.eclipse.papyrus.infra.properties.ui.runtime.DisplayEngine;
import org.eclipse.papyrus.infra.properties.ui.runtime.PropertiesRuntime;
@@ -64,6 +67,7 @@ import org.eclipse.papyrus.infra.types.AbstractAdviceBindingConfiguration;
import org.eclipse.papyrus.infra.types.AdviceConfiguration;
import org.eclipse.papyrus.infra.types.ElementTypeConfiguration;
import org.eclipse.papyrus.infra.types.ElementTypeSetConfiguration;
+import org.eclipse.papyrus.infra.types.ExternallyRegisteredType;
import org.eclipse.papyrus.infra.types.SpecializationTypeConfiguration;
import org.eclipse.papyrus.infra.types.core.extensionpoints.IAdviceKindExtensionPoint;
import org.eclipse.papyrus.infra.types.core.factories.impl.AbstractAdviceBindingFactory;
@@ -146,6 +150,12 @@ public class PaletteToolActionsPropertyEditor implements CustomizablePropertyEdi
/** list of actions advice which have not to be show */
protected List<String> blackListedAdvice = new ArrayList<>(Collections.singleton("Set type"));//$NON-NLS-1$
+ /** The {@link DataSource} listener. */
+ private IDataSourceListener dataSourceListener;
+
+ /** True if the Property editor is loaded from the standalone editor(vs Palette customize editor.) */
+ private boolean standaloneEditor = false;
+
/** enumeration of existing entry types */
private enum ToolbarButtonIds {
UP, DOWN, ADD, DELETE
@@ -556,8 +566,13 @@ public class PaletteToolActionsPropertyEditor implements CustomizablePropertyEdi
if (!elementDescriptors.isEmpty()) {
ElementDescriptor elementDescriptor = elementDescriptors.get(0);
ElementTypeConfiguration elementTypeConfiguration = elementDescriptor.getElementType();
+
if (elementTypeConfiguration instanceof SpecializationTypeConfiguration) {
- elementTypeFound = ((SpecializationTypeConfiguration) elementTypeConfiguration).getSpecializedTypes().get(0);
+ if (!standaloneEditor && !(((SpecializationTypeConfiguration) elementTypeConfiguration).getSpecializedTypes().get(0) instanceof ExternallyRegisteredType)) {
+ elementTypeFound = ((SpecializationTypeConfiguration) elementTypeConfiguration).getSpecializedTypes().get(0);
+ } else {
+ elementTypeFound = elementTypeConfiguration;
+ }
}
}
return elementTypeFound;
@@ -707,9 +722,67 @@ public class PaletteToolActionsPropertyEditor implements CustomizablePropertyEdi
*/
@Override
public void setInput(final DataSource input) {
- this.input = input;
- initialize();
+ final DataSource oldInput = this.input;
+ if (input != oldInput) {
+ if (oldInput != null) {
+ unhookDataSourceListener(oldInput);
+ }
+
+ this.input = input;
+
+ if (input != null) {
+ hookDataSourceListener(input);
+ }
+ initialize();
+ }
+ }
+ /**
+ * Unhook the {@link DataSource} listener.
+ *
+ * @param oldInput
+ * the {@link DataSource} to unhook
+ * @since 3.1
+ */
+ protected void unhookDataSourceListener(final DataSource oldInput) {
+ oldInput.removeDataSourceListener(getDataSourceListener());
+ }
+
+ /**
+ * Hook the {@link DataSource} listener.
+ *
+ * @param oldInput
+ * the {@link DataSource} to hook
+ * @since 3.1
+ */
+ protected void hookDataSourceListener(final DataSource newInput) {
+ newInput.addDataSourceListener(getDataSourceListener());
+ }
+
+ /**
+ * @return the {@link DataSource} listener.
+ */
+ private IDataSourceListener getDataSourceListener() {
+ if (dataSourceListener == null) {
+ dataSourceListener = new IDataSourceListener() {
+
+ @Override
+ public void dataSourceChanged(DataSourceChangedEvent event) {
+ initialize();
+ actionsViewer.refresh();
+ Object elementAt = actionsViewer.getElementAt(0);
+ if (null != elementAt) {
+ actionsViewer.setSelection(new StructuredSelection(elementAt));
+ } else {
+ for (Control control : propertiesComposite.getChildren()) {
+ control.dispose();
+ }
+ }
+ }
+ };
+ }
+
+ return dataSourceListener;
}
/**
@@ -734,7 +807,7 @@ public class PaletteToolActionsPropertyEditor implements CustomizablePropertyEdi
*/
protected void initialize() {
if (null != property && null != input) {
- ModelElement modelElement = input.getModelElement(property);
+ ModelElement modelElement = DataSourceFactory.instance.getModelElementFromPropertyPath(input, property);
if (modelElement instanceof EMFModelElement) {
setEditingDomain((AdapterFactoryEditingDomain) ((EMFModelElement) modelElement).getDomain());
setToolSource(modelElement);
@@ -821,6 +894,7 @@ public class PaletteToolActionsPropertyEditor implements CustomizablePropertyEdi
if (null != result && 0 < result.length) {
elementTypeSetConfigurationSemantic = (ElementTypeSetConfiguration) result[0];
editingDomain.getResourceSet().getLoadOptions().put(PaletteRessourcesConstants.ELEMENTTYPE_SEMENTIC_RESSOURCE_IDENTIFIER, elementTypeSetConfigurationSemantic.eResource());
+ standaloneEditor = true;
setReadOnly(false);
} else {
setReadOnly(true);
@@ -908,6 +982,10 @@ public class PaletteToolActionsPropertyEditor implements CustomizablePropertyEdi
*/
public void refresh() {
actionsViewer.refresh();
+ Object elementAt = actionsViewer.getElementAt(0);
+ if (null != elementAt) {
+ actionsViewer.setSelection(new StructuredSelection(elementAt));
+ }
refreshButtons();
}
diff --git a/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration/src/org/eclipse/papyrus/infra/gmfdiag/paletteconfiguration/messages/messages.properties b/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration/src/org/eclipse/papyrus/infra/gmfdiag/paletteconfiguration/messages/messages.properties
index 1b804e75af5..5297793515f 100644
--- a/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration/src/org/eclipse/papyrus/infra/gmfdiag/paletteconfiguration/messages/messages.properties
+++ b/plugins/infra/gmfdiag/paletteconfiguration/org.eclipse.papyrus.infra.gmfdiag.paletteconfiguration/src/org/eclipse/papyrus/infra/gmfdiag/paletteconfiguration/messages/messages.properties
@@ -1,11 +1,3 @@
ConfigurationModelElement_ErrorNotString=The {0} must be a String.
ConfigurationModelElement_WarningNotSet=The {0} must be set.
IconDescriptorObservableValue_Undefined=<Undefined>
-PaletteToolActionsPropertyEditor_AddAction=
-PaletteToolActionsPropertyEditor_AppliedActions=
-PaletteToolActionsPropertyEditor_DownAction=
-PaletteToolActionsPropertyEditor_invalidAdvice=
-PaletteToolActionsPropertyEditor_RemoveAction=
-PaletteToolActionsPropertyEditor_selectElementTypeSetModelMessage=Select the Semantic ElementTypeSetConfiguration model to add Actions
-PaletteToolActionsPropertyEditor_selectElementTypeSetModelTitle=Select the Semantic ElementTypeSetConfiguration
-PaletteToolActionsPropertyEditor_UpAction=
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF
index 90adedac71d..a3ee53d32eb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF
@@ -90,7 +90,7 @@ Require-Bundle: org.eclipse.papyrus.extensionpoints.editors;bundle-version="[2.0
org.eclipse.papyrus.infra.internationalization.common;bundle-version="[1.0.0,2.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="[3.0.0,4.0.0)"
Bundle-Vendor: %providerName
-Bundle-Version: 3.0.0.qualifier
+Bundle-Version: 3.1.0.qualifier
Eclipse-BuddyPolicy: dependent
Bundle-Activator: org.eclipse.papyrus.uml.diagram.common.Activator
Bundle-ManifestVersion: 2
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml
index f8e452634cc..b8df48be71b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml
@@ -525,4 +525,22 @@
name="Automated Model Completion">
</page>
</extension>
+ <extension
+ point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders">
+ <editpartProvider
+ class="org.eclipse.papyrus.uml.diagram.common.providers.StereotypePropertyReferenceEdgeEditPartProvider">
+ <Priority
+ name="Lowest">
+ </Priority>
+ </editpartProvider>
+ </extension>
+ <extension
+ point="org.eclipse.gmf.runtime.diagram.core.viewProviders">
+ <viewProvider
+ class="org.eclipse.papyrus.uml.diagram.common.providers.StereotypePropertyReferenceEdgeViewProvider">
+ <Priority
+ name="Lowest">
+ </Priority>
+ </viewProvider>
+ </extension>
</plugin>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/pom.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/pom.xml
index c6db74cc8dc..98b279c0b90 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/pom.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/pom.xml
@@ -7,6 +7,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.uml.diagram.common</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/StereotypePropertyReferenceEdgeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/StereotypePropertyReferenceEdgeEditPart.java
new file mode 100644
index 00000000000..2e30f2199de
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/StereotypePropertyReferenceEdgeEditPart.java
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.ReferenceEdgeEditPart;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.StereotypePropertyReferenceEdgeCleaningEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice;
+
+/**
+ * {@link ReferenceEdgeEditPart} for Stereotype property reference
+ *
+ * @author Mickaël ADAM
+ *
+ * @since 3.1
+ */
+public class StereotypePropertyReferenceEdgeEditPart extends ReferenceEdgeEditPart {
+
+ /**
+ * The visual Id.
+ */
+ public static final String VISUAL_ID = IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT;
+
+ /**
+ * Constructor.
+ */
+ public StereotypePropertyReferenceEdgeEditPart(final View view) {
+ super(view);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.editpart.ReferenceEdgeEditPart#createDefaultEditPolicies()
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(StereotypePropertyReferenceEdgeCleaningEditPolicy.EDIT_POLICY_KEY, new StereotypePropertyReferenceEdgeCleaningEditPolicy());
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractUMLShowHideRelatedLinkEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractUMLShowHideRelatedLinkEditPolicy.java
index a17cbe29ffb..7cc57aef977 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractUMLShowHideRelatedLinkEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractUMLShowHideRelatedLinkEditPolicy.java
@@ -13,19 +13,25 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.commands.Command;
@@ -35,10 +41,14 @@ import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.window.Window;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.AbstractShowHideRelatedLinkEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.EdgeWithNoSemanticElementRepresentationImpl;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.StereotypePropertyReferenceEdgeRepresentation;
import org.eclipse.papyrus.infra.gmfdiag.common.updater.UpdaterLinkDescriptor;
import org.eclipse.papyrus.infra.gmfdiag.common.utils.Domain2Notation;
import org.eclipse.papyrus.uml.diagram.common.helper.LinkMappingHelper;
@@ -51,7 +61,10 @@ import org.eclipse.uml2.uml.Connector;
import org.eclipse.uml2.uml.Constraint;
import org.eclipse.uml2.uml.DirectedRelationship;
import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Extension;
import org.eclipse.uml2.uml.Relationship;
+import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.util.UMLUtil;
/**
@@ -63,6 +76,11 @@ public abstract class AbstractUMLShowHideRelatedLinkEditPolicy extends AbstractS
/**
+ * The qualify name of the stereotype property reference edge element type.
+ */
+ private static final String STEREOTYPE_PROPERTY_REFERENCE_EDGE_ELEMENT_TYPE_QN = "org.eclipse.papyrus.umldi.StereotypePropertyReferenceEdge"; //$NON-NLS-1$
+
+ /**
*
* Constructor.
*
@@ -94,7 +112,7 @@ public abstract class AbstractUMLShowHideRelatedLinkEditPolicy extends AbstractS
* @param domain2NotationMap
* @param linksDescriptors
* @return
- * the command which open a dialog to ask for the user to select visible links, chained with the command to show/hide the links according
+ * the command which open a dialog to ask for the user to select visible links, chained with the command to show/hide the links according
* to the user selection
*/
@Override
@@ -110,7 +128,7 @@ public abstract class AbstractUMLShowHideRelatedLinkEditPolicy extends AbstractS
linkMapping.put(link, createLinkEndMapper((Element) link, current));
} else if (link instanceof EdgeWithNoSemanticElementRepresentationImpl) {
final EObject source = ((EdgeWithNoSemanticElementRepresentationImpl) link).getSource();
- if (source instanceof Comment || source instanceof Constraint) {
+ if (source instanceof Comment || source instanceof Constraint || STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT.equals(current.getVisualID())) {
linkMapping.put(link, createLinkEndMapper((Element) source, current));
}
}
@@ -133,7 +151,7 @@ public abstract class AbstractUMLShowHideRelatedLinkEditPolicy extends AbstractS
* @param descriptor
* the link descriptor
* @return
- * the collection of link descriptors without some invalid descriptor (we get this case when the link doesn't have source AND target, but
+ * the collection of link descriptors without some invalid descriptor (we get this case when the link doesn't have source AND target, but
* only ends)
*/
@Override
@@ -190,7 +208,7 @@ public abstract class AbstractUMLShowHideRelatedLinkEditPolicy extends AbstractS
/**
*
* @return
- * <code>true</code> if the link is oriented and <code>false</code> if not.
+ * <code>true</code> if the link is oriented and <code>false</code> if not.
* If not, that is to say than {@link LinkMappingHelper} should returns the same values for sources and targets
*/
public static final boolean isAnOrientedLink(final EObject link) {
@@ -202,6 +220,8 @@ public abstract class AbstractUMLShowHideRelatedLinkEditPolicy extends AbstractS
return false;
} else if (link instanceof Comment || link instanceof Constraint) {
return true;
+ } else if (link instanceof StereotypePropertyReferenceEdgeRepresentation) {
+ return true;
}
return false;
}
@@ -214,13 +234,13 @@ public abstract class AbstractUMLShowHideRelatedLinkEditPolicy extends AbstractS
* @param element
* an element
* @return
- * a linkEndsMapper according to this element
+ * a linkEndsMapper according to this element
*/
public static final LinkEndsMapper createLinkEndMapper(final Element element, final UpdaterLinkDescriptor descriptor) {
Collection<?> ends;
Collection<?> sources;
Collection<?> targets;
- if (element instanceof Comment || element instanceof Constraint) {
+ if (element instanceof Comment || element instanceof Constraint || STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT.equals(descriptor.getVisualID())) {
ends = Collections.emptyList();
sources = Collections.singletonList(descriptor.getSource());
targets = Collections.singletonList(descriptor.getDestination());
@@ -241,7 +261,7 @@ public abstract class AbstractUMLShowHideRelatedLinkEditPolicy extends AbstractS
* @param domain
* the editing domain
* @return
- * the command to open the dialog to choose the link to show
+ * the command to open the dialog to choose the link to show
*/
protected ICommand getOpenDialogCommand(final TransactionalEditingDomain domain, final Collection<EditPart> selectedEditPart, final Map<EditPart, Set<EObject>> availableLinks, final Collection<EObject> initialSelection,
final Map<EObject, LinkEndsMapper> linkMapping) {
@@ -278,4 +298,75 @@ public abstract class AbstractUMLShowHideRelatedLinkEditPolicy extends AbstractS
protected ILabelProvider getLabelProvider() {
return new UMLLabelProvider();
}
+
+ /**
+ * Collects all related links for view.
+ *
+ * @param view
+ * the view
+ * @param domain2NotationMap
+ * the domain2 notation map
+ * @return linkdescriptors
+ */
+ protected Collection<? extends UpdaterLinkDescriptor> collectPartRelatedLinks(final View view, final Domain2Notation domain2NotationMap) {
+ Collection<UpdaterLinkDescriptor> result = new LinkedList<UpdaterLinkDescriptor>();
+ result.addAll(super.collectPartRelatedLinks(view, domain2NotationMap));
+
+ // Get existing outgoing links
+ List<? extends UpdaterLinkDescriptor> outgoingDescriptors = getOutgoingStereotypePropertyReferenceLinks(view);
+ result.addAll(outgoingDescriptors);
+
+ return removeInvalidLinkDescriptor(result);
+ }
+
+ /**
+ * Get Outgoing Stereotype Property Reference Links for the given view.
+ *
+ * @since 3.1
+ */
+ protected List<UpdaterLinkDescriptor> getOutgoingStereotypePropertyReferenceLinks(final View view) {
+ Element element = (Element) view.getElement();
+ LinkedList<UpdaterLinkDescriptor> result = new LinkedList<UpdaterLinkDescriptor>();
+ if (null != element) {
+
+ IElementType type = ElementTypeRegistry.getInstance().getType(STEREOTYPE_PROPERTY_REFERENCE_EDGE_ELEMENT_TYPE_QN);
+
+ // gets all applied stereotype
+ EList<Stereotype> appliedStereotypes = element.getAppliedStereotypes();
+
+ for (Stereotype stereotype : appliedStereotypes) {
+ Stereotype actual = (stereotype == null) ? null : org.eclipse.papyrus.uml.tools.utils.UMLUtil.getAppliedSubstereotype(element, stereotype);
+ EObject stereotypeApplication = (actual == null) ? null : element.getStereotypeApplication(actual);
+
+ EList<EStructuralFeature> eAllStructuralFeatures = stereotypeApplication.eClass().getEAllStructuralFeatures();
+ // For each structural feature if set
+ for (EStructuralFeature eStructuralFeature : eAllStructuralFeatures) {
+ Object featureValue = stereotypeApplication.eGet(eStructuralFeature);
+
+ // If it's not the base feature
+ if (!eStructuralFeature.getName().startsWith(Extension.METACLASS_ROLE_PREFIX)) {
+
+ // gets The stereotype which contains the feature
+ Stereotype stereotypeFeatureContainer = (Stereotype) stereotype.getAllAttributes().stream().filter(p -> p.getName().equals(eStructuralFeature.getName())).findFirst().get().eContainer();
+
+ // Create edge representation
+ if (1 == eStructuralFeature.getUpperBound()) {
+ Element target = UMLUtil.getBaseElement((EObject) featureValue);
+ final StereotypePropertyReferenceEdgeRepresentation edgeRepresentation = new StereotypePropertyReferenceEdgeRepresentation(element, null == target ? (Element) featureValue : target, stereotypeFeatureContainer.getQualifiedName(),
+ eStructuralFeature.getName(), eStructuralFeature.getName());
+ result.add(new UpdaterLinkDescriptor(element, null == target ? (Element) featureValue : target, edgeRepresentation, type, STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT));
+ } else if (featureValue instanceof List) {
+ for (Object value : (List<?>) featureValue) {
+ Element target = UMLUtil.getBaseElement((EObject) value);
+ final StereotypePropertyReferenceEdgeRepresentation edgeRepresentation = new StereotypePropertyReferenceEdgeRepresentation(element, null == target ? (Element) value : target, stereotypeFeatureContainer.getQualifiedName(),
+ eStructuralFeature.getName(), eStructuralFeature.getName());
+ result.add(new UpdaterLinkDescriptor(element, null == target ? (Element) value : target, edgeRepresentation, type, STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT));
+ }
+ }
+ }
+ }
+ }
+ }
+ return result;
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/StereotypePropertyReferenceEdgeCleaningEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/StereotypePropertyReferenceEdgeCleaningEditPolicy.java
new file mode 100644
index 00000000000..53aad558333
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/StereotypePropertyReferenceEdgeCleaningEditPolicy.java
@@ -0,0 +1,258 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import static org.eclipse.papyrus.uml.diagram.common.Activator.log;
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.FEATURE_TO_SET_ANNOTATION_KEY;
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT;
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_QUALIFIED_NAME_ANNOTATION_KEY;
+
+import java.util.Collections;
+import java.util.Map;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.transaction.Transaction;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.AbstractEMFOperation;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.AbstractEditPolicy;
+import org.eclipse.gmf.runtime.common.core.util.StringStatics;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
+import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer;
+import org.eclipse.gmf.runtime.diagram.ui.util.EditPartUtil;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.tools.listeners.StereotypeElementListener.StereotypeExtensionNotification;
+import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.Type;
+
+/**
+ * Edit policy for stereotype property reference edge which delete edge when related Profile or Stereotype are unapplyed.
+ *
+ * @author Mickael ADAM
+ * @since 3.1
+ */
+public class StereotypePropertyReferenceEdgeCleaningEditPolicy extends AbstractEditPolicy implements EditPolicy, NotificationListener {
+
+ /** The feature related to the edge. */
+ private String featureToSet;
+
+ /** The stereotype qualify name of the source which contains the feature */
+ private String stereotypeQualifyName;
+
+ /**
+ * The Key of this edit policy.
+ */
+ final public static String EDIT_POLICY_KEY = "REMOVE_INVALID_STEREOTYPE_REFERENCE_EDGE_EDIT_POLICY";//$NON-NLS-1$
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#activate()
+ */
+ @Override
+ public void activate() {
+ // listen source to know if stereotype
+ Edge edge = (Edge) getHost().getModel();
+
+ EAnnotation eAnnotation = ((View) edge).getEAnnotation(STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT);
+ if (null != eAnnotation) {
+ stereotypeQualifyName = eAnnotation.getDetails().get(STEREOTYPE_QUALIFIED_NAME_ANNOTATION_KEY);
+ featureToSet = eAnnotation.getDetails().get(FEATURE_TO_SET_ANNOTATION_KEY);
+ }
+
+ DiagramEventBroker diagramEventBroker = getDiagramEventBroker();
+ diagramEventBroker.addNotificationListener(getSourceElement(), this);
+ diagramEventBroker.addNotificationListener(getTargetElement(), this);
+
+ if (null == stereotypeQualifyName || null == featureToSet || !checkSourceStereotype() || !checkTargetStereotype()) {
+ destroyView();
+ }
+
+ }
+
+ /**
+ * Gets the diagram event broker from the editing domain.
+ *
+ * @return the diagram event broker
+ */
+ protected DiagramEventBroker getDiagramEventBroker() {
+ TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
+ if (theEditingDomain != null) {
+ return DiagramEventBroker.getInstance(theEditingDomain);
+ }
+ return null;
+ }
+
+ /**
+ * Get the target element.
+ */
+ protected Element getTargetElement() {
+ Edge edge = (Edge) getHost().getModel();
+ View target = edge.getTarget();
+ return null == target ? null : (Element) target.getElement();
+ }
+
+ /**
+ * Get the source element.
+ */
+ protected Element getSourceElement() {
+ Edge edge = (Edge) getHost().getModel();
+ View source = edge.getSource();
+ return null == source ? null : (Element) source.getElement();
+ }
+
+ /**
+ * Check the target stereotype.
+ */
+ private boolean checkTargetStereotype() {
+ boolean targetOk = false;
+
+ Stereotype sourceStereotype = getSourceElement().getApplicableStereotype(stereotypeQualifyName);
+ Property attribute = sourceStereotype.getAttribute(featureToSet, null);
+ if (null != attribute) {
+ Type targetType = attribute.getType();
+ if (targetType instanceof Stereotype) {
+ // feature as stereotype reference
+ targetOk = ElementUtil.hasStereotypeApplied(getTargetElement(), targetType.getQualifiedName());
+ } else {
+ targetOk = true;
+ }
+ }
+
+ return targetOk;
+ }
+
+ /**
+ * Check the source stereotype.
+ */
+ public boolean checkSourceStereotype() {
+ return null != getSourceElement() && ElementUtil.hasStereotypeApplied(getSourceElement(), stereotypeQualifyName);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.common.notify.Adapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ public void notifyChanged(final Notification notification) {
+
+ if (notification instanceof StereotypeExtensionNotification) {
+ if (getSourceElement() != null && getTargetElement() != null) {
+ if (null == stereotypeQualifyName || null == featureToSet || !checkSourceStereotype() || !checkTargetStereotype()) {
+ destroyView();
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns a {@link Command} to delete the supplied {@link View}.
+ *
+ * @param view
+ * view to delete
+ * @return the command that destroys the specified view
+ */
+ protected Command getDeleteViewCommand(final View view) {
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
+ return new ICommandProxy(new DeleteCommand(editingDomain, view));
+ }
+
+ /**
+ * Destroy obsolete view.
+ */
+ protected void destroyView() {
+ EditPart host = getHost();
+ View view = (View) host.getModel();
+ if (host instanceof IGraphicalEditPart) {
+ Command deleteViewCommand = getDeleteViewCommand(view);
+ if (deleteViewCommand != null && deleteViewCommand.canExecute()) {
+ executeCommand(deleteViewCommand);
+ }
+ }
+ }
+
+ /**
+ * Executes the supplied command inside an <code>unchecked action</code>
+ *
+ * @param cmd
+ * command that can be executed (i.e., cmd.canExecute() == true)
+ */
+ protected void executeCommand(final Command cmd) {
+ Map<String, Boolean> options = null;
+ EditPart ep = getHost();
+ boolean isActivating = true;
+ // use the viewer to determine if we are still initializing the diagram
+ // do not use the DiagramEditPart.isActivating since
+ // ConnectionEditPart's
+ // parent will not be a diagram edit part
+ EditPartViewer viewer = ep.getViewer();
+ if (viewer instanceof DiagramGraphicalViewer) {
+ isActivating = ((DiagramGraphicalViewer) viewer).isInitializing();
+ }
+
+ if (isActivating || !EditPartUtil.isWriteTransactionInProgress((IGraphicalEditPart) getHost(), false, false)) {
+ options = Collections.singletonMap(Transaction.OPTION_UNPROTECTED, Boolean.TRUE);
+ }
+
+ AbstractEMFOperation operation = new AbstractEMFOperation(((IGraphicalEditPart) getHost()).getEditingDomain(), StringStatics.BLANK, options) {
+
+ @Override
+ protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ cmd.execute();
+ return Status.OK_STATUS;
+ }
+
+ @Override
+ protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ cmd.undo();
+ return Status.OK_STATUS;
+ }
+ };
+ try {
+ operation.execute(new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ log.error(e);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#deactivate()
+ */
+ @Override
+ public void deactivate() {
+ getDiagramEventBroker().removeNotificationListener(getSourceElement(), this);
+ getDiagramEventBroker().removeNotificationListener(getTargetElement(), this);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/Messages.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/Messages.java
index 86579c5325b..dc570a910dc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/Messages.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/Messages.java
@@ -34,6 +34,8 @@ public class Messages extends NLS {
public static String ShowHideRelatedLinkSelectionDialog_Sources;
+ public static String ShowHideRelatedLinkSelectionDialog_StereotypePropertyReferenceLabel;
+
public static String ShowHideRelatedLinkSelectionDialog_Ends;
public static String ShowHideRelatedLinkSelectionDialog_LinksToDisplay;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/messages.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/messages.properties
index 365038c99f7..7986221e649 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/messages.properties
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/messages/messages.properties
@@ -15,6 +15,7 @@ ShowHideRelatedLinkSelectionDialog_CommentLink=Comment Link
ShowHideRelatedLinkSelectionDialog_ConstraintLink=Constraint Link
ShowHideRelatedLinkSelectionDialog_Targets=Targets
ShowHideRelatedLinkSelectionDialog_Sources=Sources
+ShowHideRelatedLinkSelectionDialog_StereotypePropertyReferenceLabel=Stereotype Property Reference
ShowHideRelatedLinkSelectionDialog_Ends=Ends
ShowHideRelatedLinkSelectionDialog_LinksToDisplay=Links To Display
ShowHideRelatedLinkSelectionDialog_LinkKind=Link Kind
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/StereotypePropertyReferenceEdgeEditPartFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/StereotypePropertyReferenceEdgeEditPartFactory.java
new file mode 100644
index 00000000000..016c8f8646e
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/StereotypePropertyReferenceEdgeEditPartFactory.java
@@ -0,0 +1,57 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.providers;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartFactory;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.ReferenceEdgeEditPart;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.ReferenceEdgeNameEditPart;
+import org.eclipse.papyrus.uml.diagram.common.editparts.StereotypePropertyReferenceEdgeEditPart;
+
+/**
+ * {@link EditPartFactory} for Papyrus generic edit parts.
+ *
+ * @author Mickaël ADAM
+ *
+ * @since 3.1
+ */
+public class StereotypePropertyReferenceEdgeEditPartFactory implements EditPartFactory {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gef.EditPartFactory#createEditPart(org.eclipse.gef.EditPart, java.lang.Object)
+ */
+ @Override
+ public EditPart createEditPart(final EditPart context, final Object model) {
+ EditPart editPart = null;
+ if (model instanceof View) {
+ View view = (View) model;
+ switch (view.getType()) {
+
+ case ReferenceEdgeEditPart.VISUAL_ID:
+ editPart = new ReferenceEdgeEditPart(view);
+ break;
+ case StereotypePropertyReferenceEdgeEditPart.VISUAL_ID:
+ editPart = new StereotypePropertyReferenceEdgeEditPart(view);
+ break;
+ case ReferenceEdgeNameEditPart.VISUAL_ID:
+ editPart = new ReferenceEdgeNameEditPart(view);
+ break;
+ }
+ }
+ return editPart;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/StereotypePropertyReferenceEdgeEditPartProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/StereotypePropertyReferenceEdgeEditPartProvider.java
new file mode 100644
index 00000000000..fb44e1b737c
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/StereotypePropertyReferenceEdgeEditPartProvider.java
@@ -0,0 +1,108 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.providers;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.providers.DefaultEditPartProvider;
+import org.eclipse.papyrus.infra.gmfdiag.common.structure.DiagramStructure;
+
+/**
+ * EditPartProvider for papyrus generic edit part which are not associated to a diagram.
+ *
+ * @author Mickaël ADAM
+ *
+ * @since 3.1
+ */
+public class StereotypePropertyReferenceEdgeEditPartProvider extends DefaultEditPartProvider {
+
+ /**
+ * The expected model id for this DefaultEditPartProvider.
+ */
+ private static final String EXPECTED_MODEL_ID = "PapyrusEditPartProviderModelID";//$NON-NLS-1$
+
+ /**
+ * Constructor.
+ */
+ public StereotypePropertyReferenceEdgeEditPartProvider() {
+ super(new StereotypePropertyReferenceEdgeEditPartFactory(), new DiagramStructureExtension(), EXPECTED_MODEL_ID);
+ }
+
+ /**
+ * Empty {@link DiagramStructure} to permits to use {@link DefaultEditPartProvider} in all diagram.
+ *
+ * @author Mickael ADAM
+ */
+ private static final class DiagramStructureExtension extends DiagramStructure {
+ /**
+ * {@inheritDoc
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.structure.DiagramStructure#isSemanticLeafVisualID(java.lang.String)
+ */
+ @Override
+ public boolean isSemanticLeafVisualID(final String visualID) {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.structure.DiagramStructure#isCompartmentVisualID(java.lang.String)
+ */
+ @Override
+ public boolean isCompartmentVisualID(final String visualID) {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.structure.DiagramStructure#getVisualID(org.eclipse.gmf.runtime.notation.View)
+ */
+ @Override
+ public String getVisualID(final View view) {
+ return view.getType();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.structure.DiagramStructure#getNodeVisualID(org.eclipse.gmf.runtime.notation.View, org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ public String getNodeVisualID(final View containerView, final EObject domainElement) {
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.structure.DiagramStructure#getModelID(org.eclipse.gmf.runtime.notation.View)
+ */
+ @Override
+ public String getModelID(final View view) {
+ return EXPECTED_MODEL_ID;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.structure.DiagramStructure#checkNodeVisualID(org.eclipse.gmf.runtime.notation.View, org.eclipse.emf.ecore.EObject, java.lang.String)
+ */
+ @Override
+ public boolean checkNodeVisualID(final View containerView, final EObject domainElement, final String candidate) {
+ return false;
+ }
+ }
+
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/StereotypePropertyReferenceEdgeViewFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/StereotypePropertyReferenceEdgeViewFactory.java
new file mode 100644
index 00000000000..912389efb2c
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/StereotypePropertyReferenceEdgeViewFactory.java
@@ -0,0 +1,202 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.providers;
+
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.EDGE_LABEL_ANNOTATION_KEY;
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.FEATURE_TO_SET_ANNOTATION_KEY;
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT;
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_QUALIFIED_NAME_ANNOTATION_KEY;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.core.view.factories.ViewFactory;
+import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
+import org.eclipse.gmf.runtime.notation.Connector;
+import org.eclipse.gmf.runtime.notation.DecorationNode;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.Location;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.NotationFactory;
+import org.eclipse.gmf.runtime.notation.RelativeBendpoints;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.ReferenceEdgeNameEditPart;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.StereotypePropertyReferenceEdgeRepresentation;
+import org.eclipse.papyrus.infra.gmfdiag.common.updater.UpdaterLinkDescriptor;
+import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
+import org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice;
+
+/**
+ * {@link ViewFactory} for stereotype property reference edge.
+ *
+ * @author Mickael ADAM
+ *
+ * @since 3.1
+ */
+public class StereotypePropertyReferenceEdgeViewFactory implements ViewFactory {
+
+
+ /**
+ * Constructor.
+ */
+ public StereotypePropertyReferenceEdgeViewFactory() {
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.diagram.core.view.factories.ViewFactory#createView(org.eclipse.core.runtime.IAdaptable, org.eclipse.gmf.runtime.notation.View, java.lang.String, int, boolean, org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint)
+ */
+ @Override
+ public View createView(final IAdaptable semanticAdapter, final View containerView, final String semanticHint, final int index, final boolean persisted, final PreferencesHint preferencesHint) {
+ Edge view = null;
+ if (semanticHint.equals(STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT)) {
+ view = createStereotypePropertyReferenceEdge(semanticAdapter, containerView, index, persisted, preferencesHint);
+ }
+ return view;
+ }
+
+ /**
+ * Create the stereotype property reference edge.
+ */
+ @SuppressWarnings("unchecked")
+ public Edge createStereotypePropertyReferenceEdge(final IAdaptable semanticAdapter, final View containerView, final int index, final boolean persisted, final PreferencesHint preferencesHint) {
+ IEditHelperAdvice[] advices = ElementTypeRegistry.getInstance().getEditHelperAdvice(semanticAdapter.getAdapter(IElementType.class));
+ Connector edge = NotationFactory.eINSTANCE.createConnector();
+ edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
+ RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
+ List<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
+ points.add(new RelativeBendpoint());
+ points.add(new RelativeBendpoint());
+ bendpoints.setPoints(points);
+ edge.setBendpoints(bendpoints);
+ ViewUtil.insertChildView(containerView, edge, index, persisted);
+ edge.setType(STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT);
+
+ // Reference link is not attached to a semantic element
+ edge.setElement(null);
+
+ Node referenceLink_NameLabel = createLabel(edge, ReferenceEdgeNameEditPart.VISUAL_ID);
+ referenceLink_NameLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ Location referenceLink_NameLabel_Location = (Location) referenceLink_NameLabel.getLayoutConstraint();
+ referenceLink_NameLabel_Location.setX(0);
+ referenceLink_NameLabel_Location.setY(20);
+
+ StereotypePropertyReferenceEdgeRepresentation linkDescriptor = getStereotypePropertyReferenceEdgeRepresentation(advices, semanticAdapter);
+
+ // set annotation
+ EAnnotation eAnnotation = createAnnotation(linkDescriptor);
+ if (null != eAnnotation) {
+ edge.getEAnnotations().add(eAnnotation);
+ }
+
+ // initializePreferences
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+ PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, getStereotypePropertyReferenceEdgeId(linkDescriptor));
+ PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, getStereotypePropertyReferenceEdgeId(linkDescriptor));
+
+ return edge;
+ }
+
+ /**
+ * Create the annotation for the edge.
+ *
+ * @param edgeDescriptor
+ * The edge descriptor
+ * @return the created annotation.
+ */
+ protected EAnnotation createAnnotation(final StereotypePropertyReferenceEdgeRepresentation edgeDescriptor) {
+ EAnnotation eAnnotation = null;
+ if (null != edgeDescriptor) {
+ eAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
+ eAnnotation.setSource(STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT);
+ eAnnotation.getDetails().put(FEATURE_TO_SET_ANNOTATION_KEY, edgeDescriptor.getFeatureToSet());
+ eAnnotation.getDetails().put(STEREOTYPE_QUALIFIED_NAME_ANNOTATION_KEY, edgeDescriptor.getStereotypeQualifiedName());
+ eAnnotation.getDetails().put(EDGE_LABEL_ANNOTATION_KEY, edgeDescriptor.getEdgeLabel());
+ }
+ return eAnnotation;
+ }
+
+ /**
+ * Get the stereotype property reference edge representation.
+ *
+ * @param advices
+ * The list of advices where to look
+ * @param semanticAdapter
+ * The semantic adapter to look at if not
+ */
+ protected StereotypePropertyReferenceEdgeRepresentation getStereotypePropertyReferenceEdgeRepresentation(final IEditHelperAdvice[] advices, final IAdaptable semanticAdapter) {
+ StereotypePropertyReferenceEdgeRepresentation linkDescriptor = getStereotypePropertyReferenceEdgeRepresentation(advices);
+
+ // If no advice to get information open dialog
+ if (null == linkDescriptor) {
+ UpdaterLinkDescriptor UpdaterLinkDescriptor = semanticAdapter.getAdapter(UpdaterLinkDescriptor.class);
+ EObject modelElement = UpdaterLinkDescriptor.getModelElement();
+ if (modelElement instanceof StereotypePropertyReferenceEdgeRepresentation) {
+ linkDescriptor = (StereotypePropertyReferenceEdgeRepresentation) modelElement;
+ }
+ }
+ return linkDescriptor;
+ }
+
+ /**
+ * Create A {@link DecorationNode} label.
+ *
+ * @param owner
+ * The owner of the label.
+ * @param hint
+ * The hint of the label.
+ * @return the created label.
+ */
+ protected Node createLabel(final View owner, final String hint) {
+ DecorationNode rv = NotationFactory.eINSTANCE.createDecorationNode();
+ rv.setType(hint);
+ ViewUtil.insertChildView(owner, rv, ViewUtil.APPEND, true);
+ return rv;
+ }
+
+ /**
+ * Get the {@link StereotypePropertyReferenceEdgeRepresentation} from an array of of {@link IEditHelperAdvice}.
+ */
+ protected StereotypePropertyReferenceEdgeRepresentation getStereotypePropertyReferenceEdgeRepresentation(final IEditHelperAdvice[] advices) {
+ StereotypePropertyReferenceEdgeRepresentation descriptor = null;
+ for (IEditHelperAdvice advice : advices) {
+ if (advice instanceof IStereotypePropertyReferenceEdgeAdvice) {
+ String stereotypeQualifyName = ((IStereotypePropertyReferenceEdgeAdvice) advice).getStereotypeQualifiedName();
+ String featureToSet = ((IStereotypePropertyReferenceEdgeAdvice) advice).getFeatureToSet();
+ String linkLabel = ((IStereotypePropertyReferenceEdgeAdvice) advice).getEdgeLabel();
+ if (null != stereotypeQualifyName && null != featureToSet) {
+ descriptor = new StereotypePropertyReferenceEdgeRepresentation(null, null, stereotypeQualifyName, featureToSet, linkLabel);
+ }
+ }
+ }
+ return descriptor;
+ }
+
+ /**
+ * Get stereotype property reference link Id from {@link StereotypePropertyReferenceEdgeRepresentation}.
+ */
+ protected String getStereotypePropertyReferenceEdgeId(final StereotypePropertyReferenceEdgeRepresentation linkDescriptor) {
+ return linkDescriptor.getStereotypeQualifiedName() + "::" + linkDescriptor.getFeatureToSet();//$NON-NLS-1$
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/StereotypePropertyReferenceEdgeViewProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/StereotypePropertyReferenceEdgeViewProvider.java
new file mode 100644
index 00000000000..fabd9a8c6ae
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/StereotypePropertyReferenceEdgeViewProvider.java
@@ -0,0 +1,101 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.providers;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind;
+import org.eclipse.papyrus.infra.gmfdiag.common.providers.CustomAbstractViewProvider;
+import org.eclipse.papyrus.infra.gmfdiag.common.providers.GraphicalTypeRegistry;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
+import org.eclipse.papyrus.infra.gmfdiag.representation.PapyrusDiagram;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+import org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice;
+
+/**
+ * View provider for papyrus view used in all diagram.
+ *
+ * @author Mickael ADAM
+ *
+ * @since 3.1
+ */
+public class StereotypePropertyReferenceEdgeViewProvider extends CustomAbstractViewProvider {
+
+ /** Map containing node view types supported by this provider. */
+ protected Map<String, Class<?>> nodeMap = new HashMap<String, Class<?>>();
+
+ /** Map containing edge view types supported by this provider. */
+ protected Map<String, Class<?>> edgeMap = new HashMap<String, Class<?>>();
+
+ /**
+ * Constructor.
+ */
+ public StereotypePropertyReferenceEdgeViewProvider() {
+ this.registry = new PapyrusGraphicalTypeRegistry();
+ edgeMap.put(IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT, StereotypePropertyReferenceEdgeViewFactory.class);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * We check that it's a Papyrus diagram.
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.providers.CustomAbstractViewProvider#isRelevantDiagram(org.eclipse.gmf.runtime.notation.Diagram)
+ */
+ @Override
+ protected boolean isRelevantDiagram(final Diagram diagram) {
+ ViewPrototype prototype = DiagramUtils.getPrototype(diagram);
+ PapyrusRepresentationKind representationKind = null;
+ if (prototype != null) {
+ representationKind = prototype.getRepresentationKind();
+ }
+ return representationKind instanceof PapyrusDiagram;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.providers.AbstractViewProvider#getNodeViewClass(org.eclipse.core.runtime.IAdaptable, org.eclipse.gmf.runtime.notation.View, java.lang.String)
+ */
+ @Override
+ protected Class<?> getNodeViewClass(final IAdaptable semanticAdapter, final View containerView, final String graphicalType) {
+ return nodeMap.get(graphicalType);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.providers.AbstractViewProvider#getEdgeViewClass(org.eclipse.core.runtime.IAdaptable, org.eclipse.gmf.runtime.notation.View, java.lang.String)
+ */
+ @Override
+ protected Class<?> getEdgeViewClass(final IAdaptable semanticAdapter, final View containerView, final String graphicalType) {
+ return edgeMap.get(graphicalType);
+ }
+
+ /**
+ * Graphical Type Registry specific to this view provider.
+ */
+ public class PapyrusGraphicalTypeRegistry extends GraphicalTypeRegistry {
+ /**
+ * Constructor.
+ */
+ public PapyrusGraphicalTypeRegistry() {
+ knownEdges.add(IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT);
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/stereotype/IStereotypePropertyReferenceEdgeAdvice.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/stereotype/IStereotypePropertyReferenceEdgeAdvice.java
new file mode 100644
index 00000000000..7115b65bf71
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/stereotype/IStereotypePropertyReferenceEdgeAdvice.java
@@ -0,0 +1,56 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.stereotype;
+
+/**
+ * Interface for stereotype property reference edge advice. It include used keywords.
+ *
+ * @author Mickaël ADAM
+ *
+ * @since 3.1
+ */
+public interface IStereotypePropertyReferenceEdgeAdvice {
+
+ /** The Constant STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT. */
+ public static final String STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT = "StereotypePropertyReferenceEdge";//$NON-NLS-1$
+
+ /** The Constant STEREOTYPE_QUALIFY_NAME_ANNOTATION_KEY. */
+ public static final String STEREOTYPE_QUALIFIED_NAME_ANNOTATION_KEY = "stereotypeQualifiedName";//$NON-NLS-1$
+
+ /** The Constant FEATURE_TO_SET_ANNOTATION_KEY. */
+ public static final String FEATURE_TO_SET_ANNOTATION_KEY = "featureToSet";//$NON-NLS-1$
+
+ /** The Constant EDGE_LABEL_ANNOTATION_KEY. */
+ public static final String EDGE_LABEL_ANNOTATION_KEY = "edgeLabel";//$NON-NLS-1$
+
+ /**
+ * Get the feature to set.
+ *
+ * @return the feature name to set as a {@link String}.
+ */
+ public String getFeatureToSet();
+
+ /**
+ * Get the stereotype qualify name.
+ *
+ * @return the stereotype qualify name of the source to set as a {@link String}.
+ */
+ public String getStereotypeQualifiedName();
+
+ /**
+ * Get the edge label.
+ *
+ * @return the edge label to display as a {@link String}.
+ */
+ public String getEdgeLabel();
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ShowHideRelatedLinkSelectionDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ShowHideRelatedLinkSelectionDialog.java
index 8dbbc9eae41..d7835d0a881 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ShowHideRelatedLinkSelectionDialog.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ShowHideRelatedLinkSelectionDialog.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
+ * Copyright (c) 2017 CEA LIST.
*
*
* All rights reserved. This program and the accompanying materials
@@ -9,6 +9,7 @@
*
* Contributors:
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ * Mickaël ADAM (ALL4TEC) - mickael.adam@all4tec.net - Bug 517679
*
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.common.ui.dialogs;
@@ -37,6 +38,7 @@ import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.EdgeWithNoSemanticElementRepresentationImpl;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.StereotypePropertyReferenceEdgeRepresentation;
import org.eclipse.papyrus.uml.diagram.common.dialogs.AbstractCheckedTreeColumnViewerSelectionDialog;
import org.eclipse.papyrus.uml.diagram.common.messages.Messages;
import org.eclipse.papyrus.uml.diagram.common.util.LinkEndsMapper;
@@ -59,7 +61,7 @@ public class ShowHideRelatedLinkSelectionDialog extends AbstractCheckedTreeColum
/**
* the width for the first column
*/
- private final int FIRST_COLUMN_WIDTH = 180;
+ private final int FIRST_COLUMN_WIDTH = 200;
/**
* the width for the others columns
@@ -186,7 +188,7 @@ public class ShowHideRelatedLinkSelectionDialog extends AbstractCheckedTreeColum
/**
*
* @return
- * the checkedStateListener to use
+ * the checkedStateListener to use
*/
protected ICheckStateListener getOrCreateCheckStateListener() {
if (this.checkedStateListener == null) {
@@ -269,7 +271,7 @@ public class ShowHideRelatedLinkSelectionDialog extends AbstractCheckedTreeColum
/**
*
* @return
- * the checkedStateProvider to use for this dialog
+ * the checkedStateProvider to use for this dialog
*/
protected ICheckStateProvider getOrCreateCheckStateProvider() {
if (this.checkedStateProvider == null) {
@@ -367,6 +369,8 @@ public class ShowHideRelatedLinkSelectionDialog extends AbstractCheckedTreeColum
}
if (source instanceof Constraint) {
return Messages.ShowHideRelatedLinkSelectionDialog_ConstraintLink;
+ } else if (element instanceof StereotypePropertyReferenceEdgeRepresentation) {
+ return Messages.ShowHideRelatedLinkSelectionDialog_StereotypePropertyReferenceLabel;
}
}
if (element instanceof EObject) {
@@ -427,6 +431,8 @@ public class ShowHideRelatedLinkSelectionDialog extends AbstractCheckedTreeColum
return Messages.ShowHideRelatedLinkSelectionDialog_CommentLink;
} else if (source instanceof Constraint) {
return Messages.ShowHideRelatedLinkSelectionDialog_ConstraintLink;
+ } else if (element instanceof StereotypePropertyReferenceEdgeRepresentation) {
+ return ((StereotypePropertyReferenceEdgeRepresentation) element).getStereotypeQualifiedName() + "::" + ((StereotypePropertyReferenceEdgeRepresentation) element).getFeatureToSet();//$NON-NLS-1$
}
}
return labelProvider.getText(element);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLElementAdapter.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLElementAdapter.java
index 66e6bd75d63..978210cd8bb 100644..100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLElementAdapter.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLElementAdapter.java
@@ -10,14 +10,18 @@
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Celine Janssens (ALL4TEC) celine.janssens@all4tec.net - Bug 455311 : Refactor Stereotypes Display
* Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - bug 461489: add supports of AcceptEventAction
+ * Mickaël ADAM (ALL4TEC) - mickael.adam@all4tec.net - Bug 517679
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.css.dom;
-
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.FEATURE_TO_SET_ANNOTATION_KEY;
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT;
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_QUALIFIED_NAME_ANNOTATION_KEY;
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
@@ -54,6 +58,11 @@ public class GMFUMLElementAdapter extends GMFElementAdapter {
/**
+ * The Constant STEREOTYPE_REFERENCE_EDGE_SOURCE_APPLIED_STEREOTYPES_PROPERTY.
+ */
+ private static final String STEREOTYPE_REFERENCE_EDGE_SOURCE_APPLIED_STEREOTYPES_PROPERTY = "sourceAppliedStereotypes";//$NON-NLS-1$
+
+ /**
* Name of the CSS Simple Selector to match on the Stereotype Compartment Shape
*/
private static final String STEREOTYPE_COMMENT = "StereotypeComment"; //$NON-NLS-1$
@@ -69,9 +78,11 @@ public class GMFUMLElementAdapter extends GMFElementAdapter {
/** The Constant IS_FRAMEZABLE. */
public static final String IS_FRAME = "isFrame"; //$NON-NLS-1$
-
- /** CSS property to verify if a stereotype is applied on the type of a TypedElement */
- public static final String TYPE_APPLIED_STEREOTYPES_PROPERTY = "typeAppliedStereotypes"; //$NON-NLS-1$
+
+ /**
+ * CSS property to verify if a stereotype is applied on the type of a TypedElement
+ */
+ private static final String TYPE_APPLIED_STEREOTYPES_PROPERTY = "typeAppliedStereotypes"; //$NON-NLS-1$
/**
@@ -144,7 +155,7 @@ public class GMFUMLElementAdapter extends GMFElementAdapter {
return ListHelper.deepToString(appliedStereotypes, CSS_VALUES_SEPARATOR);
}
}
-
+
if (TYPE_APPLIED_STEREOTYPES_PROPERTY.equals(attr) && semanticElement instanceof TypedElement) {
Type type = ((TypedElement) semanticElement).getType();
if (type != null) {
@@ -159,7 +170,7 @@ public class GMFUMLElementAdapter extends GMFElementAdapter {
}
}
}
-
+
for (EObject stereotypeApplication : currentElement.getStereotypeApplications()) {
EStructuralFeature feature = stereotypeApplication.eClass().getEStructuralFeature(attr);
if (feature != null) {
@@ -199,16 +210,35 @@ public class GMFUMLElementAdapter extends GMFElementAdapter {
return String.valueOf(isAcceptTimeEventAction((AcceptEventAction) semanticElement));
}
}
+
// manage of isFraezable=true attribute for dislaying header/frame
- if(IS_FRAME.equals(attr)){
- if(notationElement.eContainer()==notationElement.getDiagram()){
+ if (IS_FRAME.equals(attr)) {
+ if (notationElement.eContainer() == notationElement.getDiagram()) {
return String.valueOf(true);
- }
- else{
+ } else {
return String.valueOf(false);
}
}
}
+
+ // manage of stereotype reference link
+ if (STEREOTYPE_REFERENCE_EDGE_SOURCE_APPLIED_STEREOTYPES_PROPERTY.equals(attr)) {
+ if (null != notationElement && STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT.equals(notationElement.getType())) {
+ EAnnotation eAnnotation = notationElement.getEAnnotation(STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT);
+ if (null != eAnnotation) {
+ return eAnnotation.getDetails().get(STEREOTYPE_QUALIFIED_NAME_ANNOTATION_KEY);
+ }
+ }
+ }
+ if (FEATURE_TO_SET_ANNOTATION_KEY.equals(attr)) {
+ if (null != notationElement && STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT.equals(notationElement.getType())) {
+ EAnnotation eAnnotation = notationElement.getEAnnotation(STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT);
+ if (null != eAnnotation) {
+ return eAnnotation.getDetails().get(FEATURE_TO_SET_ANNOTATION_KEY);
+ }
+ }
+ }
+
return null;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLElementProviderFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLElementProviderFactory.java
index c215c42215d..8786617d96b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLElementProviderFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLElementProviderFactory.java
@@ -23,7 +23,6 @@ import org.eclipse.uml2.uml.Element;
* @author Camille Letavernier
*
*/
-@SuppressWarnings("restriction")
public class GMFUMLElementProviderFactory implements ICSSElementProviderFactory {
@Override
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLTypedElementProviderFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLTypedElementProviderFactory.java
index d4ad2dcf1ce..cb0a9cda3f3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLTypedElementProviderFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/src/org/eclipse/papyrus/uml/diagram/css/dom/GMFUMLTypedElementProviderFactory.java
@@ -11,10 +11,6 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.css.dom;
-import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagram;
-import org.eclipse.papyrus.infra.gmfdiag.css.provider.IPapyrusElementProvider;
-import org.eclipse.papyrus.uml.diagram.css.dom.GMFUMLElementProviderFactory;
-
/**
* IElementProvider Factory for Diagrams related to UML TypedElements
*
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/.classpath b/plugins/uml/org.eclipse.papyrus.uml.service.types/.classpath
index bb54830aca2..2d78bdf032a 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/.classpath
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/.classpath
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="src-gen"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src-gen"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/.settings/org.eclipse.jdt.core.prefs b/plugins/uml/org.eclipse.papyrus.uml.service.types/.settings/org.eclipse.jdt.core.prefs
index 410244d65a6..62a08f4494d 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/META-INF/MANIFEST.MF b/plugins/uml/org.eclipse.papyrus.uml.service.types/META-INF/MANIFEST.MF
index 61a8348ab9c..a8552c7031b 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/META-INF/MANIFEST.MF
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/META-INF/MANIFEST.MF
@@ -16,7 +16,7 @@ Require-Bundle: org.eclipse.papyrus.uml.diagram.common;bundle-version="[3.0.0,4.
org.eclipse.papyrus.infra.emf.gmf
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
-Bundle-Version: 3.0.0.qualifier
+Bundle-Version: 3.1.0.qualifier
Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-Activator: org.eclipse.papyrus.uml.service.types.Activator
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations b/plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations
index 189e421709f..78b34b9ff27 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations
@@ -813,6 +813,9 @@
<editHelperAdviceConfiguration xsi:type="elementtypesconfigurations:EditHelperAdviceConfiguration" xmi:id="_509PMLhLEeSANYuUIb1qQA" editHelperAdviceClassName="org.eclipse.papyrus.uml.service.types.helper.advice.PropertyPartHelperAdvice"/>
<specializedTypes xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="../../../plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Property"/>
</elementTypeConfigurations>
+ <elementTypeConfigurations xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="org.eclipse.papyrus.uml.Property.Reference" identifier="org.eclipse.papyrus.uml.Property.Reference" name="UML::Property::Reference" hint="UML::Property::Reference">
+ <specializedTypes xsi:type="elementtypesconfigurations:ExternallyRegisteredType" href="../../../plugin/org.eclipse.papyrus.uml.service.types/model/umldi.elementtypesconfigurations#org.eclipse.gmf.runtime.emf.type.core.null"/>
+ </elementTypeConfigurations>
<elementTypeConfigurations xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" xmi:id="org.eclipse.papyrus.uml.ProtocolConformance" identifier="org.eclipse.papyrus.uml.ProtocolConformance" name="UML::ProtocolConformance" hint="UML::ProtocolConformance" editHelperClassName="org.eclipse.papyrus.uml.service.types.helper.ProtocolConformanceEditHelper">
<iconEntry xmi:id="_Sc-1eVYCEeS0WsAAtVmToA" iconPath="/icons/full/obj16/ProtocolConformance.gif" bundleId="org.eclipse.uml2.uml.edit"/>
<eClass href="http://www.eclipse.org/uml2/5.0.0/UML#//ProtocolConformance"/>
@@ -961,6 +964,7 @@
<iconEntry xmi:id="_SdDG-FYCEeS0WsAAtVmToA" iconPath="/icons/full/obj16/Stereotype.gif" bundleId="org.eclipse.uml2.uml.edit"/>
<eClass href="http://www.eclipse.org/uml2/5.0.0/UML#//Stereotype"/>
</elementTypeConfigurations>
+ <elementTypeConfigurations xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="org.eclipse.papyrus.StereotypePropertyReference" identifier="org.eclipse.papyrus.StereotypePropertyReference" name="UML::Stereotype::Property::Reference" hint="UML::Stereotype::Property::References" specializedTypes="org.eclipse.papyrus.uml.Property.Reference"/>
<elementTypeConfigurations xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" xmi:id="org.eclipse.papyrus.uml.StringExpression" identifier="org.eclipse.papyrus.uml.StringExpression" name="UML::StringExpression" hint="UML::StringExpression" editHelperClassName="org.eclipse.papyrus.uml.service.types.helper.ElementEditHelper">
<iconEntry xmi:id="_SdDHBlYCEeS0WsAAtVmToA" iconPath="/icons/full/obj16/StringExpression.gif" bundleId="org.eclipse.uml2.uml.edit"/>
<eClass href="http://www.eclipse.org/uml2/5.0.0/UML#//StringExpression"/>
@@ -1117,7 +1121,12 @@
<adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_pSKXgBa4EeaJFJ1Mo_kk8w" identifier="org.eclipse.papyrus.uml.advice.CommentDestroyAnnotatedElements" target="org.eclipse.papyrus.uml.Comment" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.uml.service.types.helper.advice.CommentDestroyAnnotatedElementsEditHelperAdvice"/>
<adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_mqX8YMHdEeSpuJnfbRdiWQ" identifier="org.eclipse.papyrus.uml.advice.Containment" target="org.eclipse.papyrus.uml.Element" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.uml.service.types.helper.advice.ElementOwnedElementReorientEditHelperAdvice"/>
<adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_6AWx0MJaEeSl6M4_Zhyt7Q" identifier="org.eclipse.papyrus.uml.advice.ConstraintConstrainedElementsReorient" target="org.eclipse.papyrus.uml.Constraint" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.uml.service.types.helper.advice.ConstraintConstrainedElementsReorientEditHelperAdvice"/>
- <adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_Biw5sMdFEeS1POoqrCEMrQ" identifier="org.eclipse.papyrus.uml.advice.CommentAnnotatedElementsReorient" target="org.eclipse.papyrus.uml.Comment" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.uml.service.types.helper.advice.CommentAnnotatedElementsReorientEditHelperAdvice"/>
+ <adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_Biw5sMdFEeS1POoqrCEMrQ" description="" identifier="org.eclipse.papyrus.uml.advice.CommentAnnotatedElementsReorient" target="org.eclipse.papyrus.uml.Comment" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.uml.service.types.helper.advice.CommentAnnotatedElementsReorientEditHelperAdvice"/>
+ <adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_6RSpMEUTEeeiG9SnzxhgUQ" description="" identifier="org.eclipse.papyrus.uml.advice.StereotypePropertyReferenceReorientEditHelperAdvice" target="org.eclipse.papyrus.uml.Element" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.uml.service.types.helper.advice.StereotypePropertyReferenceReorientEditHelperAdvice"/>
+ <adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_ID_7oFWdEee8aO8EwpogNQ" description="Helper advice on ojbect to delete reference view at stereotype reference changes" identifier="org.eclipse.papyrus.uml.advice.StereotypePropertyReferenceSetEditHelperAdvice" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.uml.service.types.helper.advice.StereotypePropertyReferenceSetEditHelperAdvice">
+ <target xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="../../org.eclipse.papyrus.infra.emf/model/infra-emf.elementtypesconfigurations#org.eclipse.papyrus.infra.emf.page"/>
+ </adviceBindingsConfigurations>
+ <adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_Xzwb0Ed1EeeUmcF0Apljjw" identifier="org.eclipse.papyrus.uml.advice.StereotypePropertyReferenceDestroyEditHelperAdvice" target="org.eclipse.papyrus.uml.Element" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.uml.service.types.helper.advice.StereotypePropertyReferenceDestroyEditHelperAdvice"/>
<adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_UdTKsMJbEeSl6M4_Zhyt7Q" identifier="org.eclipse.papyrus.uml.advice.ConstraintContextReorient" target="org.eclipse.papyrus.uml.Constraint" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.uml.service.types.helper.advice.ConstraintContextReorientEditHelperAdvice"/>
<adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_PBjP4BM9EeW4hZNFQ_NOtQ" description="" identifier="org.eclipse.papyrus.uml.advice.ConstraintContextDestroyEditHelperAdvice" target="org.eclipse.papyrus.uml.Constraint" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.uml.service.types.helper.advice.ConstraintContextDestroyEditHelperAdvice"/>
<adviceBindingsConfigurations xsi:type="elementtypesconfigurations:AdviceBindingConfiguration" xmi:id="_R_pDcWT7EeSzFvTXGJPhUg" identifier="org.eclipse.papyrus.uml.advice.Classifier" target="org.eclipse.papyrus.uml.Classifier" inheritance="all" editHelperAdviceClassName="org.eclipse.papyrus.uml.service.types.helper.advice.ClassifierHelperAdvice"/>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/model/umldi.elementtypesconfigurations b/plugins/uml/org.eclipse.papyrus.uml.service.types/model/umldi.elementtypesconfigurations
index 4c3e9e80612..ac01303cdde 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/model/umldi.elementtypesconfigurations
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/model/umldi.elementtypesconfigurations
@@ -2904,6 +2904,9 @@
<iconEntry xmi:id="_siKSkNx2EeWVxMf7SXAfhg" iconPath="/icons/full/obj16/Stereotype.gif" bundleId="org.eclipse.uml2.uml.edit"/>
<specializedTypes xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Stereotype"/>
</elementTypeConfigurations>
+ <elementTypeConfigurations xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="org.eclipse.papyrus.umldi.StereotypePropertyReferenceEdge" identifier="org.eclipse.papyrus.umldi.StereotypePropertyReferenceEdge" name="Stereotype Property Reference Edge" hint="StereotypePropertyReferenceEdge">
+ <specializedTypes xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration" href="uml.elementtypesconfigurations#org.eclipse.papyrus.StereotypePropertyReference"/>
+ </elementTypeConfigurations>
<elementTypeConfigurations xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="org.eclipse.papyrus.umldi.StringExpression_PackagedElementShape" identifier="org.eclipse.papyrus.umldi.StringExpression_PackagedElementShape" name="String Expression Packaged Element Shape" hint="StringExpression_PackagedElementShape">
<iconEntry xmi:id="_sBLscNx2EeWVxMf7SXAfhg" iconPath="/icons/full/obj16/StringExpression.gif" bundleId="org.eclipse.uml2.uml.edit"/>
<specializedTypes xsi:type="elementtypesconfigurations:SpecializationTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml-containments.elementtypesconfigurations#org.eclipse.papyrus.uml.StringExpression_As_UML::Package::packagedElement"/>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/pom.xml b/plugins/uml/org.eclipse.papyrus.uml.service.types/pom.xml
index bb7ca863a6e..c20392ba551 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/pom.xml
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/pom.xml
@@ -7,6 +7,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.uml.service.types</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/StereotypePropertyReferenceDestroyCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/StereotypePropertyReferenceDestroyCommand.java
new file mode 100644
index 00000000000..bb5e733d832
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/StereotypePropertyReferenceDestroyCommand.java
@@ -0,0 +1,178 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.service.types.command;
+
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.FEATURE_TO_SET_ANNOTATION_KEY;
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT;
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_QUALIFIED_NAME_ANNOTATION_KEY;
+
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants;
+import org.eclipse.papyrus.uml.service.types.utils.ElementUtil;
+import org.eclipse.papyrus.uml.tools.utils.UMLUtil;
+import org.eclipse.papyrus.uml.types.core.commands.StereotypePropertyReferenceEdgeUtil;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.Type;
+
+/**
+ * Command to destroy reference from Stereotype property reference link.
+ *
+ * @since 3.1
+ */
+public class StereotypePropertyReferenceDestroyCommand extends EditElementCommand {
+
+ /** The view which is destroy. */
+ private final View view;
+
+ /** The stereotypeToSet attribute of the link. */
+ private String stereotypeToSet;
+
+ /** The feature attribute of the link. */
+ private String featureToSet;
+
+ /** The referencedObject. */
+ private final EObject referencedObject;
+
+ /** The container of the feature. */
+ private final EObject container;
+
+ /**
+ * Constructor.
+ *
+ * @param request
+ * The DestroyReferenceRequest request.
+ */
+ public StereotypePropertyReferenceDestroyCommand(final DestroyReferenceRequest request) {
+ super(request.getLabel(), null, request);
+ referencedObject = request.getReferencedObject();
+ container = request.getContainer();
+
+ Object value = request.getParameters().get(RequestParameterConstants.AFFECTED_VIEW);
+ view = value instanceof View ? (View) value : null;
+
+ if (null != view) {
+ EAnnotation eAnnotation = view.getEAnnotation(STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT);
+ if (null != eAnnotation) {
+ featureToSet = eAnnotation.getDetails().get(FEATURE_TO_SET_ANNOTATION_KEY);
+ stereotypeToSet = eAnnotation.getDetails().get(STEREOTYPE_QUALIFIED_NAME_ANNOTATION_KEY);
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand#canExecute()
+ */
+ @Override
+ public boolean canExecute() {
+ boolean canExecute = false;
+ if (null != view && null != featureToSet && null != stereotypeToSet) {
+ canExecute = referencedObject instanceof Element && container instanceof Element;
+ }
+ return canExecute;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ * @throws ExecutionException
+ */
+ @Override
+ protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ if (!canExecute()) {
+ throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
+ }
+ return dereferenceTarget();
+ }
+
+ /**
+ * Dereference the target in the source property.
+ *
+ * @return The command result.
+ * @throws ExecutionException
+ */
+ protected CommandResult dereferenceTarget() throws ExecutionException {
+ try {
+ Stereotype stereotype = getContainer().getApplicableStereotype(stereotypeToSet);
+ Stereotype appliedSubstereotype = UMLUtil.getAppliedSubstereotype(getContainer(), stereotype);
+
+ if (null != stereotype) {
+ Property attribute = stereotype.getAttribute(featureToSet, null);
+ if (1 == attribute.getUpper()) {
+ // Single reference case
+ getContainer().setValue(appliedSubstereotype, featureToSet, null);
+ cleanOtherEdge(null);
+ } else {
+ Object list = getContainer().getValue(appliedSubstereotype, featureToSet);
+ Type targetType = attribute.getType();
+ // Gets
+ Object value = null;
+ if (targetType instanceof Stereotype) {
+ value = ElementUtil.getStereotypeApplication((Element) getReferencedObject(), (Stereotype) targetType);
+ } else {
+ value = getReferencedObject();
+ }
+ if (list instanceof List) {
+ ((List) list).remove(value);
+ }
+ cleanOtherEdge(list);
+ }
+ }
+
+ } catch (IllegalArgumentException e) {
+ return CommandResult.newErrorCommandResult(e);
+ }
+
+ return CommandResult.newOKCommandResult(getContainer());
+ }
+
+ /**
+ * @throws ExecutionException
+ */
+ protected void cleanOtherEdge(final Object value) throws ExecutionException {
+ ICommand cleanStereotypePropertyReferenceCommand = StereotypePropertyReferenceEdgeUtil.getCleanStereotypePropertyReferenceCommand(container, value, stereotypeToSet, featureToSet, getEditingDomain(), null);
+ if (null != cleanStereotypePropertyReferenceCommand && cleanStereotypePropertyReferenceCommand.canExecute()) {
+ cleanStereotypePropertyReferenceCommand.execute(null, null);
+ }
+ }
+
+ /**
+ * @return the referencedObject
+ */
+ public Element getReferencedObject() {
+ return (Element) referencedObject;
+ }
+
+ /**
+ * @return the container
+ */
+ public Element getContainer() {
+ return (Element) container;
+ }
+
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/StereotypePropertyReferenceReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/StereotypePropertyReferenceReorientCommand.java
new file mode 100644
index 00000000000..002273daa94
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/StereotypePropertyReferenceReorientCommand.java
@@ -0,0 +1,357 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.service.types.command;
+
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.FEATURE_TO_SET_ANNOTATION_KEY;
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT;
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_QUALIFIED_NAME_ANNOTATION_KEY;
+
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice;
+import org.eclipse.papyrus.uml.service.types.utils.ElementUtil;
+import org.eclipse.papyrus.uml.tools.utils.UMLUtil;
+import org.eclipse.papyrus.uml.types.core.commands.StereotypePropertyReferenceEdgeUtil;
+import org.eclipse.uml2.common.util.UML2Util;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.Type;
+
+/**
+ * The command to reorient stereotype property reference edge.
+ *
+ * @since 3.1
+ */
+public class StereotypePropertyReferenceReorientCommand extends EditElementCommand {
+
+ /** The reorient direction. */
+ private final int reorientDirection;
+
+ /** The reference owner. */
+ private final EObject referenceOwner;
+
+ /** The old end. */
+ private final EObject oldEnd;
+
+ /** The new End. */
+ private final EObject newEnd;
+
+ /** the edge view. */
+ private final View view;
+
+ /** The stereotype qualify name of the stereotype to set. */
+ private String sourceStereotypeQualifiedName;
+
+ /** The feature to set. */
+ private String featureToSet;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param request
+ * the {@link ReorientReferenceRelationshipRequest}.
+ */
+ public StereotypePropertyReferenceReorientCommand(final ReorientReferenceRelationshipRequest request) {
+ super(request.getLabel(), null, request);
+ reorientDirection = request.getDirection();
+ referenceOwner = request.getReferenceOwner();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
+ Object value = request.getParameters().get(DefaultSemanticEditPolicy.GRAPHICAL_RECONNECTED_EDGE);
+ view = value instanceof View ? (View) value : null;
+
+ if (view != null) {
+ EAnnotation eAnnotation = view.getEAnnotation(STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT);
+ if (null != eAnnotation) {
+ featureToSet = eAnnotation.getDetails().get(FEATURE_TO_SET_ANNOTATION_KEY);
+ sourceStereotypeQualifiedName = eAnnotation.getDetails().get(STEREOTYPE_QUALIFIED_NAME_ANNOTATION_KEY);
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand#canExecute()
+ */
+ @Override
+ public boolean canExecute() {
+ boolean canExecute = false;
+ if (null != view && null != featureToSet && null != sourceStereotypeQualifiedName && referenceOwner instanceof Element) {
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
+ canExecute = canReorientSource();
+ } else if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
+ canExecute = canReorientTarget();
+ }
+ }
+ return canExecute;
+ }
+
+ /**
+ * @return true if the source can be reorient.
+ */
+ protected boolean canReorientSource() {
+ boolean canReorentSource = false;
+ if ((oldEnd instanceof Element && newEnd instanceof Element)) {
+ canReorentSource = ElementUtil.hasStereotypeApplied((Element) newEnd, sourceStereotypeQualifiedName);
+ }
+ return canReorentSource;
+ }
+
+ /**
+ * @return true if the target can be reorient.
+ */
+ protected boolean canReorientTarget() {
+ boolean canReorientTarget = false;
+ if (newEnd instanceof Element) {
+ // test if the target have the good stereotype
+ Stereotype sourceStereotype = ((Element) referenceOwner).getApplicableStereotype(sourceStereotypeQualifiedName);
+ Type type = sourceStereotype.getAttribute(featureToSet, null).getType();
+ if (type instanceof Stereotype) {
+ canReorientTarget = ElementUtil.hasStereotypeApplied((Element) newEnd, type.getQualifiedName());
+ } else {
+ Stereotype appliedSubstereotype = UMLUtil.getAppliedSubstereotype((Element) referenceOwner, sourceStereotype);
+ if (null != appliedSubstereotype) {
+ EObject stereotypeApplication = ((Element) referenceOwner).getStereotypeApplication(appliedSubstereotype);
+ if (null != stereotypeApplication) {
+ EStructuralFeature eStructuralFeature = stereotypeApplication.eClass().getEStructuralFeature(UML2Util.getValidJavaIdentifier(featureToSet));
+ if (null != eStructuralFeature) {
+ EClassifier metaclass = eStructuralFeature.getEType();
+ if (metaclass instanceof EClassifier) {
+ canReorientTarget = ((EClassifier) metaclass).isInstance(newEnd);
+ }
+ }
+ }
+ }
+ }
+ }
+ return canReorientTarget;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ */
+ @Override
+ protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ if (!canExecute()) {
+ throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
+ }
+ if (reorientDirection == ReorientRequest.REORIENT_SOURCE) {
+ return reorientSource();
+ }
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
+ return reorientTarget();
+ }
+ throw new IllegalStateException();
+ }
+
+ /**
+ * Reorient the source.
+ *
+ * @return the command result
+ * @throws ExecutionException
+ * the execution exception
+ */
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ protected CommandResult reorientSource() throws ExecutionException {
+ try {
+ Stereotype stereotype = getOldSource().getApplicableStereotype(sourceStereotypeQualifiedName);
+ Property attribute = stereotype.getAttribute(featureToSet, null);
+
+ if (1 == attribute.getUpper()) {
+ // Gets the target value to set the new source
+ Object value = getOldSource().getValue(UMLUtil.getAppliedSubstereotype(getOldSource(), stereotype), featureToSet);
+
+ // Set oldSource: remove reference
+ if (noSimilarReferenceEdge()) {
+ getOldSource().setValue(UMLUtil.getAppliedSubstereotype(getOldSource(), stereotype), featureToSet, null);
+ }
+
+ // Set newSource: add reference
+ getNewSource().setValue(UMLUtil.getAppliedSubstereotype(getNewSource(), stereotype), featureToSet, value);
+ cleanOtherEdge(getNewSource(), value);
+ } else {
+ // multireference case
+ EObject oldValue;
+ Type targetType = attribute.getType();
+ if (targetType instanceof Stereotype) {
+ oldValue = ElementUtil.getStereotypeApplication((Element) oldEnd, (Stereotype) targetType);
+ } else {
+ oldValue = oldEnd;
+ }
+
+ // if no similar link remove the value from old source feature list.
+ if (noSimilarReferenceEdge()) {
+ Object oldlist = getOldSource().getValue(UMLUtil.getAppliedSubstereotype(getOldSource(), stereotype), featureToSet);
+ if (oldlist instanceof List) {
+ ((List) oldlist).remove(oldValue);
+ }
+ }
+
+ Object newlist = getNewSource().getValue(UMLUtil.getAppliedSubstereotype(getNewSource(), stereotype), featureToSet);
+ if (newlist instanceof List) {
+ ((List) newlist).add(oldValue);
+ }
+ }
+ } catch (IllegalArgumentException e) {
+ return CommandResult.newErrorCommandResult(e);
+ }
+
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @return true if there is no similar reference edge between old source and old target. In case of reorient source.
+ */
+ protected boolean noSimilarReferenceEdge() {
+ boolean noSimilar = true;
+ if (view instanceof Edge) {
+ for (Object edge : ViewUtil.getSourceConnections(((Edge) view).getSource())) {
+ if (edge instanceof Edge && IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT.equals(((View) edge).getType()) && !edge.equals(view)) {
+ EAnnotation eAnnotation = ((EModelElement) edge).getEAnnotation(IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT);
+ String edgeFeatureToSet = eAnnotation.getDetails().get(IStereotypePropertyReferenceEdgeAdvice.FEATURE_TO_SET_ANNOTATION_KEY);
+ String edgeStereotypeToSet = eAnnotation.getDetails().get(IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_QUALIFIED_NAME_ANNOTATION_KEY);
+ if (featureToSet.equals(edgeFeatureToSet) && sourceStereotypeQualifiedName.equals(edgeStereotypeToSet)) {
+ EObject sourceElement = ((Edge) edge).getSource().getElement();
+ EObject targetElement = ((Edge) edge).getTarget().getElement();
+ noSimilar = !((Edge) view).getSource().getElement().equals(sourceElement) || !((Edge) view).getTarget().getElement().equals(targetElement);
+ }
+ }
+ }
+ }
+ return noSimilar;
+ }
+
+ /**
+ * Reorient the target of the edge.
+ *
+ * @return the command result.
+ * @throws ExecutionException
+ */
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ protected CommandResult reorientTarget() throws ExecutionException {
+ try {
+ // Set oldSource: remove reference
+ Stereotype stereotype = getOldSource().getApplicableStereotype(sourceStereotypeQualifiedName);
+ Property attribute = stereotype.getAttribute(featureToSet, null);
+ Type targetType = attribute.getType();
+
+ EObject value;
+ if (targetType instanceof Stereotype) {
+ value = ElementUtil.getStereotypeApplication((Element) getNewTarget(), (Stereotype) targetType);
+ } else {
+ value = getNewTarget();
+ }
+
+ if (1 == attribute.getUpper()) {
+ // Single reference case
+ getOldSource().setValue(UMLUtil.getAppliedSubstereotype(getOldSource(), stereotype), featureToSet, value);
+ cleanOtherEdge(getOldSource(), value);
+ } else {
+ // multi reference case
+ EObject oldValue;
+ if (targetType instanceof Stereotype) {
+ oldValue = ElementUtil.getStereotypeApplication((Element) oldEnd, (Stereotype) targetType);
+ } else {
+ oldValue = oldEnd;
+ }
+
+ Object list = getOldSource().getValue(UMLUtil.getAppliedSubstereotype(getOldSource(), stereotype), featureToSet);
+ if (list instanceof List) {
+ // Remove old target if there if no similar edge into source and target
+ // Add new target
+ ((List) list).add(value);
+ if (noSimilarReferenceEdge()) {
+ ((List) list).remove(oldValue);
+ }
+ }
+ }
+
+ } catch (IllegalArgumentException e) {
+ return CommandResult.newErrorCommandResult(e);
+ }
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * Clean other edge.
+ *
+ * @param value
+ * the value
+ * @throws ExecutionException
+ * the execution exception
+ */
+ protected void cleanOtherEdge(final Element source, final Object value) throws ExecutionException {
+ ICommand cleanStereotypePropertyReferenceCommand = StereotypePropertyReferenceEdgeUtil.getCleanStereotypePropertyReferenceCommand(source, value, sourceStereotypeQualifiedName, featureToSet, getEditingDomain(), (Edge) view);
+ if (null != cleanStereotypePropertyReferenceCommand && cleanStereotypePropertyReferenceCommand.canExecute()) {
+ cleanStereotypePropertyReferenceCommand.execute(null, null);
+ }
+ }
+
+ /**
+ * Gets the old source.
+ *
+ * @return the old source
+ */
+ protected Element getOldSource() {
+ return (Element) referenceOwner;
+ }
+
+ /**
+ * Gets the new source.
+ *
+ * @return the new source
+ */
+ protected Element getNewSource() {
+ return (Element) newEnd;
+ }
+
+ /**
+ * Gets the old target.
+ *
+ * @return the old target
+ */
+ protected Element getOldTarget() {
+ return (Element) oldEnd;
+ }
+
+ /**
+ * Gets the new target.
+ *
+ * @return the new target
+ */
+ protected Element getNewTarget() {
+ return (Element) newEnd;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractFeatureRelationshipReorientEditHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractFeatureRelationshipReorientEditHelperAdvice.java
index 543a72b71b2..d1e5612e519 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractFeatureRelationshipReorientEditHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractFeatureRelationshipReorientEditHelperAdvice.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
+ * Copyright (c) 2017 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,7 @@
*
* Contributors:
* CEA LIST - Initial API and implementation
+ * Mickaël ADAM (ALL4TEC) - mickael.adam@all4tec.net - Bug 517679
*****************************************************************************/
package org.eclipse.papyrus.uml.service.types.helper.advice;
@@ -26,6 +27,7 @@ import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
import org.eclipse.papyrus.infra.services.edit.context.TypeContext;
import org.eclipse.papyrus.infra.types.core.utils.ElementTypeRegistryUtils;
+import org.eclipse.papyrus.uml.service.types.utils.ElementUtil;
public abstract class AbstractFeatureRelationshipReorientEditHelperAdvice extends AbstractEditHelperAdvice {
@@ -38,12 +40,15 @@ public abstract class AbstractFeatureRelationshipReorientEditHelperAdvice extend
if (value instanceof View) {
try {
- IClientContext context = TypeContext.getContext((View)value);
+ IClientContext context = TypeContext.getContext((View) value);
List<IElementType> elementTypes = ElementTypeRegistryUtils.getElementTypesBySemanticHint(((View) value).getType(), context.getId());
for (IElementType iElementType : elementTypes) {
+
List<ISpecializationType> subs = Arrays.asList(ElementTypeRegistry.getInstance().getSpecializationsOf(elementTypeIDToSpecialize()));
- if (subs.contains(iElementType)) {
+
+ boolean typeOf = ElementUtil.isTypeOf(iElementType, ElementTypeRegistry.getInstance().getType(elementTypeIDToSpecialize()));// Fix due to the miss of element in all context
+ if (subs.contains(iElementType) || typeOf) {
return getFeatureRelationshipReorientCommand(request);
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractReferenceDeleteRelationshipEditHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractReferenceDeleteRelationshipEditHelperAdvice.java
index f55d5282e01..4758414fc00 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractReferenceDeleteRelationshipEditHelperAdvice.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/AbstractReferenceDeleteRelationshipEditHelperAdvice.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2016 CEA LIST and others.
+ * Copyright (c) 2017 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +9,7 @@
* Contributors:
* CEA LIST - Initial API and implementation
* Vincent Lorenzo - bug 492522
+ * Mickaël ADAM (ALL4TEC) - mickael.adam@all4tec.net - Bug 517679
*****************************************************************************/
package org.eclipse.papyrus.uml.service.types.helper.advice;
@@ -37,6 +38,7 @@ import org.eclipse.gmf.runtime.notation.Connector;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.types.core.utils.ElementTypeRegistryUtils;
+import org.eclipse.papyrus.uml.service.types.utils.ElementUtil;
import org.eclipse.papyrus.uml.service.types.utils.RequestParameterConstants;
import org.eclipse.uml2.common.util.CacheAdapter;
@@ -66,7 +68,7 @@ public abstract class AbstractReferenceDeleteRelationshipEditHelperAdvice extend
* the visual id
* @return
* the EReference represented by the view with this visual id
- * @since 3.0
+ * @since 3.1
*/
protected EReference getFeature(String visualId, IClientContext context) {
List<IElementType> elementTypes = ElementTypeRegistryUtils.getElementTypesBySemanticHint(visualId, context.getId());
@@ -75,7 +77,9 @@ public abstract class AbstractReferenceDeleteRelationshipEditHelperAdvice extend
Map<String, EReference> featureElementTypeToEReferenceMap = getFeatureElementTypeToEReferenceMap();
for (String featureElementType : featureElementTypeToEReferenceMap.keySet()) {
List<ISpecializationType> subs = Arrays.asList(ElementTypeRegistry.getInstance().getSpecializationsOf(featureElementType));
- if (subs.contains(iElementType)) {
+
+ boolean typeOf = ElementUtil.isTypeOf(iElementType, ElementTypeRegistry.getInstance().getType(featureElementType));// Fix due to the miss of element in all context
+ if (subs.contains(iElementType) || typeOf) {
return featureElementTypeToEReferenceMap.get(featureElementType);
}
}
@@ -122,8 +126,9 @@ public abstract class AbstractReferenceDeleteRelationshipEditHelperAdvice extend
* the destroy reference request
* @return
* the list of connector to destroy for the request
+ * @since 3.1
*/
- private List<Connector> findConnectorsToDestroy(final DestroyReferenceRequest request) {
+ protected List<Connector> findConnectorsToDestroy(final DestroyReferenceRequest request) {
List<Connector> connectorsToDestroy = new ArrayList<Connector>();
EObject featureOwner = request.getContainer();
if (null != featureOwner) {
@@ -224,7 +229,7 @@ public abstract class AbstractReferenceDeleteRelationshipEditHelperAdvice extend
*/
@Override
protected ICommand getBeforeDestroyReferenceCommand(final DestroyReferenceRequest request) {
- final CompositeCommand command = new CompositeCommand("Clear Connectors"); // $NON-NLS-0$
+ final CompositeCommand command = new CompositeCommand("Clear Connectors"); // $NON-NLS-1$
// 1. get all connectors to destroy
final Collection<Connector> connectorsToDestroy = findConnectorsToDestroy(request);
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/StereotypePropertyReferenceDestroyEditHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/StereotypePropertyReferenceDestroyEditHelperAdvice.java
new file mode 100644
index 00000000000..a276365fafd
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/StereotypePropertyReferenceDestroyEditHelperAdvice.java
@@ -0,0 +1,89 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.service.types.helper.advice;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.gmf.runtime.notation.Connector;
+import org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants;
+import org.eclipse.papyrus.uml.service.types.command.StereotypePropertyReferenceDestroyCommand;
+
+/**
+ * This helper provides the command to remove an annotated element from a comment
+ *
+ * @since 3.1
+ */
+public class StereotypePropertyReferenceDestroyEditHelperAdvice extends AbstractReferenceDeleteRelationshipEditHelperAdvice {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.uml.service.types.helper.advice.AbstractReferenceDeleteRelationshipEditHelperAdvice#checkSourceEdgeToFindConnectorToDestroy()
+ */
+ @Override
+ protected boolean checkSourceEdgeToFindConnectorToDestroy() {
+ return false;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.uml.service.types.helper.advice.AbstractReferenceDeleteRelationshipEditHelperAdvice#checkTargetEdgeToFindConnectorToDestroy()
+ */
+ @Override
+ protected boolean checkTargetEdgeToFindConnectorToDestroy() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.uml.service.types.helper.advice.AbstractReferenceDeleteRelationshipEditHelperAdvice#getFeatureElementTypeToEReferenceMap()
+ */
+ @Override
+ protected Map<String, EReference> getFeatureElementTypeToEReferenceMap() {
+ return Collections.singletonMap("org.eclipse.papyrus.umldi.StereotypePropertyReferenceEdge", null);//$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterDestroyReferenceCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest)
+ */
+ @Override
+ protected ICommand getAfterDestroyReferenceCommand(final DestroyReferenceRequest request) {
+ return new StereotypePropertyReferenceDestroyCommand(request);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.uml.service.types.helper.advice.AbstractReferenceDeleteRelationshipEditHelperAdvice#findConnectorsToDestroy(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest)
+ */
+ @Override
+ protected List<Connector> findConnectorsToDestroy(final DestroyReferenceRequest request) {
+ List<Connector> connector = new ArrayList<Connector>();
+ Object parameter = request.getParameter(RequestParameterConstants.AFFECTED_VIEW);
+ if (parameter instanceof Connector) {
+ connector.add((Connector) parameter);
+ }
+ return connector;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/StereotypePropertyReferenceReorientEditHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/StereotypePropertyReferenceReorientEditHelperAdvice.java
new file mode 100644
index 00000000000..72ae4f056b9
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/StereotypePropertyReferenceReorientEditHelperAdvice.java
@@ -0,0 +1,45 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.service.types.helper.advice;
+
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.papyrus.uml.service.types.command.StereotypePropertyReferenceReorientCommand;
+
+/**
+ * Helper advice for reorient stereotype property reference edge.
+ *
+ * @since 3.1
+ */
+public class StereotypePropertyReferenceReorientEditHelperAdvice extends AbstractFeatureRelationshipReorientEditHelperAdvice {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.uml.service.types.helper.advice.AbstractFeatureRelationshipReorientEditHelperAdvice#elementTypeIDToSpecialize()
+ */
+ @Override
+ protected String elementTypeIDToSpecialize() {
+ return "org.eclipse.papyrus.umldi.StereotypePropertyReferenceEdge";//$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.uml.service.types.helper.advice.AbstractFeatureRelationshipReorientEditHelperAdvice#getReorientCommand()
+ */
+ @Override
+ protected ICommand getFeatureRelationshipReorientCommand(final ReorientReferenceRelationshipRequest request) {
+ return new StereotypePropertyReferenceReorientCommand(request);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/StereotypePropertyReferenceSetEditHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/StereotypePropertyReferenceSetEditHelperAdvice.java
new file mode 100644
index 00000000000..e5a15087ab6
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/advice/StereotypePropertyReferenceSetEditHelperAdvice.java
@@ -0,0 +1,99 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.service.types.helper.advice;
+
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.types.core.commands.StereotypePropertyReferenceEdgeUtil;
+import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/**
+ * The {@link AbstractEditHelperAdvice} for stereotype property reference edge set.
+ *
+ * @author Mickael ADAM
+ * @since 3.1
+ */
+public class StereotypePropertyReferenceSetEditHelperAdvice extends AbstractEditHelperAdvice {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterSetCommand(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)
+ */
+ @Override
+ protected ICommand getAfterSetCommand(final SetRequest request) {
+ // Delete reference link in case of set of feature. Element to edit is the source of reference link.
+ EObject element = request.getElementToEdit();
+ View view = StereotypePropertyReferenceEdgeUtil.findViewFromStereotype(element);
+ TransactionalEditingDomain editingDomain = request.getEditingDomain();
+
+ if (view != null) {
+ EStructuralFeature structuralFeature = request.getFeature();
+ final Object value = request.getValue();
+
+ if (structuralFeature instanceof EReference) {
+ String featureName = structuralFeature.getName();
+
+ Stereotype stereotype = UMLUtil.getStereotype(element);
+ if (null != stereotype) {
+ String stereotypeQualifyName = stereotype.getQualifiedName();
+ if (null != stereotypeQualifyName && null != featureName) {
+
+ CompositeCommand command = new CompositeCommand("Clear stereotype property reference links");//$NON-NLS-1$
+
+ for (Object edge : ViewUtil.getSourceConnections(view)) {
+ if (edge instanceof Edge && STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT.equals(((View) edge).getType())) {
+ Edge edgeToDestroy = null;
+ if (!StereotypePropertyReferenceEdgeUtil.checkNotOrphanStereotypePropertyReferenceEdgeNotYetSet((Edge) edge, stereotypeQualifyName, featureName, value)) {
+ edgeToDestroy = (Edge) edge;
+ }
+
+ if (edgeToDestroy != null) {
+ DestroyElementRequest destroy = new DestroyElementRequest(editingDomain, edgeToDestroy, false);
+ Object eHelperContext = destroy.getEditHelperContext();
+ IElementType context = ElementTypeRegistry.getInstance().getElementType(eHelperContext);
+ if (context != null) {
+ ICommand result = context.getEditCommand(destroy);
+ if (result != null) {
+ command.add(result);
+ }
+ }
+ }
+ }
+ }
+
+ return command.isEmpty() ? null : command;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ElementUtil.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ElementUtil.java
index da0fc650637..627a8ad9adf 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ElementUtil.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/utils/ElementUtil.java
@@ -10,12 +10,14 @@
* Contributors:
*
* Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
+ * Mickaël ADAM (ALL4TEC) - mickael.adam@all4tec.net - Bug 517679
*
*****************************************************************************/
package org.eclipse.papyrus.uml.service.types.utils;
import java.util.Arrays;
import java.util.List;
+import java.util.stream.Collectors;
import org.eclipse.emf.common.util.EMap;
import org.eclipse.emf.ecore.EAnnotation;
@@ -23,6 +25,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.uml2.common.util.UML2Util;
import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Stereotype;
import org.eclipse.uml2.uml.util.UMLUtil;
/**
@@ -132,7 +135,7 @@ public class ElementUtil {
/**
* @return true element is type of type to match
- * @since 3.0
+ * @since 3.1
*/
public static boolean isTypeOf(IElementType element, IElementType typeTomatch) {
if (typeTomatch.equals(element)) {
@@ -142,6 +145,46 @@ public class ElementUtil {
if (supers.contains(typeTomatch)) {
return true;
}
- return false;
+ return false;
+ }
+
+ /**
+ * Check for stereotype applied on {@link Element}.
+ *
+ * @param element
+ * the element to test
+ * @param stereotype
+ * the stereotype qualify name
+ * @return true, if successful
+ * @since 3.1
+ */
+ public static boolean hasStereotypeApplied(final Element element, final String stereotype) {
+ List<String> sourceAppliedStereotypes = element.getAppliedStereotypes().stream()
+ .map(st -> st.getQualifiedName())
+ .collect(Collectors.toList());
+
+ sourceAppliedStereotypes.addAll(element.getAppliedStereotypes().stream()
+ .flatMap(st -> st.allParents().stream())
+ .filter(Stereotype.class::isInstance).map(Stereotype.class::cast)
+ .map(st -> st.getQualifiedName())
+ .collect(Collectors.toList()));
+
+ return sourceAppliedStereotypes.contains(stereotype);
+ }
+
+ /**
+ * Gets the stereotype application of the {@link Stereotype} in an {@link Element}.
+ *
+ * @param umlElement
+ * the UML {@link Element}
+ * @param stereotype
+ * the {@link Stereotype}
+ * @return the stereotype application
+ * @since 3.1
+ */
+ public static EObject getStereotypeApplication(final Element umlElement, final Stereotype stereotype) {
+ Stereotype actual = (stereotype == null) ? null : org.eclipse.papyrus.uml.tools.utils.UMLUtil.getAppliedSubstereotype(umlElement, stereotype);
+ EObject stereotypeApplication = (null == actual) ? null : umlElement.getStereotypeApplication(actual);
+ return stereotypeApplication;
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/.classpath b/plugins/uml/org.eclipse.papyrus.uml.types.core/.classpath
index afb9bb46ef3..0ccbfd54a00 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.types.core/.classpath
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/.classpath
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/.settings/org.eclipse.jdt.core.prefs b/plugins/uml/org.eclipse.papyrus.uml.types.core/.settings/org.eclipse.jdt.core.prefs
index 4759947300a..62a08f4494d 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.types.core/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/META-INF/MANIFEST.MF b/plugins/uml/org.eclipse.papyrus.uml.types.core/META-INF/MANIFEST.MF
index d6530a584ca..159104eb0bc 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.types.core/META-INF/MANIFEST.MF
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/META-INF/MANIFEST.MF
@@ -4,7 +4,14 @@ Require-Bundle: org.eclipse.uml2.uml.edit;bundle-version="[5.3.0,6.0.0)";visibil
org.eclipse.papyrus.views.properties;bundle-version="[3.0.0,4.0.0)",
org.eclipse.papyrus.infra.types.rulebased;bundle-version="[3.0.0,4.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.emf.types;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="[3.0.0,4.0.0)";visibility:=reexport
+ org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="[3.0.0,4.0.0)";visibility:=reexport,
+ org.eclipse.core.runtime;bundle-version="[3.13.0,4.0.0)",
+ org.eclipse.emf.ecore;bundle-version="[2.13.0,3.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.infra.types;bundle-version="[3.0.0,4.0.0)";visibility:=reexport,
+ org.eclipse.emf.edit;bundle-version="[2.12.0,3.0.0)";visibility:=reexport,
+ org.eclipse.emf.ecore.edit;bundle-version="[2.9.0,3.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.infra.types.edit;bundle-version="[3.0.0,4.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.infra.emf.gmf;bundle-version="[1.2.100,2.0.0)"
Export-Package: org.eclipse.papyrus.uml.types.core,
org.eclipse.papyrus.uml.types.core.advices.applystereotype,
org.eclipse.papyrus.uml.types.core.advices.applystereotype.impl,
@@ -25,14 +32,18 @@ Export-Package: org.eclipse.papyrus.uml.types.core,
org.eclipse.papyrus.uml.types.core.rules.invariantstereotype,
org.eclipse.papyrus.uml.types.core.rules.invariantstereotype.impl,
org.eclipse.papyrus.uml.types.core.rules.invariantstereotype.provider,
- org.eclipse.papyrus.uml.types.core.rules.invariantstereotype.util
+ org.eclipse.papyrus.uml.types.core.rules.invariantstereotype.util,
+ org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice,
+ org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.impl,
+ org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.provider,
+ org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.util
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
-Bundle-Version: 3.0.0.qualifier
+Bundle-Version: 3.1.0.qualifier
Bundle-Name: %pluginName
Bundle-Localization: plugin
Bundle-ManifestVersion: 2
-Bundle-Activator: org.eclipse.papyrus.uml.types.core.rules.invariantstereotype.provider.InvariantStereotypeRuleConfigurationEditPlugin$Implementation
+Bundle-Activator: org.eclipse.papyrus.uml.types.core.Activator
Bundle-SymbolicName: org.eclipse.papyrus.uml.types.core;singleton:=true
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/icons/full/ctool16/CreateElementTypeSetConfiguration_adviceBindingsConfigurations_StereotypePropertyReferenceEdgeAdviceConfiguration.gif b/plugins/uml/org.eclipse.papyrus.uml.types.core/icons/full/ctool16/CreateElementTypeSetConfiguration_adviceBindingsConfigurations_StereotypePropertyReferenceEdgeAdviceConfiguration.gif
new file mode 100644
index 00000000000..af09a8d86f7
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/icons/full/ctool16/CreateElementTypeSetConfiguration_adviceBindingsConfigurations_StereotypePropertyReferenceEdgeAdviceConfiguration.gif
Binary files differ
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/icons/full/obj16/StereotypePropertyReferenceEdgeAdviceConfiguration.gif b/plugins/uml/org.eclipse.papyrus.uml.types.core/icons/full/obj16/StereotypePropertyReferenceEdgeAdviceConfiguration.gif
new file mode 100644
index 00000000000..420eee17752
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/icons/full/obj16/StereotypePropertyReferenceEdgeAdviceConfiguration.gif
Binary files differ
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/model/StereotypePropertyReferenceEdgeAdvice.ecore b/plugins/uml/org.eclipse.papyrus.uml.types.core/model/StereotypePropertyReferenceEdgeAdvice.ecore
new file mode 100644
index 00000000000..f728b6685a7
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/model/StereotypePropertyReferenceEdgeAdvice.ecore
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="stereotypepropertyreferenceedgeadvice" nsURI="http://www.eclipse.org/papyrus/uml/types/stereotypepropertyreferenceedgeadvice/1.0"
+ nsPrefix="stereotypepropertyreferenceedgeadvice">
+ <eClassifiers xsi:type="ecore:EClass" name="StereotypePropertyReferenceEdgeAdviceConfiguration"
+ eSuperTypes="../../org.eclipse.papyrus.infra.types/model/ElementTypesConfigurations.ecore#//AbstractAdviceBindingConfiguration">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="featureToSet" lowerBound="1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="stereotypeQualifiedName"
+ lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="edgeLabel" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/model/StereotypePropertyReferenceEdgeAdvice.genmodel b/plugins/uml/org.eclipse.papyrus.uml.types.core/model/StereotypePropertyReferenceEdgeAdvice.genmodel
new file mode 100644
index 00000000000..8ba8b31a3f9
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/model/StereotypePropertyReferenceEdgeAdvice.genmodel
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.papyrus.uml.types.core/src-gen" editDirectory="/org.eclipse.papyrus.uml.types.core/src-gen"
+ modelPluginID="org.eclipse.papyrus.uml.types.core" modelName="StereotypePropertyReferenceEdgeAdvice"
+ rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" importerID="org.eclipse.emf.importer.ecore"
+ complianceLevel="5.0" copyrightFields="false" usedGenPackages="../../org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore ../../org.eclipse.papyrus.infra.types/model/ElementTypesConfigurations.genmodel#//types"
+ operationReflection="true" importOrganizing="true">
+ <foreignModel>StereotypePropertyReferenceEdgeAdvice.ecore</foreignModel>
+ <genPackages prefix="StereotypePropertyReferenceEdgeAdvice" basePackage="org.eclipse.papyrus.uml.types.core.advices"
+ disposableProviderFactory="true" childCreationExtenders="true" ecorePackage="StereotypePropertyReferenceEdgeAdvice.ecore#/">
+ <genClasses ecoreClass="StereotypePropertyReferenceEdgeAdvice.ecore#//StereotypePropertyReferenceEdgeAdviceConfiguration">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute StereotypePropertyReferenceEdgeAdvice.ecore#//StereotypePropertyReferenceEdgeAdviceConfiguration/featureToSet"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute StereotypePropertyReferenceEdgeAdvice.ecore#//StereotypePropertyReferenceEdgeAdviceConfiguration/stereotypeQualifiedName"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/plugin.properties b/plugins/uml/org.eclipse.papyrus.uml.types.core/plugin.properties
index 46ac51d3ac3..4fe0a5126c4 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.types.core/plugin.properties
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/plugin.properties
@@ -48,3 +48,8 @@ _UI_StereotypeApplicationMatcherConfiguration_type = Stereotype Application Matc
_UI_StereotypeApplicationMatcherConfiguration_stereotypesQualifiedNames_feature = Stereotypes Qualified Names
_UI_InvariantStereotypeRuleConfiguration_strict_feature = Strict
_UI_StereotypeApplicationMatcherConfiguration_profileUri_feature = Profile Uri
+
+_UI_StereotypePropertyReferenceEdgeAdviceConfiguration_type = Stereotype Property Reference Edge Advice
+_UI_StereotypePropertyReferenceEdgeAdviceConfiguration_featureToSet_feature = Feature To Set
+_UI_StereotypePropertyReferenceEdgeAdviceConfiguration_stereotypeQualifiedName_feature = Stereotype Qualified Name
+_UI_StereotypePropertyReferenceEdgeAdviceConfiguration_edgeLabel_feature = Edge Label
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/plugin.xml b/plugins/uml/org.eclipse.papyrus.uml.types.core/plugin.xml
index daaecc52824..f4a705bb3d5 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.types.core/plugin.xml
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/plugin.xml
@@ -45,7 +45,7 @@
<extension point="org.eclipse.emf.edit.childCreationExtenders">
<!-- @generated SetTypeAdvice -->
<extender
- uri="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.1"
+ uri="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2"
class="org.eclipse.papyrus.uml.types.core.advices.settype.provider.SetTypeAdviceConfigurationItemProviderAdapterFactory$ElementTypesConfigurationsChildCreationExtender"/>
</extension>
@@ -80,7 +80,7 @@
<extension point="org.eclipse.emf.edit.childCreationExtenders">
<!-- @generated InvariantStereotypeRule -->
<extender
- uri="http://www.eclipse.org/papyrus/infra/types/rulebased/1.1"
+ uri="http://www.eclipse.org/papyrus/infra/types/rulebased/1.2"
class="org.eclipse.papyrus.uml.types.core.rules.invariantstereotype.provider.InvariantStereotypeRuleConfigurationItemProviderAdapterFactory$RuleBasedChildCreationExtender"/>
</extension>
@@ -115,7 +115,7 @@
<extension point="org.eclipse.emf.edit.childCreationExtenders">
<!-- @generated ApplyStereotypeAdvice -->
<extender
- uri="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.1"
+ uri="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2"
class="org.eclipse.papyrus.uml.types.core.advices.applystereotype.provider.ApplyStereotypeAdviceItemProviderAdapterFactory$ElementTypesConfigurationsChildCreationExtender"/>
</extension>
@@ -150,7 +150,7 @@
<extension point="org.eclipse.emf.edit.childCreationExtenders">
<!-- @generated StereotypeMatcher -->
<extender
- uri="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.1"
+ uri="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2"
class="org.eclipse.papyrus.uml.types.core.matchers.stereotype.provider.StereotypeApplicationMatcherItemProviderAdapterFactory$ElementTypesConfigurationsChildCreationExtender"/>
</extension>
<extension
@@ -169,6 +169,13 @@
factoryClass="org.eclipse.papyrus.uml.types.core.advices.settype.SetTypeAdviceFactory">
</adviceConfigurationKind>
</extension>
+ <extension
+ point="org.eclipse.papyrus.infra.types.core.adviceConfigurationKind">
+ <adviceConfigurationKind
+ configurationClass="org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration"
+ factoryClass="org.eclipse.papyrus.uml.types.core.advices.stereotypereferencelink.StereotypePropertyReferenceEdgeAdviceConfigurationFactory">
+ </adviceConfigurationKind>
+ </extension>
<extension
point="org.eclipse.papyrus.infra.types.rulebased.ruleKind">
<ruleKind
@@ -183,5 +190,31 @@
factoryClass="org.eclipse.papyrus.uml.types.core.matchers.stereotype.StereotypeApplicationMatcherConfigurationFactory">
</matcherConfigurationKind>
</extension>
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <!-- @generated StereotypePropertyReferenceEdgeAdvice -->
+ <package
+ uri="http://www.eclipse.org/papyrus/uml/types/stereotypepropertyreferenceedgeadvice/1.0"
+ class="org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdvicePackage"
+ genModel="model/StereotypePropertyReferenceEdgeAdvice.genmodel"/>
+ </extension>
+
+ <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
+ <!-- @generated StereotypePropertyReferenceEdgeAdvice -->
+ <factory
+ uri="http://www.eclipse.org/papyrus/uml/types/stereotypepropertyreferenceedgeadvice/1.0"
+ class="org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.provider.StereotypePropertyReferenceEdgeAdviceItemProviderAdapterFactory"
+ supportedTypes=
+ "org.eclipse.emf.edit.provider.IEditingDomainItemProvider
+ org.eclipse.emf.edit.provider.IStructuredItemContentProvider
+ org.eclipse.emf.edit.provider.ITreeItemContentProvider
+ org.eclipse.emf.edit.provider.IItemLabelProvider
+ org.eclipse.emf.edit.provider.IItemPropertySource"/>
+ </extension>
+ <extension point="org.eclipse.emf.edit.childCreationExtenders">
+ <!-- @generated StereotypePropertyReferenceEdgeAdvice -->
+ <extender
+ uri="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2"
+ class="org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.provider.StereotypePropertyReferenceEdgeAdviceItemProviderAdapterFactory$ElementTypesConfigurationsChildCreationExtender"/>
+ </extension>
</plugin>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/pom.xml b/plugins/uml/org.eclipse.papyrus.uml.types.core/pom.xml
index b18c6b79eab..562dd062b19 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.types.core/pom.xml
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/pom.xml
@@ -8,6 +8,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.uml.types.core</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/StereotypePropertyReferenceEdgeAdviceConfiguration.java b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/StereotypePropertyReferenceEdgeAdviceConfiguration.java
new file mode 100644
index 00000000000..b37fbe6fefd
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/StereotypePropertyReferenceEdgeAdviceConfiguration.java
@@ -0,0 +1,104 @@
+/**
+ */
+package org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice;
+
+import org.eclipse.papyrus.infra.types.AbstractAdviceBindingConfiguration;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Configuration</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration#getFeatureToSet <em>Feature To Set</em>}</li>
+ * <li>{@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration#getStereotypeQualifiedName <em>Stereotype Qualified Name</em>}</li>
+ * <li>{@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration#getEdgeLabel <em>Edge Label</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdvicePackage#getStereotypePropertyReferenceEdgeAdviceConfiguration()
+ * @model
+ * @generated
+ */
+public interface StereotypePropertyReferenceEdgeAdviceConfiguration extends AbstractAdviceBindingConfiguration {
+ /**
+ * Returns the value of the '<em><b>Feature To Set</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Feature To Set</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Feature To Set</em>' attribute.
+ * @see #setFeatureToSet(String)
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdvicePackage#getStereotypePropertyReferenceEdgeAdviceConfiguration_FeatureToSet()
+ * @model required="true"
+ * @generated
+ */
+ String getFeatureToSet();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration#getFeatureToSet <em>Feature To Set</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Feature To Set</em>' attribute.
+ * @see #getFeatureToSet()
+ * @generated
+ */
+ void setFeatureToSet(String value);
+
+ /**
+ * Returns the value of the '<em><b>Stereotype Qualified Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Stereotype Qualified Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Stereotype Qualified Name</em>' attribute.
+ * @see #setStereotypeQualifiedName(String)
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdvicePackage#getStereotypePropertyReferenceEdgeAdviceConfiguration_StereotypeQualifiedName()
+ * @model required="true"
+ * @generated
+ */
+ String getStereotypeQualifiedName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration#getStereotypeQualifiedName <em>Stereotype Qualified Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Stereotype Qualified Name</em>' attribute.
+ * @see #getStereotypeQualifiedName()
+ * @generated
+ */
+ void setStereotypeQualifiedName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Edge Label</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Edge Label</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Edge Label</em>' attribute.
+ * @see #setEdgeLabel(String)
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdvicePackage#getStereotypePropertyReferenceEdgeAdviceConfiguration_EdgeLabel()
+ * @model
+ * @generated
+ */
+ String getEdgeLabel();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration#getEdgeLabel <em>Edge Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Edge Label</em>' attribute.
+ * @see #getEdgeLabel()
+ * @generated
+ */
+ void setEdgeLabel(String value);
+
+} // StereotypePropertyReferenceEdgeAdviceConfiguration
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/StereotypePropertyReferenceEdgeAdviceFactory.java b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/StereotypePropertyReferenceEdgeAdviceFactory.java
new file mode 100644
index 00000000000..9888d72d743
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/StereotypePropertyReferenceEdgeAdviceFactory.java
@@ -0,0 +1,42 @@
+/**
+ */
+package org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdvicePackage
+ * @generated
+ */
+public interface StereotypePropertyReferenceEdgeAdviceFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ StereotypePropertyReferenceEdgeAdviceFactory eINSTANCE = org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.impl.StereotypePropertyReferenceEdgeAdviceFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Configuration</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Configuration</em>'.
+ * @generated
+ */
+ StereotypePropertyReferenceEdgeAdviceConfiguration createStereotypePropertyReferenceEdgeAdviceConfiguration();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ StereotypePropertyReferenceEdgeAdvicePackage getStereotypePropertyReferenceEdgeAdvicePackage();
+
+} //StereotypePropertyReferenceEdgeAdviceFactory
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/StereotypePropertyReferenceEdgeAdvicePackage.java b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/StereotypePropertyReferenceEdgeAdvicePackage.java
new file mode 100644
index 00000000000..6ab8e0bef46
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/StereotypePropertyReferenceEdgeAdvicePackage.java
@@ -0,0 +1,290 @@
+/**
+ */
+package org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.papyrus.infra.types.ElementTypesConfigurationsPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface StereotypePropertyReferenceEdgeAdvicePackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "stereotypepropertyreferenceedgeadvice";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/papyrus/uml/types/stereotypepropertyreferenceedgeadvice/1.0";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "stereotypepropertyreferenceedgeadvice";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ StereotypePropertyReferenceEdgeAdvicePackage eINSTANCE = org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.impl.StereotypePropertyReferenceEdgeAdvicePackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.impl.StereotypePropertyReferenceEdgeAdviceConfigurationImpl <em>Configuration</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.impl.StereotypePropertyReferenceEdgeAdviceConfigurationImpl
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.impl.StereotypePropertyReferenceEdgeAdvicePackageImpl#getStereotypePropertyReferenceEdgeAdviceConfiguration()
+ * @generated
+ */
+ int STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION = 0;
+
+ /**
+ * The feature id for the '<em><b>Description</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__DESCRIPTION = ElementTypesConfigurationsPackage.ABSTRACT_ADVICE_BINDING_CONFIGURATION__DESCRIPTION;
+
+ /**
+ * The feature id for the '<em><b>Before</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__BEFORE = ElementTypesConfigurationsPackage.ABSTRACT_ADVICE_BINDING_CONFIGURATION__BEFORE;
+
+ /**
+ * The feature id for the '<em><b>After</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__AFTER = ElementTypesConfigurationsPackage.ABSTRACT_ADVICE_BINDING_CONFIGURATION__AFTER;
+
+ /**
+ * The feature id for the '<em><b>Identifier</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__IDENTIFIER = ElementTypesConfigurationsPackage.ABSTRACT_ADVICE_BINDING_CONFIGURATION__IDENTIFIER;
+
+ /**
+ * The feature id for the '<em><b>Target</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__TARGET = ElementTypesConfigurationsPackage.ABSTRACT_ADVICE_BINDING_CONFIGURATION__TARGET;
+
+ /**
+ * The feature id for the '<em><b>Container Configuration</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__CONTAINER_CONFIGURATION = ElementTypesConfigurationsPackage.ABSTRACT_ADVICE_BINDING_CONFIGURATION__CONTAINER_CONFIGURATION;
+
+ /**
+ * The feature id for the '<em><b>Matcher Configuration</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__MATCHER_CONFIGURATION = ElementTypesConfigurationsPackage.ABSTRACT_ADVICE_BINDING_CONFIGURATION__MATCHER_CONFIGURATION;
+
+ /**
+ * The feature id for the '<em><b>Inheritance</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__INHERITANCE = ElementTypesConfigurationsPackage.ABSTRACT_ADVICE_BINDING_CONFIGURATION__INHERITANCE;
+
+ /**
+ * The feature id for the '<em><b>Feature To Set</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__FEATURE_TO_SET = ElementTypesConfigurationsPackage.ABSTRACT_ADVICE_BINDING_CONFIGURATION_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Stereotype Qualified Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__STEREOTYPE_QUALIFIED_NAME = ElementTypesConfigurationsPackage.ABSTRACT_ADVICE_BINDING_CONFIGURATION_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Edge Label</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__EDGE_LABEL = ElementTypesConfigurationsPackage.ABSTRACT_ADVICE_BINDING_CONFIGURATION_FEATURE_COUNT + 2;
+
+ /**
+ * The number of structural features of the '<em>Configuration</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION_FEATURE_COUNT = ElementTypesConfigurationsPackage.ABSTRACT_ADVICE_BINDING_CONFIGURATION_FEATURE_COUNT + 3;
+
+ /**
+ * The number of operations of the '<em>Configuration</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION_OPERATION_COUNT = ElementTypesConfigurationsPackage.ABSTRACT_ADVICE_BINDING_CONFIGURATION_OPERATION_COUNT + 0;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration <em>Configuration</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Configuration</em>'.
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration
+ * @generated
+ */
+ EClass getStereotypePropertyReferenceEdgeAdviceConfiguration();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration#getFeatureToSet <em>Feature To Set</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Feature To Set</em>'.
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration#getFeatureToSet()
+ * @see #getStereotypePropertyReferenceEdgeAdviceConfiguration()
+ * @generated
+ */
+ EAttribute getStereotypePropertyReferenceEdgeAdviceConfiguration_FeatureToSet();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration#getStereotypeQualifiedName <em>Stereotype Qualified Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Stereotype Qualified Name</em>'.
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration#getStereotypeQualifiedName()
+ * @see #getStereotypePropertyReferenceEdgeAdviceConfiguration()
+ * @generated
+ */
+ EAttribute getStereotypePropertyReferenceEdgeAdviceConfiguration_StereotypeQualifiedName();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration#getEdgeLabel <em>Edge Label</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Edge Label</em>'.
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration#getEdgeLabel()
+ * @see #getStereotypePropertyReferenceEdgeAdviceConfiguration()
+ * @generated
+ */
+ EAttribute getStereotypePropertyReferenceEdgeAdviceConfiguration_EdgeLabel();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ StereotypePropertyReferenceEdgeAdviceFactory getStereotypePropertyReferenceEdgeAdviceFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.impl.StereotypePropertyReferenceEdgeAdviceConfigurationImpl <em>Configuration</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.impl.StereotypePropertyReferenceEdgeAdviceConfigurationImpl
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.impl.StereotypePropertyReferenceEdgeAdvicePackageImpl#getStereotypePropertyReferenceEdgeAdviceConfiguration()
+ * @generated
+ */
+ EClass STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION = eINSTANCE.getStereotypePropertyReferenceEdgeAdviceConfiguration();
+
+ /**
+ * The meta object literal for the '<em><b>Feature To Set</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__FEATURE_TO_SET = eINSTANCE.getStereotypePropertyReferenceEdgeAdviceConfiguration_FeatureToSet();
+
+ /**
+ * The meta object literal for the '<em><b>Stereotype Qualified Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__STEREOTYPE_QUALIFIED_NAME = eINSTANCE.getStereotypePropertyReferenceEdgeAdviceConfiguration_StereotypeQualifiedName();
+
+ /**
+ * The meta object literal for the '<em><b>Edge Label</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__EDGE_LABEL = eINSTANCE.getStereotypePropertyReferenceEdgeAdviceConfiguration_EdgeLabel();
+
+ }
+
+} //StereotypePropertyReferenceEdgeAdvicePackage
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/impl/StereotypePropertyReferenceEdgeAdviceConfigurationImpl.java b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/impl/StereotypePropertyReferenceEdgeAdviceConfigurationImpl.java
new file mode 100644
index 00000000000..cd5402a4c8e
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/impl/StereotypePropertyReferenceEdgeAdviceConfigurationImpl.java
@@ -0,0 +1,272 @@
+/**
+ */
+package org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.eclipse.papyrus.infra.types.impl.AbstractAdviceBindingConfigurationImpl;
+
+import org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration;
+import org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdvicePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Configuration</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.impl.StereotypePropertyReferenceEdgeAdviceConfigurationImpl#getFeatureToSet <em>Feature To Set</em>}</li>
+ * <li>{@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.impl.StereotypePropertyReferenceEdgeAdviceConfigurationImpl#getStereotypeQualifiedName <em>Stereotype Qualified Name</em>}</li>
+ * <li>{@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.impl.StereotypePropertyReferenceEdgeAdviceConfigurationImpl#getEdgeLabel <em>Edge Label</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class StereotypePropertyReferenceEdgeAdviceConfigurationImpl extends AbstractAdviceBindingConfigurationImpl implements StereotypePropertyReferenceEdgeAdviceConfiguration {
+ /**
+ * The default value of the '{@link #getFeatureToSet() <em>Feature To Set</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getFeatureToSet()
+ * @generated
+ * @ordered
+ */
+ protected static final String FEATURE_TO_SET_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getFeatureToSet() <em>Feature To Set</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getFeatureToSet()
+ * @generated
+ * @ordered
+ */
+ protected String featureToSet = FEATURE_TO_SET_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getStereotypeQualifiedName() <em>Stereotype Qualified Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getStereotypeQualifiedName()
+ * @generated
+ * @ordered
+ */
+ protected static final String STEREOTYPE_QUALIFIED_NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getStereotypeQualifiedName() <em>Stereotype Qualified Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getStereotypeQualifiedName()
+ * @generated
+ * @ordered
+ */
+ protected String stereotypeQualifiedName = STEREOTYPE_QUALIFIED_NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getEdgeLabel() <em>Edge Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getEdgeLabel()
+ * @generated
+ * @ordered
+ */
+ protected static final String EDGE_LABEL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getEdgeLabel() <em>Edge Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getEdgeLabel()
+ * @generated
+ * @ordered
+ */
+ protected String edgeLabel = EDGE_LABEL_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected StereotypePropertyReferenceEdgeAdviceConfigurationImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return StereotypePropertyReferenceEdgeAdvicePackage.Literals.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getFeatureToSet() {
+ return featureToSet;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setFeatureToSet(String newFeatureToSet) {
+ String oldFeatureToSet = featureToSet;
+ featureToSet = newFeatureToSet;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__FEATURE_TO_SET, oldFeatureToSet, featureToSet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getStereotypeQualifiedName() {
+ return stereotypeQualifiedName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setStereotypeQualifiedName(String newStereotypeQualifiedName) {
+ String oldStereotypeQualifiedName = stereotypeQualifiedName;
+ stereotypeQualifiedName = newStereotypeQualifiedName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__STEREOTYPE_QUALIFIED_NAME, oldStereotypeQualifiedName, stereotypeQualifiedName));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getEdgeLabel() {
+ return edgeLabel;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setEdgeLabel(String newEdgeLabel) {
+ String oldEdgeLabel = edgeLabel;
+ edgeLabel = newEdgeLabel;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__EDGE_LABEL, oldEdgeLabel, edgeLabel));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__FEATURE_TO_SET:
+ return getFeatureToSet();
+ case StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__STEREOTYPE_QUALIFIED_NAME:
+ return getStereotypeQualifiedName();
+ case StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__EDGE_LABEL:
+ return getEdgeLabel();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__FEATURE_TO_SET:
+ setFeatureToSet((String)newValue);
+ return;
+ case StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__STEREOTYPE_QUALIFIED_NAME:
+ setStereotypeQualifiedName((String)newValue);
+ return;
+ case StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__EDGE_LABEL:
+ setEdgeLabel((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__FEATURE_TO_SET:
+ setFeatureToSet(FEATURE_TO_SET_EDEFAULT);
+ return;
+ case StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__STEREOTYPE_QUALIFIED_NAME:
+ setStereotypeQualifiedName(STEREOTYPE_QUALIFIED_NAME_EDEFAULT);
+ return;
+ case StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__EDGE_LABEL:
+ setEdgeLabel(EDGE_LABEL_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__FEATURE_TO_SET:
+ return FEATURE_TO_SET_EDEFAULT == null ? featureToSet != null : !FEATURE_TO_SET_EDEFAULT.equals(featureToSet);
+ case StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__STEREOTYPE_QUALIFIED_NAME:
+ return STEREOTYPE_QUALIFIED_NAME_EDEFAULT == null ? stereotypeQualifiedName != null : !STEREOTYPE_QUALIFIED_NAME_EDEFAULT.equals(stereotypeQualifiedName);
+ case StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__EDGE_LABEL:
+ return EDGE_LABEL_EDEFAULT == null ? edgeLabel != null : !EDGE_LABEL_EDEFAULT.equals(edgeLabel);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (featureToSet: ");
+ result.append(featureToSet);
+ result.append(", stereotypeQualifiedName: ");
+ result.append(stereotypeQualifiedName);
+ result.append(", edgeLabel: ");
+ result.append(edgeLabel);
+ result.append(')');
+ return result.toString();
+ }
+
+} //StereotypePropertyReferenceEdgeAdviceConfigurationImpl
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/impl/StereotypePropertyReferenceEdgeAdviceFactoryImpl.java b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/impl/StereotypePropertyReferenceEdgeAdviceFactoryImpl.java
new file mode 100644
index 00000000000..6b552ac15b0
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/impl/StereotypePropertyReferenceEdgeAdviceFactoryImpl.java
@@ -0,0 +1,95 @@
+/**
+ */
+package org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+import org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class StereotypePropertyReferenceEdgeAdviceFactoryImpl extends EFactoryImpl implements StereotypePropertyReferenceEdgeAdviceFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static StereotypePropertyReferenceEdgeAdviceFactory init() {
+ try {
+ StereotypePropertyReferenceEdgeAdviceFactory theStereotypePropertyReferenceEdgeAdviceFactory = (StereotypePropertyReferenceEdgeAdviceFactory)EPackage.Registry.INSTANCE.getEFactory(StereotypePropertyReferenceEdgeAdvicePackage.eNS_URI);
+ if (theStereotypePropertyReferenceEdgeAdviceFactory != null) {
+ return theStereotypePropertyReferenceEdgeAdviceFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new StereotypePropertyReferenceEdgeAdviceFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public StereotypePropertyReferenceEdgeAdviceFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION: return createStereotypePropertyReferenceEdgeAdviceConfiguration();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public StereotypePropertyReferenceEdgeAdviceConfiguration createStereotypePropertyReferenceEdgeAdviceConfiguration() {
+ StereotypePropertyReferenceEdgeAdviceConfigurationImpl stereotypePropertyReferenceEdgeAdviceConfiguration = new StereotypePropertyReferenceEdgeAdviceConfigurationImpl();
+ return stereotypePropertyReferenceEdgeAdviceConfiguration;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public StereotypePropertyReferenceEdgeAdvicePackage getStereotypePropertyReferenceEdgeAdvicePackage() {
+ return (StereotypePropertyReferenceEdgeAdvicePackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static StereotypePropertyReferenceEdgeAdvicePackage getPackage() {
+ return StereotypePropertyReferenceEdgeAdvicePackage.eINSTANCE;
+ }
+
+} //StereotypePropertyReferenceEdgeAdviceFactoryImpl
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/impl/StereotypePropertyReferenceEdgeAdvicePackageImpl.java b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/impl/StereotypePropertyReferenceEdgeAdvicePackageImpl.java
new file mode 100644
index 00000000000..b318d41e5ee
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/impl/StereotypePropertyReferenceEdgeAdvicePackageImpl.java
@@ -0,0 +1,211 @@
+/**
+ */
+package org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.impl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EcorePackage;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.papyrus.infra.types.ElementTypesConfigurationsPackage;
+
+import org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration;
+import org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceFactory;
+import org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdvicePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class StereotypePropertyReferenceEdgeAdvicePackageImpl extends EPackageImpl implements StereotypePropertyReferenceEdgeAdvicePackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass stereotypePropertyReferenceEdgeAdviceConfigurationEClass = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdvicePackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private StereotypePropertyReferenceEdgeAdvicePackageImpl() {
+ super(eNS_URI, StereotypePropertyReferenceEdgeAdviceFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
+ *
+ * <p>This method is used to initialize {@link StereotypePropertyReferenceEdgeAdvicePackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static StereotypePropertyReferenceEdgeAdvicePackage init() {
+ if (isInited) return (StereotypePropertyReferenceEdgeAdvicePackage)EPackage.Registry.INSTANCE.getEPackage(StereotypePropertyReferenceEdgeAdvicePackage.eNS_URI);
+
+ // Obtain or create and register package
+ StereotypePropertyReferenceEdgeAdvicePackageImpl theStereotypePropertyReferenceEdgeAdvicePackage = (StereotypePropertyReferenceEdgeAdvicePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof StereotypePropertyReferenceEdgeAdvicePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new StereotypePropertyReferenceEdgeAdvicePackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ EcorePackage.eINSTANCE.eClass();
+ ElementTypesConfigurationsPackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ theStereotypePropertyReferenceEdgeAdvicePackage.createPackageContents();
+
+ // Initialize created meta-data
+ theStereotypePropertyReferenceEdgeAdvicePackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theStereotypePropertyReferenceEdgeAdvicePackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(StereotypePropertyReferenceEdgeAdvicePackage.eNS_URI, theStereotypePropertyReferenceEdgeAdvicePackage);
+ return theStereotypePropertyReferenceEdgeAdvicePackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getStereotypePropertyReferenceEdgeAdviceConfiguration() {
+ return stereotypePropertyReferenceEdgeAdviceConfigurationEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getStereotypePropertyReferenceEdgeAdviceConfiguration_FeatureToSet() {
+ return (EAttribute)stereotypePropertyReferenceEdgeAdviceConfigurationEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getStereotypePropertyReferenceEdgeAdviceConfiguration_StereotypeQualifiedName() {
+ return (EAttribute)stereotypePropertyReferenceEdgeAdviceConfigurationEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getStereotypePropertyReferenceEdgeAdviceConfiguration_EdgeLabel() {
+ return (EAttribute)stereotypePropertyReferenceEdgeAdviceConfigurationEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public StereotypePropertyReferenceEdgeAdviceFactory getStereotypePropertyReferenceEdgeAdviceFactory() {
+ return (StereotypePropertyReferenceEdgeAdviceFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents() {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ stereotypePropertyReferenceEdgeAdviceConfigurationEClass = createEClass(STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION);
+ createEAttribute(stereotypePropertyReferenceEdgeAdviceConfigurationEClass, STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__FEATURE_TO_SET);
+ createEAttribute(stereotypePropertyReferenceEdgeAdviceConfigurationEClass, STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__STEREOTYPE_QUALIFIED_NAME);
+ createEAttribute(stereotypePropertyReferenceEdgeAdviceConfigurationEClass, STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__EDGE_LABEL);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents() {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Obtain other dependent packages
+ ElementTypesConfigurationsPackage theElementTypesConfigurationsPackage = (ElementTypesConfigurationsPackage)EPackage.Registry.INSTANCE.getEPackage(ElementTypesConfigurationsPackage.eNS_URI);
+ EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+ stereotypePropertyReferenceEdgeAdviceConfigurationEClass.getESuperTypes().add(theElementTypesConfigurationsPackage.getAbstractAdviceBindingConfiguration());
+
+ // Initialize classes, features, and operations; add parameters
+ initEClass(stereotypePropertyReferenceEdgeAdviceConfigurationEClass, StereotypePropertyReferenceEdgeAdviceConfiguration.class, "StereotypePropertyReferenceEdgeAdviceConfiguration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getStereotypePropertyReferenceEdgeAdviceConfiguration_FeatureToSet(), ecorePackage.getEString(), "featureToSet", null, 1, 1, StereotypePropertyReferenceEdgeAdviceConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getStereotypePropertyReferenceEdgeAdviceConfiguration_StereotypeQualifiedName(), ecorePackage.getEString(), "stereotypeQualifiedName", null, 1, 1, StereotypePropertyReferenceEdgeAdviceConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getStereotypePropertyReferenceEdgeAdviceConfiguration_EdgeLabel(), theEcorePackage.getEString(), "edgeLabel", null, 0, 1, StereotypePropertyReferenceEdgeAdviceConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //StereotypePropertyReferenceEdgeAdvicePackageImpl
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/provider/StereotypePropertyReferenceEdgeAdviceConfigurationItemProvider.java b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/provider/StereotypePropertyReferenceEdgeAdviceConfigurationItemProvider.java
new file mode 100644
index 00000000000..d329689e765
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/provider/StereotypePropertyReferenceEdgeAdviceConfigurationItemProvider.java
@@ -0,0 +1,195 @@
+/**
+ */
+package org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+import org.eclipse.papyrus.infra.types.provider.AbstractAdviceBindingConfigurationItemProvider;
+
+import org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration;
+import org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdvicePackage;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class StereotypePropertyReferenceEdgeAdviceConfigurationItemProvider extends AbstractAdviceBindingConfigurationItemProvider {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public StereotypePropertyReferenceEdgeAdviceConfigurationItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addFeatureToSetPropertyDescriptor(object);
+ addStereotypeQualifiedNamePropertyDescriptor(object);
+ addEdgeLabelPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Feature To Set feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addFeatureToSetPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_StereotypePropertyReferenceEdgeAdviceConfiguration_featureToSet_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_StereotypePropertyReferenceEdgeAdviceConfiguration_featureToSet_feature", "_UI_StereotypePropertyReferenceEdgeAdviceConfiguration_type"),
+ StereotypePropertyReferenceEdgeAdvicePackage.Literals.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__FEATURE_TO_SET,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Stereotype Qualified Name feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addStereotypeQualifiedNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_StereotypePropertyReferenceEdgeAdviceConfiguration_stereotypeQualifiedName_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_StereotypePropertyReferenceEdgeAdviceConfiguration_stereotypeQualifiedName_feature", "_UI_StereotypePropertyReferenceEdgeAdviceConfiguration_type"),
+ StereotypePropertyReferenceEdgeAdvicePackage.Literals.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__STEREOTYPE_QUALIFIED_NAME,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Edge Label feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addEdgeLabelPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_StereotypePropertyReferenceEdgeAdviceConfiguration_edgeLabel_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_StereotypePropertyReferenceEdgeAdviceConfiguration_edgeLabel_feature", "_UI_StereotypePropertyReferenceEdgeAdviceConfiguration_type"),
+ StereotypePropertyReferenceEdgeAdvicePackage.Literals.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__EDGE_LABEL,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This returns StereotypePropertyReferenceEdgeAdviceConfiguration.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/StereotypePropertyReferenceEdgeAdviceConfiguration"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((StereotypePropertyReferenceEdgeAdviceConfiguration)object).getStereotypeQualifiedName();
+ return label == null || label.length() == 0 ?
+ getString("_UI_StereotypePropertyReferenceEdgeAdviceConfiguration_type") :
+ getString("_UI_StereotypePropertyReferenceEdgeAdviceConfiguration_type") + " " + label;
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(StereotypePropertyReferenceEdgeAdviceConfiguration.class)) {
+ case StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__FEATURE_TO_SET:
+ case StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__STEREOTYPE_QUALIFIED_NAME:
+ case StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION__EDGE_LABEL:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return StereotypePropertyReferenceEdgeAdviceEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/provider/StereotypePropertyReferenceEdgeAdviceEditPlugin.java b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/provider/StereotypePropertyReferenceEdgeAdviceEditPlugin.java
new file mode 100644
index 00000000000..f23664e1788
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/provider/StereotypePropertyReferenceEdgeAdviceEditPlugin.java
@@ -0,0 +1,95 @@
+/**
+ */
+package org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.provider;
+
+import org.eclipse.emf.common.EMFPlugin;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
+
+import org.eclipse.papyrus.infra.types.provider.TypesConfigurationsEditPlugin;
+
+/**
+ * This is the central singleton for the StereotypePropertyReferenceEdgeAdvice edit plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public final class StereotypePropertyReferenceEdgeAdviceEditPlugin extends EMFPlugin {
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final StereotypePropertyReferenceEdgeAdviceEditPlugin INSTANCE = new StereotypePropertyReferenceEdgeAdviceEditPlugin();
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public StereotypePropertyReferenceEdgeAdviceEditPlugin() {
+ super
+ (new ResourceLocator [] {
+ EcoreEditPlugin.INSTANCE,
+ TypesConfigurationsEditPlugin.INSTANCE,
+ });
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator() {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin() {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse <b>Plugin</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static class Implementation extends EclipsePlugin {
+ /**
+ * Creates an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/provider/StereotypePropertyReferenceEdgeAdviceItemProviderAdapterFactory.java b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/provider/StereotypePropertyReferenceEdgeAdviceItemProviderAdapterFactory.java
new file mode 100644
index 00000000000..e7827a4edd1
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/provider/StereotypePropertyReferenceEdgeAdviceItemProviderAdapterFactory.java
@@ -0,0 +1,303 @@
+/**
+ */
+package org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.provider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.edit.command.CommandParameter;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+
+import org.eclipse.emf.edit.provider.ChangeNotifier;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.IChildCreationExtender;
+import org.eclipse.emf.edit.provider.IDisposable;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+
+import org.eclipse.papyrus.infra.types.ElementTypeSetConfiguration;
+import org.eclipse.papyrus.infra.types.ElementTypesConfigurationsPackage;
+
+import org.eclipse.papyrus.infra.types.util.ElementTypesConfigurationsSwitch;
+
+import org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceFactory;
+
+import org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.util.StereotypePropertyReferenceEdgeAdviceAdapterFactory;
+
+/**
+ * This is the factory that is used to provide the interfaces needed to support Viewers.
+ * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}.
+ * The adapters also support Eclipse property sheets.
+ * Note that most of the adapters are shared among multiple instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class StereotypePropertyReferenceEdgeAdviceItemProviderAdapterFactory extends StereotypePropertyReferenceEdgeAdviceAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable {
+ /**
+ * This keeps track of the root adapter factory that delegates to this adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory parentAdapterFactory;
+
+ /**
+ * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IChangeNotifier changeNotifier = new ChangeNotifier();
+
+ /**
+ * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Object> supportedTypes = new ArrayList<Object>();
+
+ /**
+ * This constructs an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public StereotypePropertyReferenceEdgeAdviceItemProviderAdapterFactory() {
+ supportedTypes.add(IEditingDomainItemProvider.class);
+ supportedTypes.add(IStructuredItemContentProvider.class);
+ supportedTypes.add(ITreeItemContentProvider.class);
+ supportedTypes.add(IItemLabelProvider.class);
+ supportedTypes.add(IItemPropertySource.class);
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected StereotypePropertyReferenceEdgeAdviceConfigurationItemProvider stereotypePropertyReferenceEdgeAdviceConfigurationItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createStereotypePropertyReferenceEdgeAdviceConfigurationAdapter() {
+ if (stereotypePropertyReferenceEdgeAdviceConfigurationItemProvider == null) {
+ stereotypePropertyReferenceEdgeAdviceConfigurationItemProvider = new StereotypePropertyReferenceEdgeAdviceConfigurationItemProvider(this);
+ }
+
+ return stereotypePropertyReferenceEdgeAdviceConfigurationItemProvider;
+ }
+
+ /**
+ * This returns the root adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ComposeableAdapterFactory getRootAdapterFactory() {
+ return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
+ }
+
+ /**
+ * This sets the composed adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) {
+ this.parentAdapterFactory = parentAdapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object type) {
+ return supportedTypes.contains(type) || super.isFactoryForType(type);
+ }
+
+ /**
+ * This implementation substitutes the factory itself as the key for the adapter.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter adapt(Notifier notifier, Object type) {
+ return super.adapt(notifier, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object adapt(Object object, Object type) {
+ if (isFactoryForType(type)) {
+ Object adapter = super.adapt(object, type);
+ if (!(type instanceof Class<?>) || (((Class<?>)type).isInstance(adapter))) {
+ return adapter;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * This adds a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.addListener(notifyChangedListener);
+ }
+
+ /**
+ * This removes a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.removeListener(notifyChangedListener);
+ }
+
+ /**
+ * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void fireNotifyChanged(Notification notification) {
+ changeNotifier.fireNotifyChanged(notification);
+
+ if (parentAdapterFactory != null) {
+ parentAdapterFactory.fireNotifyChanged(notification);
+ }
+ }
+
+ /**
+ * This disposes all of the item providers created by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void dispose() {
+ if (stereotypePropertyReferenceEdgeAdviceConfigurationItemProvider != null) stereotypePropertyReferenceEdgeAdviceConfigurationItemProvider.dispose();
+ }
+
+ /**
+ * A child creation extender for the {@link ElementTypesConfigurationsPackage}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static class ElementTypesConfigurationsChildCreationExtender implements IChildCreationExtender {
+ /**
+ * The switch for creating child descriptors specific to each extended class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static class CreationSwitch extends ElementTypesConfigurationsSwitch<Object> {
+ /**
+ * The child descriptors being populated.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<Object> newChildDescriptors;
+
+ /**
+ * The domain in which to create the children.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EditingDomain editingDomain;
+
+ /**
+ * Creates the a switch for populating child descriptors in the given domain.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ CreationSwitch(List<Object> newChildDescriptors, EditingDomain editingDomain) {
+ this.newChildDescriptors = newChildDescriptors;
+ this.editingDomain = editingDomain;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object caseElementTypeSetConfiguration(ElementTypeSetConfiguration object) {
+ newChildDescriptors.add
+ (createChildParameter
+ (ElementTypesConfigurationsPackage.Literals.ELEMENT_TYPE_SET_CONFIGURATION__ADVICE_BINDINGS_CONFIGURATIONS,
+ StereotypePropertyReferenceEdgeAdviceFactory.eINSTANCE.createStereotypePropertyReferenceEdgeAdviceConfiguration()));
+
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CommandParameter createChildParameter(Object feature, Object child) {
+ return new CommandParameter(null, feature, child);
+ }
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Collection<Object> getNewChildDescriptors(Object object, EditingDomain editingDomain) {
+ ArrayList<Object> result = new ArrayList<Object>();
+ new CreationSwitch(result, editingDomain).doSwitch((EObject)object);
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ResourceLocator getResourceLocator() {
+ return StereotypePropertyReferenceEdgeAdviceEditPlugin.INSTANCE;
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/util/StereotypePropertyReferenceEdgeAdviceAdapterFactory.java b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/util/StereotypePropertyReferenceEdgeAdviceAdapterFactory.java
new file mode 100644
index 00000000000..42ceaf63dfe
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/util/StereotypePropertyReferenceEdgeAdviceAdapterFactory.java
@@ -0,0 +1,197 @@
+/**
+ */
+package org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.papyrus.infra.types.AbstractAdviceBindingConfiguration;
+import org.eclipse.papyrus.infra.types.AdviceConfiguration;
+import org.eclipse.papyrus.infra.types.ConfigurationElement;
+import org.eclipse.papyrus.infra.types.IdentifiedConfiguration;
+
+import org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdvicePackage
+ * @generated
+ */
+public class StereotypePropertyReferenceEdgeAdviceAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static StereotypePropertyReferenceEdgeAdvicePackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public StereotypePropertyReferenceEdgeAdviceAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = StereotypePropertyReferenceEdgeAdvicePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected StereotypePropertyReferenceEdgeAdviceSwitch<Adapter> modelSwitch =
+ new StereotypePropertyReferenceEdgeAdviceSwitch<Adapter>() {
+ @Override
+ public Adapter caseStereotypePropertyReferenceEdgeAdviceConfiguration(StereotypePropertyReferenceEdgeAdviceConfiguration object) {
+ return createStereotypePropertyReferenceEdgeAdviceConfigurationAdapter();
+ }
+ @Override
+ public Adapter caseConfigurationElement(ConfigurationElement object) {
+ return createConfigurationElementAdapter();
+ }
+ @Override
+ public Adapter caseAdviceConfiguration(AdviceConfiguration object) {
+ return createAdviceConfigurationAdapter();
+ }
+ @Override
+ public Adapter caseIdentifiedConfiguration(IdentifiedConfiguration object) {
+ return createIdentifiedConfigurationAdapter();
+ }
+ @Override
+ public Adapter caseAbstractAdviceBindingConfiguration(AbstractAdviceBindingConfiguration object) {
+ return createAbstractAdviceBindingConfigurationAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration <em>Configuration</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration
+ * @generated
+ */
+ public Adapter createStereotypePropertyReferenceEdgeAdviceConfigurationAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.types.ConfigurationElement <em>Configuration Element</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.infra.types.ConfigurationElement
+ * @generated
+ */
+ public Adapter createConfigurationElementAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.types.AdviceConfiguration <em>Advice Configuration</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.infra.types.AdviceConfiguration
+ * @generated
+ */
+ public Adapter createAdviceConfigurationAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.types.IdentifiedConfiguration <em>Identified Configuration</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.infra.types.IdentifiedConfiguration
+ * @generated
+ */
+ public Adapter createIdentifiedConfigurationAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.types.AbstractAdviceBindingConfiguration <em>Abstract Advice Binding Configuration</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.infra.types.AbstractAdviceBindingConfiguration
+ * @generated
+ */
+ public Adapter createAbstractAdviceBindingConfigurationAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //StereotypePropertyReferenceEdgeAdviceAdapterFactory
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/util/StereotypePropertyReferenceEdgeAdviceSwitch.java b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/util/StereotypePropertyReferenceEdgeAdviceSwitch.java
new file mode 100644
index 00000000000..829ac29a718
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/src-gen/org/eclipse/papyrus/uml/types/core/advices/stereotypepropertyreferenceedgeadvice/util/StereotypePropertyReferenceEdgeAdviceSwitch.java
@@ -0,0 +1,179 @@
+/**
+ */
+package org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.util;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+import org.eclipse.papyrus.infra.types.AbstractAdviceBindingConfiguration;
+import org.eclipse.papyrus.infra.types.AdviceConfiguration;
+import org.eclipse.papyrus.infra.types.ConfigurationElement;
+import org.eclipse.papyrus.infra.types.IdentifiedConfiguration;
+
+import org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdvicePackage
+ * @generated
+ */
+public class StereotypePropertyReferenceEdgeAdviceSwitch<T> extends Switch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static StereotypePropertyReferenceEdgeAdvicePackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public StereotypePropertyReferenceEdgeAdviceSwitch() {
+ if (modelPackage == null) {
+ modelPackage = StereotypePropertyReferenceEdgeAdvicePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case StereotypePropertyReferenceEdgeAdvicePackage.STEREOTYPE_PROPERTY_REFERENCE_EDGE_ADVICE_CONFIGURATION: {
+ StereotypePropertyReferenceEdgeAdviceConfiguration stereotypePropertyReferenceEdgeAdviceConfiguration = (StereotypePropertyReferenceEdgeAdviceConfiguration)theEObject;
+ T result = caseStereotypePropertyReferenceEdgeAdviceConfiguration(stereotypePropertyReferenceEdgeAdviceConfiguration);
+ if (result == null) result = caseAbstractAdviceBindingConfiguration(stereotypePropertyReferenceEdgeAdviceConfiguration);
+ if (result == null) result = caseAdviceConfiguration(stereotypePropertyReferenceEdgeAdviceConfiguration);
+ if (result == null) result = caseIdentifiedConfiguration(stereotypePropertyReferenceEdgeAdviceConfiguration);
+ if (result == null) result = caseConfigurationElement(stereotypePropertyReferenceEdgeAdviceConfiguration);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Configuration</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Configuration</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseStereotypePropertyReferenceEdgeAdviceConfiguration(StereotypePropertyReferenceEdgeAdviceConfiguration object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Configuration Element</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Configuration Element</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseConfigurationElement(ConfigurationElement object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Advice Configuration</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Advice Configuration</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseAdviceConfiguration(AdviceConfiguration object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Identified Configuration</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Identified Configuration</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseIdentifiedConfiguration(IdentifiedConfiguration object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Abstract Advice Binding Configuration</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Abstract Advice Binding Configuration</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseAbstractAdviceBindingConfiguration(AbstractAdviceBindingConfiguration object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //StereotypePropertyReferenceEdgeAdviceSwitch
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/src/org/eclipse/papyrus/uml/types/core/advices/stereotypereferencelink/StereotypePropertyReferenceEdgeAdviceConfigurationFactory.java b/plugins/uml/org.eclipse.papyrus.uml.types.core/src/org/eclipse/papyrus/uml/types/core/advices/stereotypereferencelink/StereotypePropertyReferenceEdgeAdviceConfigurationFactory.java
new file mode 100644
index 00000000000..d97c6d937c8
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/src/org/eclipse/papyrus/uml/types/core/advices/stereotypereferencelink/StereotypePropertyReferenceEdgeAdviceConfigurationFactory.java
@@ -0,0 +1,54 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.types.core.advices.stereotypereferencelink;
+
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
+import org.eclipse.papyrus.infra.types.AbstractAdviceBindingConfiguration;
+import org.eclipse.papyrus.infra.types.core.factories.impl.AbstractAdviceBindingFactory;
+import org.eclipse.papyrus.infra.types.core.impl.NullEditHelperAdvice;
+import org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration;
+import org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceFactory;
+
+
+/**
+ * A factory for creating {@link StereotypePropertyReferenceEdgeAdviceConfiguration} objects.
+ *
+ * @since 3.1
+ */
+public class StereotypePropertyReferenceEdgeAdviceConfigurationFactory extends AbstractAdviceBindingFactory<AbstractAdviceBindingConfiguration> {
+
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.types.core.factories.impl.AbstractAdviceFactory#getEditHelperAdvice(org.eclipse.papyrus.infra.types.AdviceConfiguration)
+ */
+ @Override
+ protected IEditHelperAdvice getEditHelperAdvice(final AbstractAdviceBindingConfiguration adviceConfiguration) {
+ if (adviceConfiguration instanceof StereotypePropertyReferenceEdgeAdviceConfiguration) {
+ IEditHelperAdvice editHelperAdvice = new StereotypePropertyReferenceEdgeAdviceEditHelperAdvice((StereotypePropertyReferenceEdgeAdviceConfiguration) adviceConfiguration);
+ return editHelperAdvice;
+ }
+ return NullEditHelperAdvice.getInstance();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.types.core.factories.impl.AbstractAdviceBindingFactory#createAdviceBindingConfiguration()
+ */
+ @Override
+ public AbstractAdviceBindingConfiguration createAdviceBindingConfiguration() {
+ return StereotypePropertyReferenceEdgeAdviceFactory.eINSTANCE.createStereotypePropertyReferenceEdgeAdviceConfiguration();
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/src/org/eclipse/papyrus/uml/types/core/advices/stereotypereferencelink/StereotypePropertyReferenceEdgeAdviceEditHelperAdvice.java b/plugins/uml/org.eclipse.papyrus.uml.types.core/src/org/eclipse/papyrus/uml/types/core/advices/stereotypereferencelink/StereotypePropertyReferenceEdgeAdviceEditHelperAdvice.java
new file mode 100644
index 00000000000..d7f2c1e90bf
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/src/org/eclipse/papyrus/uml/types/core/advices/stereotypereferencelink/StereotypePropertyReferenceEdgeAdviceEditHelperAdvice.java
@@ -0,0 +1,208 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.types.core.advices.stereotypereferencelink;
+
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.IdentityCommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.GetEditContextCommand;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice;
+import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
+import org.eclipse.papyrus.uml.tools.utils.UMLUtil;
+import org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration;
+import org.eclipse.papyrus.uml.types.core.commands.EditStereotypePropertyReferenceCommand;
+import org.eclipse.uml2.common.util.UML2Util;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.Type;
+
+/**
+ * Advice for the {@link StereotypePropertyReferenceEdgeAdviceConfiguration}.
+ *
+ * @since 3.1
+ */
+public class StereotypePropertyReferenceEdgeAdviceEditHelperAdvice extends AbstractEditHelperAdvice implements IStereotypePropertyReferenceEdgeAdvice {
+
+ /** The configuration. */
+ protected StereotypePropertyReferenceEdgeAdviceConfiguration configuration;
+
+ /** The stereotype to set Qualify name. */
+ protected String stereotypeQualifiedName;
+
+ /** The feature to set. */
+ protected String featureToSet;
+
+ /** The edge label. */
+ protected String edgeLabel;
+
+
+ /**
+ * Instantiates a new stereotype property reference edge advice edit helper advice.
+ *
+ * @param configuration
+ * the configuration
+ */
+ public StereotypePropertyReferenceEdgeAdviceEditHelperAdvice(final StereotypePropertyReferenceEdgeAdviceConfiguration configuration) {
+ if (null != configuration) {
+ this.configuration = configuration;
+ this.stereotypeQualifiedName = this.configuration.getStereotypeQualifiedName();
+ this.featureToSet = this.configuration.getFeatureToSet();
+ this.edgeLabel = this.configuration.getEdgeLabel();
+ }
+ }
+
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getBeforeEditContextCommand(org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest)
+ */
+ @Override
+ protected ICommand getBeforeEditContextCommand(final GetEditContextRequest request) {
+ GetEditContextCommand command = new GetEditContextCommand(request);
+ command.setEditContext(request.getEditHelperContext());
+ return command;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#approveRequest(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
+ */
+ @Override
+ public boolean approveRequest(final IEditCommandRequest request) {
+ if (request instanceof CreateRelationshipRequest) {
+ // Check the configuration
+ if (configuration == null) {
+ return false;
+ }
+
+ EObject source = ((CreateRelationshipRequest) request).getSource();
+ EObject target = ((CreateRelationshipRequest) request).getTarget();
+
+ if (null == target && source instanceof Element) {
+ return ElementUtil.hasStereotypeApplied((Element) source, stereotypeQualifiedName);
+ } else {
+ return canCreate(source, target);
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice#getAfterCreateRelationshipCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest)
+ */
+ @Override
+ protected ICommand getAfterCreateRelationshipCommand(final CreateRelationshipRequest request) {
+ ICommand command = null;
+ EObject source = request.getSource();
+ EObject target = request.getTarget();
+
+ boolean noSourceOrTarget = (source == null || target == null);
+ boolean noSourceAndTarget = (source == null && target == null);
+
+ if (!noSourceOrTarget && !canCreate(source, target)) {
+ command = UnexecutableCommand.INSTANCE;
+ } else if (noSourceOrTarget && !noSourceAndTarget) {
+ // The request isn't complete yet. Return the identity command so
+ // that the create relationship gesture is enabled.
+ command = IdentityCommand.INSTANCE;
+ } else {
+ command = new CompositeCommand("Create stereotype property reference link");//$NON-NLS-1$
+ ((CompositeCommand) command).add(new EditStereotypePropertyReferenceCommand("Set stereotype property reference", request, configuration));//$NON-NLS-1$
+ }
+ return command;
+ }
+
+ /**
+ * @param source
+ * The source {@link EObject}.
+ * @param target
+ * The target {@link EObject}.
+ * @return true if a Reference link can be create and the target can be reference into the source.
+ */
+ private boolean canCreate(final EObject source, final EObject target) {
+ boolean canCreate = false;
+
+ if (source instanceof Element && target instanceof Element) {
+
+ // Test if the Source have the good applied stereotype
+ if (ElementUtil.hasStereotypeApplied((Element) source, stereotypeQualifiedName)) {
+ // Source is ok: test if the target have the good stereotype
+ Stereotype sourceStereotype = ((Element) source).getApplicableStereotype(stereotypeQualifiedName);
+ Property attribute = sourceStereotype.getAttribute(featureToSet, null);
+ if (null != attribute) {
+ Type targetType = attribute.getType();
+ if (targetType instanceof Stereotype) {
+ // feature as stereotype reference
+ canCreate = ElementUtil.hasStereotypeApplied((Element) target, targetType.getQualifiedName());
+ } else {
+ EObject stereotypeApplication = ((Element) source).getStereotypeApplication(UMLUtil.getAppliedSubstereotype((Element) source, sourceStereotype));
+ EStructuralFeature eStructuralFeature = stereotypeApplication.eClass().getEStructuralFeature(UML2Util.getValidJavaIdentifier(featureToSet));
+ if (null != eStructuralFeature) {
+ EClassifier metaclass = eStructuralFeature.getEType();
+ if (metaclass instanceof EClassifier) {
+ canCreate = ((EClassifier) metaclass).isInstance(target);
+ }
+ }
+ }
+ }
+ }
+ }
+ return canCreate;
+
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice#getFeatureToSet()
+ */
+ @Override
+ public String getFeatureToSet() {
+ return featureToSet;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice#getStereotypeQualifiedName()
+ */
+ @Override
+ public String getStereotypeQualifiedName() {
+ return stereotypeQualifiedName;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice#getEdgeLabel()
+ */
+ @Override
+ public String getEdgeLabel() {
+ return edgeLabel;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/src/org/eclipse/papyrus/uml/types/core/commands/EditStereotypePropertyReferenceCommand.java b/plugins/uml/org.eclipse.papyrus.uml.types.core/src/org/eclipse/papyrus/uml/types/core/commands/EditStereotypePropertyReferenceCommand.java
new file mode 100644
index 00000000000..4e611bd8bd4
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/src/org/eclipse/papyrus/uml/types/core/commands/EditStereotypePropertyReferenceCommand.java
@@ -0,0 +1,191 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.types.core.commands;
+
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.papyrus.uml.tools.utils.UMLUtil;
+import org.eclipse.papyrus.uml.types.core.Activator;
+import org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.Type;
+
+/**
+ * Command for Edit stereotype property reference.
+ *
+ * @author Mickael ADAM
+ * @since 3.1
+ */
+public class EditStereotypePropertyReferenceCommand extends EditElementCommand {
+
+ /** The stereotype. */
+ private Stereotype stereotype;
+
+ /** The value. */
+ private EObject value;
+
+ /** The attribute. */
+ private Property attribute;
+
+ /** The element to configure. */
+ private EObject elementToConfigure;
+
+ /** The feature to set. */
+ private String featureToSet;
+
+ /** The stereotype qualify name. */
+ private String stereotypeQualifyName;
+
+ /** The configuration. */
+ private StereotypePropertyReferenceEdgeAdviceConfiguration configuration;
+
+ /** The request. */
+ private CreateRelationshipRequest request;
+
+
+ /**
+ * Constructor.
+ *
+ * @param label
+ * the command label
+ * @param request
+ * the {@link CreateRelationshipRequest} request
+ * @param configuration
+ * the configuration
+ */
+ public EditStereotypePropertyReferenceCommand(final String label, final CreateRelationshipRequest request, final StereotypePropertyReferenceEdgeAdviceConfiguration configuration) {
+ super(label, null, request);
+ this.request = request;
+ this.configuration = configuration;
+ this.stereotypeQualifyName = this.configuration.getStereotypeQualifiedName();
+ this.featureToSet = this.configuration.getFeatureToSet();
+ init(request);
+ }
+
+ /**
+ * Initialize the instantiation.
+ *
+ * @param request
+ * the request
+ */
+ private void init(final CreateRelationshipRequest request) {
+ EObject source = request.getSource();
+ EObject target = request.getTarget();
+
+ // retrieve eObject
+ elementToConfigure = source;
+ if (null != configuration && elementToConfigure instanceof Element) {
+
+ TransactionalEditingDomain editingDomain = request.getEditingDomain();
+ if (null != editingDomain) {
+
+ Stereotype targetStereotype = ((Element) elementToConfigure).getApplicableStereotype(stereotypeQualifyName);
+
+ if (null != targetStereotype) {
+ attribute = targetStereotype.getAttribute(featureToSet, null);
+ stereotype = UMLUtil.getAppliedSubstereotype((Element) elementToConfigure, targetStereotype);
+ Type targetType = attribute.getType();
+ // Gets
+ value = null;
+ if (targetType instanceof Stereotype) {
+ value = getStereotypeApplication((Element) target, (Stereotype) targetType);
+ } else {
+ value = target;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * @return true, if can execute
+ * @see org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand#canExecute()
+ */
+ @Override
+ public boolean canExecute() {
+ return null != attribute && null != elementToConfigure;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ */
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) {
+ try {
+ if (1 == attribute.getUpper()) {
+ // single ref cases
+ ((Element) elementToConfigure).setValue(stereotype, featureToSet, value);
+ ICommand cleanStereotypePropertyReferenceLinkCommand = StereotypePropertyReferenceEdgeUtil.getCleanStereotypePropertyReferenceEdgeCommand(request, stereotypeQualifyName, featureToSet);
+ if (null != cleanStereotypePropertyReferenceLinkCommand && cleanStereotypePropertyReferenceLinkCommand.canExecute()) {
+ try {
+ cleanStereotypePropertyReferenceLinkCommand.execute(null, null);
+ } catch (ExecutionException e) {
+ Activator.log.error(e);
+ }
+ }
+ } else {
+ // multiple references case
+ Object list = ((Element) elementToConfigure).getValue(stereotype, featureToSet);
+ if (list instanceof List) {
+ ((List) list).add(value);
+ }
+ }
+ } catch (IllegalArgumentException e) {
+ return CommandResult.newErrorCommandResult(e);
+ }
+
+ return CommandResult.newOKCommandResult();
+ }
+
+
+ /**
+ * Gets the stereotype application.
+ *
+ * @param umlElement
+ * the uml element
+ * @param stereotype
+ * the stereotype
+ * @return the stereotype application
+ */
+ protected EObject getStereotypeApplication(final Element umlElement, final Stereotype stereotype) {
+ Stereotype actual = (stereotype == null) ? null : UMLUtil.getAppliedSubstereotype(umlElement, stereotype);
+ EObject stereotypeApplication = (actual == null) ? null : umlElement.getStereotypeApplication(actual);
+ return stereotypeApplication;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * No element to edit here.
+ *
+ * @see org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand#setElementToEdit(org.eclipse.emf.ecore.EObject)
+ */
+ @Override
+ protected void setElementToEdit(final EObject element) {
+ throw new UnsupportedOperationException();
+ }
+
+} \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.core/src/org/eclipse/papyrus/uml/types/core/commands/StereotypePropertyReferenceEdgeUtil.java b/plugins/uml/org.eclipse.papyrus.uml.types.core/src/org/eclipse/papyrus/uml/types/core/commands/StereotypePropertyReferenceEdgeUtil.java
new file mode 100644
index 00000000000..a72ed6ffcb6
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.core/src/org/eclipse/papyrus/uml/types/core/commands/StereotypePropertyReferenceEdgeUtil.java
@@ -0,0 +1,423 @@
+/*****************************************************************************
+ * Copyright (c) 2017 CEA LIST, ALL4TEC and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.types.core.commands;
+
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.FEATURE_TO_SET_ANNOTATION_KEY;
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT;
+import static org.eclipse.papyrus.uml.diagram.common.stereotype.IStereotypePropertyReferenceEdgeAdvice.STEREOTYPE_QUALIFIED_NAME_ANNOTATION_KEY;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
+import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
+import org.eclipse.papyrus.uml.tools.utils.UMLUtil;
+import org.eclipse.uml2.common.util.CacheAdapter;
+import org.eclipse.uml2.common.util.UML2Util;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.Type;
+
+/**
+ * The Util Class stereotype property reference edge.
+ *
+ * @author Mickael ADAM
+ * @since 3.1
+ */
+public class StereotypePropertyReferenceEdgeUtil {
+
+ public static boolean checkNotOrphanStereotypePropertyReferenceEdgeNotYetSet(final Edge edge, final String stereotypeToSet, final String featureToSet, final Object newFeatureValue) {
+ boolean notOrphan = false;
+ if (null != edge) {
+ EAnnotation eAnnotation = ((View) edge).getEAnnotation(STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT);
+ if (null != eAnnotation) {
+ String stereotypeQNAnnotation = eAnnotation.getDetails().get(STEREOTYPE_QUALIFIED_NAME_ANNOTATION_KEY);
+ String featureToSetAnnotation = eAnnotation.getDetails().get(FEATURE_TO_SET_ANNOTATION_KEY);
+ // Test annotation
+ if (null != stereotypeQNAnnotation && null != featureToSetAnnotation) {
+
+ EObject targetElement = edge.getTarget().getElement();
+ EObject sourceElement = edge.getSource().getElement();
+
+ // test source and target
+ if (sourceElement instanceof Element && targetElement instanceof Element) {
+ // test source compatibility
+ if (checkStereotypePropertyReferenceEdgeSourceCompatibility((Element) sourceElement, stereotypeQNAnnotation)) {
+ // test set target
+ if (featureToSet.equals(featureToSetAnnotation) && stereotypeToSet.equals(stereotypeQNAnnotation)) {
+ notOrphan = checkStereotypePropertyReferenceEdgeTargetSet((Element) sourceElement, (Element) targetElement, stereotypeQNAnnotation, featureToSetAnnotation, newFeatureValue);
+ } else {
+ notOrphan = checkStereotypePropertyReferenceEdgeTargetSet((Element) sourceElement, (Element) targetElement, stereotypeQNAnnotation, featureToSetAnnotation);
+ }
+ }
+ }
+ }
+ }
+ }
+ return notOrphan;
+ }
+
+ /**
+ * Check if stereotype property reference edge is not orphan.
+ *
+ * @param edge
+ * the edge to test
+ * @return true, if successful
+ */
+ public static boolean checkNotOrphanStereotypePropertyReferenceEdge(final Edge edge) {
+ boolean notOrphan = false;
+ if (null != edge) {
+ EAnnotation eAnnotation = ((View) edge).getEAnnotation(STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT);
+ if (null != eAnnotation) {
+ String stereotypeQNAnnotation = eAnnotation.getDetails().get(STEREOTYPE_QUALIFIED_NAME_ANNOTATION_KEY);
+ String featureToSetAnnotation = eAnnotation.getDetails().get(FEATURE_TO_SET_ANNOTATION_KEY);
+ // Test annotation
+ if (null != stereotypeQNAnnotation && null != featureToSetAnnotation) {
+
+ EObject targetElement = edge.getTarget().getElement();
+ EObject sourceElement = edge.getSource().getElement();
+
+ // test source and target
+ if (sourceElement instanceof Element && targetElement instanceof Element) {
+ // test source compability
+ if (checkStereotypePropertyReferenceEdgeSourceCompatibility((Element) sourceElement, stereotypeQNAnnotation)) {
+ // test set target
+ notOrphan = checkStereotypePropertyReferenceEdgeTargetSet((Element) sourceElement, (Element) targetElement, stereotypeQNAnnotation, featureToSetAnnotation);
+ }
+ }
+ }
+ }
+ }
+ return notOrphan;
+ }
+
+ /**
+ * Check stereotype property reference edge target set.
+ *
+ * @param sourceElement
+ * the source element
+ * @param targetElement
+ * the target element
+ * @param stereotypeQualifiedName
+ * the stereotype qualify name
+ * @param featureToSet
+ * the feature to set
+ * @param newFeatureValue
+ * the new feature value
+ * @return true, if successful
+ */
+ public static boolean checkStereotypePropertyReferenceEdgeTargetSet(final Element sourceElement, final Element targetElement, final String stereotypeQualifiedName, final String featureToSet, final Object newFeatureValue) {
+
+ boolean targetOk = false;
+ if (null != sourceElement && null != targetElement) {
+ Stereotype sourceStereotype = sourceElement.getApplicableStereotype(stereotypeQualifiedName);
+ Property attribute = sourceStereotype.getAttribute(featureToSet, null);
+ if (null != attribute && null != newFeatureValue) {
+ Type targetType = attribute.getType();
+ EObject targetValue = null;
+
+ if (targetType instanceof Stereotype) {
+ // feature as stereotype reference
+ if (ElementUtil.hasStereotypeApplied(targetElement, targetType.getQualifiedName())) {
+ // The edge target stereotype application must be equals to the source feature value stereotype application
+ EObject targetStereotypeApplication = targetElement.getStereotypeApplication(UMLUtil.getAppliedSubstereotype(targetElement, (Stereotype) targetType));
+ targetValue = targetStereotypeApplication;
+ }
+ } else {
+ targetValue = targetElement;
+ }
+
+ if (newFeatureValue instanceof List) {
+ targetOk = ((List<?>) newFeatureValue).contains(targetValue);
+ } else {
+ targetOk = newFeatureValue.equals(targetValue);
+ }
+ }
+ }
+ return targetOk;
+ }
+
+ /**
+ * Check if the target element is set in the stereotype's feature of the source element.
+ *
+ * @param sourceElement
+ * the source element
+ * @param targetElement
+ * the target element
+ * @param stereotypeQualifiedName
+ * the stereotype qualify name
+ * @param featureToSet
+ * the feature to set
+ * @return true, if successful
+ */
+ public static boolean checkStereotypePropertyReferenceEdgeTargetSet(final Element sourceElement, final Element targetElement, final String stereotypeQualifiedName, final String featureToSet) {
+ boolean targetOk = false;
+ if (null != sourceElement && null != targetElement) {
+ Stereotype sourceStereotype = sourceElement.getApplicableStereotype(stereotypeQualifiedName);
+ Stereotype appliedSubstereotype = UMLUtil.getAppliedSubstereotype(sourceElement, sourceStereotype);
+ Object sourceFeatureValue = sourceElement.getValue(appliedSubstereotype, featureToSet);
+ Property attribute = sourceStereotype.getAttribute(featureToSet, null);
+ if (null != attribute && null != sourceFeatureValue) {
+ Type targetType = attribute.getType();
+ EObject targetValue = null;
+
+ if (targetType instanceof Stereotype) {
+ // feature as stereotype reference
+ if (ElementUtil.hasStereotypeApplied(targetElement, targetType.getQualifiedName())) {
+ // The edge target stereotype application must be equals to the source feature value stereotype application
+ EObject targetStereotypeApplication = targetElement.getStereotypeApplication(UMLUtil.getAppliedSubstereotype(targetElement, (Stereotype) targetType));
+ targetValue = targetStereotypeApplication;
+ }
+ } else {
+ targetValue = targetElement;
+ }
+
+ if (sourceFeatureValue instanceof List) {
+ targetOk = ((List<?>) sourceFeatureValue).contains(targetValue);
+ } else {
+ targetOk = sourceFeatureValue.equals(targetValue);
+ }
+ }
+ }
+ return targetOk;
+ }
+
+ /**
+ * Check stereotype property reference edge target compatibility.
+ *
+ * @param sourceElement
+ * the source element
+ * @param targetElement
+ * the target element
+ * @param stereotypeQualifiedName
+ * the stereotype qualify name
+ * @param featureToSet
+ * the feature to set
+ * @return true, if successful
+ */
+ public static boolean checkStereotypePropertyReferenceEdgeTargetCompatibility(final Element sourceElement, final Element targetElement, final String stereotypeQualifiedName, final String featureToSet) {
+ boolean compatible = false;
+ if (null != sourceElement && null != targetElement) {
+ // test if the target have the good stereotype
+ Stereotype sourceStereotype = sourceElement.getApplicableStereotype(stereotypeQualifiedName);
+ Type type = sourceStereotype.getAttribute(featureToSet, null).getType();
+ if (type instanceof Stereotype) {
+ compatible = ElementUtil.hasStereotypeApplied(targetElement, type.getQualifiedName());
+ } else {
+ Stereotype appliedSubstereotype = UMLUtil.getAppliedSubstereotype(sourceElement, sourceStereotype);
+ if (null != appliedSubstereotype) {
+ EObject stereotypeApplication = (sourceElement.getStereotypeApplication(appliedSubstereotype));
+ if (null != stereotypeApplication) {
+ EStructuralFeature eStructuralFeature = stereotypeApplication.eClass().getEStructuralFeature(UML2Util.getValidJavaIdentifier(featureToSet));
+ if (null != eStructuralFeature) {
+ EClassifier metaclass = eStructuralFeature.getEType();
+ if (metaclass instanceof EClassifier) {
+ compatible = ((EClassifier) metaclass).isInstance(targetElement);
+ }
+ }
+ }
+ }
+ }
+ }
+ return compatible;
+ }
+
+ /**
+ * Check stereotype property reference edge source compatibility.
+ *
+ * @param sourceElement
+ * the source element
+ * @param stereotypeQualifiedName
+ * the stereotype qualify name
+ * @return true, if successful
+ */
+ public static boolean checkStereotypePropertyReferenceEdgeSourceCompatibility(final Element sourceElement, final String stereotypeQualifiedName) {
+ boolean compatible = false;
+ if (null != sourceElement) {
+ compatible = ElementUtil.hasStereotypeApplied(sourceElement, stereotypeQualifiedName);
+ }
+ return compatible;
+ }
+
+
+ /**
+ * Find view from stereotype.
+ *
+ * @param stereotype
+ * the stereotype
+ * @return the find view
+ */
+ public static View findViewFromStereotype(final EObject stereotype) {
+ View view = null;
+ if (stereotype != null) {
+ Element baseElement = org.eclipse.uml2.uml.util.UMLUtil.getBaseElement(stereotype);
+ view = FindViewFromElement(baseElement);
+ }
+ return view;
+ }
+
+ /**
+ * Find view from element.
+ *
+ * @param element
+ * the element
+ * @return the find view
+ */
+ public static View FindViewFromElement(final Element element) {
+ View view = null;
+ if (null != element) {
+ Collection<Setting> settings = CacheAdapter.getInstance().getNonNavigableInverseReferences(element);
+
+ for (Setting ref : settings) {
+ if (NotationPackage.eINSTANCE.getView_Element().equals(ref.getEStructuralFeature())) {
+ view = (View) ref.getEObject();
+ }
+ }
+ }
+ return view;
+ }
+
+ /**
+ * Get the clean stereotype property reference edge command.
+ *
+ * @param request
+ * the request
+ * @param stereotypeToSet
+ * the stereotype to set
+ * @param featureToSet
+ * the feature to set
+ * @return the clean stereotype property reference edge command
+ */
+ public static ICommand getCleanStereotypePropertyReferenceEdgeCommand(final CreateRelationshipRequest request, final String stereotypeToSet, final String featureToSet) {
+ // Delete reference Edge in case of set of feature. Element to edit is the source of reference edge.
+ EObject source = request.getSource();
+ TransactionalEditingDomain editingDomain = request.getEditingDomain();
+ final Object target = request.getTarget();
+ return getCleanStereotypePropertyReferenceCommand(source, target, stereotypeToSet, featureToSet, editingDomain, null);
+
+ }
+
+ /**
+ * Get the clean stereotype property reference command.
+ *
+ * @param source
+ * the source
+ * @param newTargetValue
+ * the new target value
+ * @param stereotypeToSet
+ * the stereotype to set
+ * @param featureToSet
+ * the feature to set
+ * @param editingDomain
+ * the editing domain
+ * @return the clean stereotype property reference command
+ */
+ public static ICommand getCleanStereotypePropertyReferenceCommand(final EObject source, final Object newTargetValue, final String stereotypeToSet, final String featureToSet, TransactionalEditingDomain editingDomain, final Edge movedEdge) {
+ if (source instanceof Element) {
+ View view = StereotypePropertyReferenceEdgeUtil.FindViewFromElement((Element) source);
+
+ if (view != null) {
+ Stereotype applicableStereotypeToSet = ((Element) source).getApplicableStereotype(stereotypeToSet);
+ Stereotype actualStereotype = UMLUtil.getAppliedSubstereotype((Element) source, applicableStereotypeToSet);
+
+ if (null != actualStereotype) {
+ // Get the value which will be set
+ Property attribute = applicableStereotypeToSet.getAttribute(featureToSet, null);
+ if (null != attribute) {
+ Type targetType = attribute.getType();
+ Object value = null;
+ if (targetType instanceof Stereotype && newTargetValue instanceof Element) {
+ value = ((Element) newTargetValue).getStereotypeApplication(UMLUtil.getAppliedSubstereotype((Element) newTargetValue, actualStereotype));
+ } else {
+ value = newTargetValue;
+ }
+
+ String stereotypeQualifiedName = actualStereotype.getQualifiedName();
+ if (null != stereotypeQualifiedName && null != featureToSet) {
+
+ CompositeCommand command = new CompositeCommand("Clear stereotype property reference edges");//$NON-NLS-1$
+
+ for (Object edge : ViewUtil.getSourceConnections(view)) {
+ if (edge instanceof Edge && STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT.equals(((View) edge).getType())) {
+ if (null == movedEdge || (null != movedEdge && !edge.equals(movedEdge))) {
+ if (!StereotypePropertyReferenceEdgeUtil.checkNotOrphanStereotypePropertyReferenceEdgeNotYetSet((Edge) edge, stereotypeQualifiedName, featureToSet, value)) {
+ command.add(new DeleteCommand(editingDomain, (Edge) edge));
+ }
+ }
+ }
+ }
+
+ return command.isEmpty() ? null : command;
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Gets the clean stereotype property reference edge command.
+ *
+ * @param request
+ * the {@link ReorientReferenceRelationshipRequest} request
+ * @return the clean stereotype property reference edge command
+ */
+ public static ICommand getCleanStereotypePropertyReferenceEdgeCommand(ReorientReferenceRelationshipRequest request) {
+ int reorientDirection = request.getDirection();
+ EObject newEnd = request.getNewRelationshipEnd();
+ Object value = request.getParameters().get(DefaultSemanticEditPolicy.GRAPHICAL_RECONNECTED_EDGE);
+ Edge view = value instanceof Edge ? (Edge) value : null;
+ TransactionalEditingDomain editingDomain = request.getEditingDomain();
+
+ if (null != view) {
+ EAnnotation eAnnotation = view.getEAnnotation(STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT);
+ String featureToSet = eAnnotation.getDetails().get(FEATURE_TO_SET_ANNOTATION_KEY);
+ String stereotypeToSet = eAnnotation.getDetails().get(STEREOTYPE_QUALIFIED_NAME_ANNOTATION_KEY);
+ EObject target = null;
+ if (reorientDirection == ReorientRequest.REORIENT_TARGET) {
+ target = newEnd;
+
+ CompositeCommand command = new CompositeCommand("Clear stereotype property reference edges");//$NON-NLS-1$
+
+ for (Object edge : ViewUtil.getSourceConnections(view.getSource())) {
+ if (edge instanceof Edge && STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT.equals(((View) edge).getType()) && !edge.equals(view)) {
+ if (!StereotypePropertyReferenceEdgeUtil.checkNotOrphanStereotypePropertyReferenceEdgeNotYetSet((Edge) edge, stereotypeToSet, featureToSet, target)) {
+ command.add(new DeleteCommand(editingDomain, (Edge) edge));
+ }
+ }
+ }
+ return command.isEmpty() ? null : command;
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/META-INF/MANIFEST.MF b/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/META-INF/MANIFEST.MF
index bb60e801af8..89124b7d6a9 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/META-INF/MANIFEST.MF
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/META-INF/MANIFEST.MF
@@ -7,7 +7,7 @@ Require-Bundle: org.eclipse.papyrus.views.properties;bundle-version="[3.0.0,4.0.
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
-Bundle-Version: 3.0.0.qualifier
+Bundle-Version: 3.1.0.qualifier
Bundle-Name: %pluginName
Bundle-Localization: plugin
Bundle-ManifestVersion: 2
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/plugin.xml b/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/plugin.xml
index c0c013357ea..30d8f0af743 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/plugin.xml
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/plugin.xml
@@ -8,6 +8,10 @@
contextModel="properties/ApplyStereotypeAdvice.ctx"
isCustomizable="true">
</context>
+ <context
+ contextModel="properties/StereotypePropertyReferenceEdgeAdvice.ctx"
+ isCustomizable="true">
+ </context>
</extension>
<extension
point="org.eclipse.papyrus.infra.properties.environments">
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/pom.xml b/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/pom.xml
index aa2f485f120..6f22af23f0b 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/pom.xml
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/pom.xml
@@ -8,6 +8,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.uml.types.ui.properties</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/properties/StereotypePropertyReferenceEdgeAdvice.ctx b/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/properties/StereotypePropertyReferenceEdgeAdvice.ctx
new file mode 100644
index 00000000000..4f37581676d
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/properties/StereotypePropertyReferenceEdgeAdvice.ctx
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="ASCII"?>
+<contexts:Context xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:constraints="http://www.eclipse.org/papyrus/constraints/0.9" xmlns:contexts="http://www.eclipse.org/papyrus/properties/contexts/0.9" xmi:id="_ZS-p8DrfEeem-4zdbvHfsg" name="stereotypepropertyreferenceedgeadvice">
+ <tabs xmi:id="_ask6IDrfEeem-4zdbvHfsg" label="stereotypepropertyreferenceedgeadvice" id="stereotypepropertyreferenceedgeadvice" priority="100">
+ <sections xmi:id="_ask6ITrfEeem-4zdbvHfsg" name="Single StereotypePropertyReferenceEdgeAdviceConfiguration" sectionFile="ui/SingleStereotypePropertyReferenceEdgeAdviceConfiguration.xwt">
+ <widget href="ui/SingleStereotypePropertyReferenceEdgeAdviceConfiguration.xwt#/"/>
+ </sections>
+ <sections xmi:id="_aslhMDrfEeem-4zdbvHfsg" name="Single StereotypeToSet" sectionFile="ui/SingleStereotypeToSet.xwt">
+ <widget href="ui/SingleStereotypeToSet.xwt#/"/>
+ </sections>
+ <sections xmi:id="_aslhMTrfEeem-4zdbvHfsg" name="Multiple StereotypePropertyReferenceEdgeAdviceConfiguration" sectionFile="ui/MultipleStereotypePropertyReferenceEdgeAdviceConfiguration.xwt">
+ <widget href="ui/MultipleStereotypePropertyReferenceEdgeAdviceConfiguration.xwt#/"/>
+ </sections>
+ <sections xmi:id="_aslhMjrfEeem-4zdbvHfsg" name="Multiple StereotypeToSet" sectionFile="ui/MultipleStereotypeToSet.xwt">
+ <widget href="ui/MultipleStereotypeToSet.xwt#/"/>
+ </sections>
+ </tabs>
+ <views xmi:id="_ZS-p8TrfEeem-4zdbvHfsg" name="Single StereotypePropertyReferenceEdgeAdviceConfiguration" sections="_ask6ITrfEeem-4zdbvHfsg" automaticContext="true" datacontexts="_ZS-qAjrfEeem-4zdbvHfsg">
+ <constraints xsi:type="constraints:SimpleConstraint" xmi:id="_ZS-p8jrfEeem-4zdbvHfsg" name="isSingleStereotypePropertyReferenceEdgeAdviceConfiguration">
+ <constraintType href="ppe:/environment/org.eclipse.papyrus.infra.properties.ui/model/Environment.xmi#//@constraintTypes.0"/>
+ <properties xsi:type="constraints:ValueProperty" xmi:id="_ZS-p8zrfEeem-4zdbvHfsg" name="nsUri" value="http://www.eclipse.org/papyrus/uml/types/stereotypepropertyreferenceedgeadvice/1.0"/>
+ <properties xsi:type="constraints:ValueProperty" xmi:id="_ZS-p9DrfEeem-4zdbvHfsg" name="className" value="StereotypePropertyReferenceEdgeAdviceConfiguration"/>
+ </constraints>
+ </views>
+ <dataContexts xmi:id="_ZS-qATrfEeem-4zdbvHfsg" name="stereotypepropertyreferenceedgeadvice" label="stereotypepropertyreferenceedgeadvice">
+ <elements xmi:id="_ZS-qAjrfEeem-4zdbvHfsg" name="StereotypePropertyReferenceEdgeAdviceConfiguration">
+ <properties xmi:id="_ZS-qBTrfEeem-4zdbvHfsg" name="featureToSet" description="The feature name to set."/>
+ <properties xmi:id="_ZS-qBjrfEeem-4zdbvHfsg" name="stereotypeQualifiedName" description="The stereotype qualified name of the stereotype property to set."/>
+ <properties xmi:id="_aKqYwDy0EeeAp4N8yiBfUA" name="edgeLabel" description="The label of the stereotype property edge."/>
+ </elements>
+ <modelElementFactory href="ppe:/environment/org.eclipse.papyrus.infra.properties.ui/model/Environment.xmi#//@modelElementFactories.0"/>
+ </dataContexts>
+</contexts:Context>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/properties/ui/SingleStereotypePropertyReferenceEdgeAdviceConfiguration.xwt b/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/properties/ui/SingleStereotypePropertyReferenceEdgeAdviceConfiguration.xwt
new file mode 100644
index 00000000000..f77bc57a3f3
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/properties/ui/SingleStereotypePropertyReferenceEdgeAdviceConfiguration.xwt
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Composite xmlns="http://www.eclipse.org/xwt/presentation"
+ xmlns:emfwid="clr-namespace:org.eclipse.papyrus.infra.emf.types.ui.properties.widgets"
+ xmlns:j="clr-namespace:java.lang" xmlns:ppe="clr-namespace:org.eclipse.papyrus.infra.properties.ui.widgets"
+ xmlns:ppel="clr-namespace:org.eclipse.papyrus.infra.properties.ui.widgets.layout"
+ xmlns:uml="clr-namespace:org.eclipse.papyrus.uml.properties.widgets"
+ xmlns:wid="clr-namespace:org.eclipse.papyrus.uml.types.ui.properties.widgets"
+ xmlns:x="http://www.eclipse.org/xwt">
+ <Composite.layout>
+ <ppel:PropertiesLayout></ppel:PropertiesLayout>
+ </Composite.layout>
+ <uml:StereotypeQualifyNamePropertyEditor
+ input="{Binding}"
+ property="stereotypepropertyreferenceedgeadvice:StereotypePropertyReferenceEdgeAdviceConfiguration:stereotypeQualifiedName"></uml:StereotypeQualifyNamePropertyEditor>
+ <wid:FeatureToSetNamePropertyEditor
+ input="{Binding}"
+ property="stereotypepropertyreferenceedgeadvice:StereotypePropertyReferenceEdgeAdviceConfiguration:featureToSet"></wid:FeatureToSetNamePropertyEditor>
+ <ppe:StringEditor input="{Binding}"
+ property="stereotypepropertyreferenceedgeadvice:StereotypePropertyReferenceEdgeAdviceConfiguration:edgeLabel"></ppe:StringEditor>
+</Composite> \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/src/org/eclipse/papyrus/uml/types/ui/properties/widgets/FeatureToSetNamePropertyEditor.java b/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/src/org/eclipse/papyrus/uml/types/ui/properties/widgets/FeatureToSetNamePropertyEditor.java
index 5bff8f7789c..5d0a9630060 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/src/org/eclipse/papyrus/uml/types/ui/properties/widgets/FeatureToSetNamePropertyEditor.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/src/org/eclipse/papyrus/uml/types/ui/properties/widgets/FeatureToSetNamePropertyEditor.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2016 CEA LIST.
+ * Copyright (c) 2017 CEA LIST.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,7 @@
*
* Contributors:
* Mickael ADAM (ALL4TEC) mickael.adam@all4tec.net - Initial API and Implementation
+ * Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Bug 517679
*****************************************************************************/
package org.eclipse.papyrus.uml.types.ui.properties.widgets;
@@ -17,7 +18,6 @@ import java.util.Iterator;
import java.util.List;
import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
@@ -33,6 +33,7 @@ import org.eclipse.papyrus.uml.extensionpoints.profile.RegisteredProfile;
import org.eclipse.papyrus.uml.profile.index.ProfileWorkspaceModelIndex;
import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
import org.eclipse.papyrus.uml.types.core.advices.applystereotype.StereotypeToApply;
+import org.eclipse.papyrus.uml.types.core.advices.stereotypepropertyreferenceedgeadvice.StereotypePropertyReferenceEdgeAdviceConfiguration;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.uml2.uml.Profile;
import org.eclipse.uml2.uml.Stereotype;
@@ -45,12 +46,8 @@ public class FeatureToSetNamePropertyEditor extends AbstractPropertyEditor {
/** The stereotype qualify name value editor. */
private FeatureToSetNameValueEditor editor;
+ /** The editing domain. */
private AdapterFactoryEditingDomain domain;
- // TODO dsipose loaded resources
- /**
- * The key for source uml element put into the map options of the reslurce set.
- */
- private static final String SOURCE_ECLASS = "sourceEClass";//$NON-NLS-1$
/**
* Constructor.
@@ -70,57 +67,61 @@ public class FeatureToSetNamePropertyEditor extends AbstractPropertyEditor {
*/
protected void setObjectToApply() {
if (null != domain) {
- // Get the semantic uml object selected
- Object eClassSourceElement = domain.getResourceSet().getLoadOptions().get(SOURCE_ECLASS);
- if (eClassSourceElement instanceof EClass) {
- // Get the stereotype qualify name
- // get the selection
- Object firstElement = input.getSelection().getFirstElement();
- if (firstElement instanceof EObject) {
- EObject eContainer = ((EObject) firstElement).eContainer();
- if (eContainer instanceof StereotypeToApply) {
+ // get the selection
+ Object firstElement = input.getSelection().getFirstElement();
+ if (firstElement instanceof EObject) {
- List<Profile> profiles = new ArrayList<Profile>();
- // Gets profiles from workspace
- profiles.addAll(getWorkspaceProfiles());
+ List<Profile> profiles = new ArrayList<Profile>();
+ // Gets profiles from workspace
+ profiles.addAll(getWorkspaceProfiles());
- // Gets profiles from plugins
- List<IRegisteredProfile> registeredProfiles = RegisteredProfile.getRegisteredProfiles();
+ // Gets profiles from plugins
+ List<IRegisteredProfile> registeredProfiles = RegisteredProfile.getRegisteredProfiles();
- for (IRegisteredProfile iRegisteredProfile : registeredProfiles) {
- Profile profile = getProfile(iRegisteredProfile);
- if (null != profile) {
- profiles.add(profile);
- }
- }
+ for (IRegisteredProfile iRegisteredProfile : registeredProfiles) {
+ Profile profile = getProfile(iRegisteredProfile);
+ if (null != profile) {
+ profiles.add(profile);
+ }
+ }
- // Gets all stereotypes
- List<Stereotype> allStereotypes = new ArrayList<Stereotype>();
- for (Profile profile : profiles) {
- allStereotypes.addAll(StereotypeUtil.getAllStereotypes(profile));
- }
+ // Gets all stereotypes
+ List<Stereotype> allStereotypes = new ArrayList<Stereotype>();
+ for (Profile profile : profiles) {
+ allStereotypes.addAll(StereotypeUtil.getAllStereotypes(profile));
+ }
- // Set the editor with find stereotypes
- boolean editorSet = false;
- Iterator<Stereotype> stereotypes = allStereotypes.iterator();
- while (!editorSet && stereotypes.hasNext()) {
- Stereotype stereotype = (Stereotype) stereotypes.next();
- if (((StereotypeToApply) eContainer).getStereotypeQualifiedName().equals(stereotype.getQualifiedName())) {
- // Set the source stereotype to the editor.
- editor.setSourceStereotype(stereotype);
- editorSet = true;
- }
- }
- // unload resources
- profiles.forEach(profile -> {
- Resource eResource = profile.eResource();
- if (eResource.isLoaded()) {
- eResource.unload();
- }
- });
+ // Set the editor with find stereotypes
+ boolean editorSet = false;
+ Iterator<Stereotype> stereotypes = allStereotypes.iterator();
+ while (!editorSet && stereotypes.hasNext()) {
+ Stereotype stereotype = (Stereotype) stereotypes.next();
+
+ // get the stereotype qualify name
+ EObject eContainer = ((EObject) firstElement).eContainer();
+ String stereotypeQualifiedName = null;
+ if (eContainer instanceof StereotypeToApply) {
+ stereotypeQualifiedName = ((StereotypeToApply) eContainer).getStereotypeQualifiedName();
+ } else if (firstElement instanceof StereotypePropertyReferenceEdgeAdviceConfiguration) {
+ stereotypeQualifiedName = ((StereotypePropertyReferenceEdgeAdviceConfiguration) firstElement).getStereotypeQualifiedName();
}
+
+ // Set the editor
+ if (null != stereotypeQualifiedName && stereotypeQualifiedName.equals(stereotype.getQualifiedName())) {
+ // Set the source stereotype to the editor.
+ editor.setSourceStereotype(stereotype);
+ editorSet = true;
+ }
+
+ // unload resources
+ profiles.forEach(profile -> {
+ Resource eResource = profile.eResource();
+ if (null != eResource && eResource.isLoaded()) {
+ eResource.unload();
+ }
+ });
}
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/src/org/eclipse/papyrus/uml/types/ui/properties/widgets/FeatureToSetNameValueEditor.java b/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/src/org/eclipse/papyrus/uml/types/ui/properties/widgets/FeatureToSetNameValueEditor.java
index b241e3993b5..bcae42ab925 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/src/org/eclipse/papyrus/uml/types/ui/properties/widgets/FeatureToSetNameValueEditor.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.types.ui.properties/src/org/eclipse/papyrus/uml/types/ui/properties/widgets/FeatureToSetNameValueEditor.java
@@ -39,6 +39,7 @@ import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.uml2.uml.Extension;
import org.eclipse.uml2.uml.Property;
import org.eclipse.uml2.uml.Stereotype;
@@ -66,7 +67,9 @@ public class FeatureToSetNameValueEditor extends StringEditor {
Stereotype stereotype = (Stereotype) inputElement;
EList<Property> ownedAttributes = stereotype.getAllAttributes();
for (Property property : ownedAttributes) {
- attributes.add(property);
+ if (!property.getName().startsWith(Extension.METACLASS_ROLE_PREFIX)) {
+ attributes.add(property);
+ }
}
}
return attributes.toArray();
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/.classpath b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/.classpath
index 2d1a4302f04..eca7bdba8f0 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/.classpath
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/.classpath
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/.settings/org.eclipse.jdt.core.prefs b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/.settings/org.eclipse.jdt.core.prefs
index 4759947300a..62a08f4494d 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/META-INF/MANIFEST.MF b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/META-INF/MANIFEST.MF
index fb6ab78f631..ada46101c4a 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/META-INF/MANIFEST.MF
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/META-INF/MANIFEST.MF
@@ -7,7 +7,7 @@ Require-Bundle: org.eclipse.uml2.uml;bundle-version="[5.3.0,6.0.0)";visibility:=
org.eclipse.papyrus.uml.internationalization.utils;bundle-version="[1.0.0,2.0.0)"
Bundle-Vendor: %pluginProvider
Bundle-ActivationPolicy: lazy
-Bundle-Version: 3.0.0.qualifier
+Bundle-Version: 3.1.0.qualifier
Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-Activator: org.eclipse.papyrus.uml.tools.utils.Activator
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/pom.xml b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/pom.xml
index 85ef927d738..c7e58cbfb71 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/pom.xml
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/pom.xml
@@ -8,7 +8,7 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.uml.tools.utils</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<description>This plugin contributes a set of common utils tools for UML</description>
</project> \ No newline at end of file
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/ElementUtil.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/ElementUtil.java
index 78909643a6c..d7806d6f621 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/ElementUtil.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/ElementUtil.java
@@ -18,6 +18,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+import java.util.stream.Collectors;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
@@ -130,7 +131,7 @@ public class ElementUtil {
* of image ("icon" | "shape")
* @return {@link Image} or null
*/
- public static Image getStereotypeImage(Element element, String kind) {
+ public static Image getStereotypeImage(Element element, String kind) {
EList<Stereotype> appliedStereotypes = element.getAppliedStereotypes();
if (appliedStereotypes == null || appliedStereotypes.isEmpty()) {
return null;
@@ -404,7 +405,7 @@ public class ElementUtil {
}
}
- } else {
+ } else {
if (metaType.isInstance(currentElt)) {
filteredElements.add((T) currentElt);
}
@@ -426,4 +427,28 @@ public class ElementUtil {
return filteredElements;
}
+ /**
+ * Check if the element have the stereotype or a substereotype applied.
+ *
+ * @param element
+ * the element
+ * @param stereotype
+ * the stereotype qualified name
+ * @return true, if successful
+ * @since 3.1
+ */
+ public static boolean hasStereotypeApplied(final Element element, final String stereotype) {
+ List<String> sourceAppliedStereotypes = element.getAppliedStereotypes().stream()
+ .map(st -> st.getQualifiedName())
+ .collect(Collectors.toList());
+
+ sourceAppliedStereotypes.addAll(element.getAppliedStereotypes().stream()
+ .flatMap(st -> st.allParents().stream())
+ .filter(Stereotype.class::isInstance).map(Stereotype.class::cast)
+ .map(st -> st.getQualifiedName())
+ .collect(Collectors.toList()));
+
+ return sourceAppliedStereotypes.contains(stereotype);
+ }
+
}

Back to the top