Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/util/FSMSupportUtil.java')
-rw-r--r--plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/util/FSMSupportUtil.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/util/FSMSupportUtil.java b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/util/FSMSupportUtil.java
index 8ccf50015..d283a8b1a 100644
--- a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/util/FSMSupportUtil.java
+++ b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/util/FSMSupportUtil.java
@@ -106,7 +106,11 @@ public class FSMSupportUtil {
}
public boolean isInherited(Diagram diag, EObject obj) {
- if(obj instanceof StateGraph)
+ return isInherited(getModelComponent(diag), obj);
+ }
+
+ public boolean isInherited(ModelComponent mc, EObject obj) {
+ if (obj instanceof StateGraph)
obj = obj.eContainer();
else if (obj instanceof ModelComponent)
// the next line states: if a ModelComponent has no base class, then it is not inherited.
@@ -115,7 +119,15 @@ public class FSMSupportUtil {
// However, this method isn't called with an obj instanceof ModelComponent
return ((ModelComponent) obj).getBase() != null;
- return obj instanceof RefinedState || obj instanceof RefinedTransition || !EcoreUtil.isAncestor(getModelComponent(diag), obj);
+ return obj instanceof RefinedState || obj instanceof RefinedTransition || !EcoreUtil.isAncestor(mc, obj);
+ }
+
+ public boolean isOwnedBy(Diagram diag, EObject obj) {
+ return isOwnedBy(getModelComponent(diag), obj);
+ }
+
+ public boolean isOwnedBy(ModelComponent mc, EObject obj) {
+ return EcoreUtil.isAncestor(mc, obj);
}
public boolean showAsInherited(Diagram diag, State obj) {

Back to the top