Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2013-10-08 11:46:27 +0000
committerAnsgar Radermacher2013-10-08 12:37:30 +0000
commitf7e41be90be8d3f0e0df90ef88951727577c325b (patch)
tree074fc34d56dd4c7b7201acc2b8c04e3518e7790f /extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java
parentdf7cf00774c89e9b994f55b0a6212351d7faff14 (diff)
downloadorg.eclipse.papyrus-f7e41be90be8d3f0e0df90ef88951727577c325b.tar.gz
org.eclipse.papyrus-f7e41be90be8d3f0e0df90ef88951727577c325b.tar.xz
org.eclipse.papyrus-f7e41be90be8d3f0e0df90ef88951727577c325b.zip
Update of examples and mapping rules (required for support of new operation needsUpdate)
Diffstat (limited to 'extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java')
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java
index 29ec42e8754..cd61c5d9070 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java
@@ -21,7 +21,6 @@ import org.eclipse.papyrus.FCM.util.MapUtil;
import org.eclipse.papyrus.qompass.designer.core.Log;
import org.eclipse.uml2.uml.DataType;
import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.InstanceSpecification;
import org.eclipse.uml2.uml.Interface;
import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.PrimitiveType;
@@ -36,14 +35,14 @@ import org.eclipse.uml2.uml.Type;
*/
public class PushProdPullCons implements IMappingRule {
- public Interface getProvided(Port p, InstanceSpecification config, boolean update) {
+ public Interface getProvided(Port p, boolean update) {
return null;
}
- public Interface getRequired(Port p, InstanceSpecification config, boolean update) {
+ public Interface getRequired(Port p, boolean update) {
org.eclipse.uml2.uml.Port umlPort = p.getBase_Port();
Element owner = umlPort.getOwner();
- String ownerStr = "";
+ String ownerStr = ""; //$NON-NLS-1$
if(owner instanceof NamedElement) {
ownerStr = " of class " + ((NamedElement)owner).getQualifiedName();
}
@@ -53,15 +52,15 @@ public class PushProdPullCons implements IMappingRule {
if((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) {
- Interface derivedInterface = MapUtil.getOrCreateDerivedInterface(p, "_", type, update);
+ Interface derivedInterface = MapUtil.getOrCreateDerivedInterface(p, "_", type, update); //$NON-NLS-1$
if (!update) {
return derivedInterface;
}
// obtain derived interface for other port kind (Caveat: some rules get the prefix from the
// name of the port kind attached to port "p" which would produce wrong results.
- Interface derivedInterfacePushProd = PushProducer.getInstance().getRequired(p, config, update);
- Interface derivedInterfacePullCons = PullConsumer.getInstance().getRequired(p, config, update);
+ Interface derivedInterfacePushProd = PushProducer.getInstance().getRequired(p, update);
+ Interface derivedInterfacePullCons = PullConsumer.getInstance().getRequired(p, update);
if(derivedInterface == null) {
return null;
}
@@ -72,11 +71,16 @@ public class PushProdPullCons implements IMappingRule {
if(!derivedInterface.getGenerals().contains(derivedInterfacePullCons)) {
derivedInterface.createGeneralization(derivedInterfacePullCons);
}
-
-
return derivedInterface;
- } else {
+ }
+ else {
return null;
}
}
+
+ public boolean needsUpdate(Port p) {
+ return
+ PushProducer.getInstance().needsUpdate(p) ||
+ PullConsumer.getInstance().needsUpdate(p);
+ }
}

Back to the top