Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Le Fevre2017-08-03 13:56:38 +0000
committerPatrick Tessier2017-08-07 13:04:02 +0000
commitfa12ea847f64550e6a82c122fcf616219d3c431d (patch)
tree97c93b72d3cce1e8997b278835dfd968438e466b
parentf5944f84f784bdc34e2d025772f27c80c7fbf4df (diff)
downloadorg.eclipse.papyrus-fa12ea847f64550e6a82c122fcf616219d3c431d.tar.gz
org.eclipse.papyrus-fa12ea847f64550e6a82c122fcf616219d3c431d.tar.xz
org.eclipse.papyrus-fa12ea847f64550e6a82c122fcf616219d3c431d.zip
Bug 517698: Default editor for constraint is non-language
Actions -creation with opaqueexpression and ocl language Tests -runtime and check the creation by default Change-Id: I6fd6cf78c6cb3eaab2c244e80f817ba4e60cd712 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=517698 Signed-off-by: Francois Le Fevre <francois.le-fevre@cea.fr>
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConstraintEditHelper.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConstraintEditHelper.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConstraintEditHelper.java
index bb28bd9f488..525eabdb802 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConstraintEditHelper.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/helper/ConstraintEditHelper.java
@@ -31,6 +31,7 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
import org.eclipse.papyrus.uml.service.types.utils.InteractionConstraintUtil;
import org.eclipse.uml2.uml.Constraint;
import org.eclipse.uml2.uml.InteractionConstraint;
+import org.eclipse.uml2.uml.OpaqueExpression;
import org.eclipse.uml2.uml.UMLFactory;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.ValueSpecification;
@@ -47,6 +48,9 @@ import org.eclipse.uml2.uml.ValueSpecification;
* </pre>
*/
public class ConstraintEditHelper extends ElementEditHelper {
+
+ /** The Constant OCL_LANGAGE_BODY. */
+ public static final String OCL_LANGAGE_BODY = "OCL";
{
getDefaultContainmentFeatures().put(UMLPackage.eINSTANCE.getValueSpecification(), UMLPackage.eINSTANCE.getConstraint_Specification());
@@ -62,8 +66,7 @@ public class ConstraintEditHelper extends ElementEditHelper {
// Create constraint specification
ValueSpecification spec = createSpecification();
- spec.setName("constraintSpec"); //$NON-NLS-1$
-
+
element.setSpecification(spec);
return CommandResult.newOKCommandResult(element);
@@ -74,7 +77,11 @@ public class ConstraintEditHelper extends ElementEditHelper {
}
protected ValueSpecification createSpecification() {
- return UMLFactory.eINSTANCE.createLiteralString();
+ OpaqueExpression spec = UMLFactory.eINSTANCE.createOpaqueExpression();
+ spec.setName("constraintSpec"); //$NON-NLS-1$
+ spec.getLanguages().add(OCL_LANGAGE_BODY);
+ spec.getBodies().add("true");//$NON-NLS-1$
+ return spec;
}
/**

Back to the top