Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterSignatures.java')
-rw-r--r--extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterSignatures.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterSignatures.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterSignatures.java
new file mode 100644
index 00000000000..69e040f9676
--- /dev/null
+++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterSignatures.java
@@ -0,0 +1,50 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * 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:
+ * Ansgar Radermacher ansgar.radermacher@cea.fr
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.qompass.designer.core.transformations.filters;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener;
+import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier;
+import org.eclipse.uml2.uml.TemplateSignature;
+
+
+/**
+ * Remove signatures from package template (only remove signatures within the
+ * template, not others)
+ *
+ * @author ansgar
+ *
+ */
+public class FilterSignatures implements PreCopyListener {
+
+ public static FilterSignatures getInstance() {
+ if (instance == null) {
+ instance = new FilterSignatures();
+ }
+ return instance;
+ }
+
+ @Override
+ public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) {
+ if (sourceEObj instanceof TemplateSignature) {
+ if (copy.withinTemplate(sourceEObj)) {
+ return null;
+ }
+ }
+ return sourceEObj;
+ }
+
+ private static FilterSignatures instance = null;
+}

Back to the top