Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-04-12 08:35:13 +0000
committerHenrik Rentz-Reichert2012-04-12 08:35:13 +0000
commitdf2199458ba8c3791cc0e9a9dc04a09c6591384a (patch)
tree0c4f3d042e0c0a2e01bebebda605597987e4a197 /plugins/org.eclipse.etrice.core.room/src
parentd5df7c9533d313c9c9d3b16c8f4e2657eb57860c (diff)
downloadorg.eclipse.etrice-df2199458ba8c3791cc0e9a9dc04a09c6591384a.tar.gz
org.eclipse.etrice-df2199458ba8c3791cc0e9a9dc04a09c6591384a.tar.xz
org.eclipse.etrice-df2199458ba8c3791cc0e9a9dc04a09c6591384a.zip
[core.room, ui.structure] improved message in port dialog info decorators
Diffstat (limited to 'plugins/org.eclipse.etrice.core.room/src')
-rw-r--r--plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidationUtil.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidationUtil.java b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidationUtil.java
index 9f9a83391..2267f336b 100644
--- a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidationUtil.java
+++ b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidationUtil.java
@@ -359,16 +359,25 @@ public class ValidationUtil {
return Result.ok();
}
- public static boolean isReferencedInModel(Port port) {
+ public static Result isFreeOfReferences(Port port) {
Collection<Setting> refs = EcoreUtil.UsageCrossReferencer.find(port, port.eResource().getResourceSet());
+ boolean bound = false;
+ boolean usedByFSM = false;
for (Setting ref : refs) {
if (ref.getEObject() instanceof BindingEndPoint)
- return true;
+ bound = true;
else if (ref.getEObject() instanceof MessageFromIf)
- return true;
+ usedByFSM = true;
}
- return false;
+ if (bound && usedByFSM)
+ return Result.error("port is bound and also used by state machine (triggers)");
+ else if (bound)
+ return Result.error("port is bound (may be externally)");
+ else if (usedByFSM)
+ return Result.error("port is used by state machine (triggers)");
+
+ return Result.ok();
}
public static boolean isReferencedAsReplicatedInModel(ActorClass ac) {

Back to the top