Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/properties/org.eclipse.papyrus.uml.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/ContextsBlackBox.java')
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/ContextsBlackBox.java43
1 files changed, 43 insertions, 0 deletions
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/ContextsBlackBox.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/ContextsBlackBox.java
new file mode 100644
index 00000000000..980900adc59
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/ContextsBlackBox.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2021 Christian W. Damus, CEA LIST, and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.customization.properties.generation.generators;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.m2m.qvt.oml.blackbox.java.Module;
+import org.eclipse.m2m.qvt.oml.blackbox.java.Operation;
+import org.eclipse.m2m.qvt.oml.blackbox.java.Operation.Kind;
+import org.eclipse.papyrus.infra.properties.contexts.Annotatable;
+import org.eclipse.papyrus.infra.properties.contexts.ContextsPackage;
+import org.eclipse.papyrus.infra.properties.contexts.util.ContextAnnotations;
+
+/**
+ * Black-box operations for context model transformations in QVTo.
+ */
+@Module(packageURIs = { ContextsPackage.eNS_URI })
+public class ContextsBlackBox {
+
+ public ContextsBlackBox() {
+ super();
+ }
+
+ @Operation(contextual = true, kind = Kind.HELPER)
+ public void setSourceModel(Annotatable self, Object sourceModel) {
+ if (sourceModel instanceof EObject) {
+ ContextAnnotations.setSourceModel(self, (EObject) sourceModel);
+ }
+ }
+
+}

Back to the top