Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael ADAM2017-07-07 08:13:21 +0000
committervincent lorenzo2017-07-07 15:14:57 +0000
commitf3c01cb2bf999441dc469eb7b56e3180600fd437 (patch)
tree805dca17ca1b0228be0f361423d3d24d7aea18c6 /plugins/uml/org.eclipse.papyrus.uml.types.core
parent3f55a9928cffedc6d85e80c6e67cb6f3aaf9c956 (diff)
downloadorg.eclipse.papyrus-f3c01cb2bf999441dc469eb7b56e3180600fd437.tar.gz
org.eclipse.papyrus-f3c01cb2bf999441dc469eb7b56e3180600fd437.tar.xz
org.eclipse.papyrus-f3c01cb2bf999441dc469eb7b56e3180600fd437.zip
Bug 519359 - [Test] Regression for context and comment link
https://bugs.eclipse.org/bugs/show_bug.cgi?id=519359 - Be sure that the delete element is stereotype property reference edge before add our delete command Change-Id: I34c52bc0c23ffcff28414e73b23970e70cf5470f Signed-off-by: Mickael ADAM <mickael.adam@all4tec.net>
Diffstat (limited to 'plugins/uml/org.eclipse.papyrus.uml.types.core')
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.types.core/src/org/eclipse/papyrus/uml/types/core/commands/StereotypePropertyReferenceEdgeUtil.java23
1 files changed, 20 insertions, 3 deletions
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
index a72ed6ffcb6..72af3f2c904 100644
--- 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
@@ -239,7 +239,7 @@ public class StereotypePropertyReferenceEdgeUtil {
if (null != eStructuralFeature) {
EClassifier metaclass = eStructuralFeature.getEType();
if (metaclass instanceof EClassifier) {
- compatible = ((EClassifier) metaclass).isInstance(targetElement);
+ compatible = metaclass.isInstance(targetElement);
}
}
}
@@ -268,7 +268,7 @@ public class StereotypePropertyReferenceEdgeUtil {
/**
- * Find view from stereotype.
+ * Find the view from stereotype application.
*
* @param stereotype
* the stereotype
@@ -390,7 +390,7 @@ public class StereotypePropertyReferenceEdgeUtil {
* the {@link ReorientReferenceRelationshipRequest} request
* @return the clean stereotype property reference edge command
*/
- public static ICommand getCleanStereotypePropertyReferenceEdgeCommand(ReorientReferenceRelationshipRequest request) {
+ public static ICommand getCleanStereotypePropertyReferenceEdgeCommand(final ReorientReferenceRelationshipRequest request) {
int reorientDirection = request.getDirection();
EObject newEnd = request.getNewRelationshipEnd();
Object value = request.getParameters().get(DefaultSemanticEditPolicy.GRAPHICAL_RECONNECTED_EDGE);
@@ -420,4 +420,21 @@ public class StereotypePropertyReferenceEdgeUtil {
return null;
}
+ /**
+ * Checks if the object is an stereotype property reference edge.
+ *
+ * @param object
+ * the object to test
+ */
+ public static boolean isStereotypePropertyReferenceEdge(final Object object) {
+ View view = object instanceof View ? (View) object : null;
+ if (null != view) {
+ EAnnotation eAnnotation = view.getEAnnotation(STEREOTYPE_PROPERTY_REFERENCE_EDGE_HINT);
+ if (null != eAnnotation) {
+ return true;
+ }
+ }
+ return false;
+ }
+
}

Back to the top