diff options
author | Quentin Le Menez | 2018-12-07 13:33:11 +0000 |
---|---|---|
committer | Quentin Le Menez | 2019-01-09 14:57:28 +0000 |
commit | 6de3636db9feed1600fd5a2adbcf3219a53e0330 (patch) | |
tree | b79f52fe3c8b5e66bfad303f228fc5b3aadaac4f /plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common | |
parent | ecd0530cadc83abfcb78db2754ecf0058ef5217c (diff) | |
download | org.eclipse.papyrus-6de3636db9feed1600fd5a2adbcf3219a53e0330.tar.gz org.eclipse.papyrus-6de3636db9feed1600fd5a2adbcf3219a53e0330.tar.xz org.eclipse.papyrus-6de3636db9feed1600fd5a2adbcf3219a53e0330.zip |
Bug 542518 - [Diagram] Creation of a diagram inside an element and dropping associations inside
- Added a check on the editPart to verify that it is not a Diagram
Change-Id: I50f0f26fac164335368d5c3577f8c33b620b41f6
Signed-off-by: Quentin Le Menez <quentin.lemenez@cea.fr>
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common')
3 files changed, 8 insertions, 4 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 a9896bff8e1..69ea31b3d48 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 @@ -82,7 +82,7 @@ Bundle-Activator: org.eclipse.papyrus.infra.gmfdiag.common.Activator Bundle-Vendor: %providerName Bundle-ActivationPolicy: lazy Bundle-ClassPath: . -Bundle-Version: 3.101.0.qualifier +Bundle-Version: 3.101.100.qualifier Bundle-Localization: plugin Bundle-Name: %pluginName Bundle-ManifestVersion: 2 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 3a1e20307a3..6dd1ccb0a35 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 @@ -8,6 +8,6 @@ <version>0.0.1-SNAPSHOT</version> </parent> <artifactId>org.eclipse.papyrus.infra.gmfdiag.common</artifactId> - <version>3.101.0-SNAPSHOT</version> + <version>3.101.100-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> -</project>
\ No newline at end of file +</project> diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CommonDeferredCreateConnectionViewCommand.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CommonDeferredCreateConnectionViewCommand.java index c4e91e69d13..f5ee600a1b7 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CommonDeferredCreateConnectionViewCommand.java +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CommonDeferredCreateConnectionViewCommand.java @@ -37,6 +37,7 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart; import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest.ConnectionViewDescriptor; +import org.eclipse.gmf.runtime.notation.Diagram; import org.eclipse.gmf.runtime.notation.View; /** @@ -146,7 +147,10 @@ public class CommonDeferredCreateConnectionViewCommand extends DeferredCreateCon while (editPartIterator.hasNext()) { EditPart currentEditPart = (EditPart) editPartIterator.next(); if ((!(currentEditPart instanceof CompartmentEditPart)) && currentEditPart instanceof IGraphicalEditPart && semanticElement == (((IGraphicalEditPart) currentEditPart).resolveSemanticElement())) { - if (!(currentEditPart instanceof LabelEditPart)) { + // In the case of a diagram created inside an element and this element being dropped inside, there is a possibility (the order does not seem to be kept between creations) + // that the editPart matching the semantic element is the diagram itself as it is contained by the element. + // We cannot link a diagram Edit Part, it will return a null command, preventing the link creation. + if (!(currentEditPart instanceof LabelEditPart || currentEditPart.getModel() instanceof Diagram)) { return (IGraphicalEditPart) currentEditPart; } } |