aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2018-03-02 06:28:50 -0500
committerHenrik Rentz-Reichert2018-03-02 06:28:50 -0500
commiteca8349e5c8e9f9032bf48c20a76eae90f75d609 (patch)
tree07342b0ceeafab5a55af79ff700f1477b8c7811c
parentb4bec069411704ea9228d2d8860a3c7a1f60856d (diff)
downloadorg.eclipse.etrice-eca8349e5c8e9f9032bf48c20a76eae90f75d609.tar.gz
org.eclipse.etrice-eca8349e5c8e9f9032bf48c20a76eae90f75d609.tar.xz
org.eclipse.etrice-eca8349e5c8e9f9032bf48c20a76eae90f75d609.zip
Bug 531921 - [behavior] transitions can be created inside refined states
* fixed this problem for transitions * fixed a similar problem for states Change-Id: I483c688a8081ab72a73ed7ddc27216b7026a8a77
-rw-r--r--plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/StateSupport.java4
-rw-r--r--plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/TransitionSupport.java4
2 files changed, 6 insertions, 2 deletions
diff --git a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/StateSupport.java b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/StateSupport.java
index 36502564f..2ca43aadf 100644
--- a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/StateSupport.java
+++ b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/StateSupport.java
@@ -156,7 +156,9 @@ public class StateSupport {
ModelComponent ac = FSMSupportUtil.getInstance().getModelComponent(getDiagram());
StateGraph sg = (StateGraph) targetContainer.getLink().getBusinessObjects().get(0);
- boolean inherited = FSMSupportUtil.getInstance().isInherited(getDiagram(), sg);
+ // hrr: was boolean inherited = FSMSupportUtil.getInstance().isInherited(getDiagram(), sg);
+ // but if we are inside our own refined state it is treated as inherited which is wrong
+ boolean inherited = !EcoreUtil.isAncestor(FSMSupportUtil.getInstance().getModelComponent(getDiagram()), sg);
if (inherited) {
sg = FSMSupportUtil.getInstance().insertRefinedState(sg, ac, targetContainer, getFeatureProvider());
}
diff --git a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/TransitionSupport.java b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/TransitionSupport.java
index 5c5103a7e..6a7f9112d 100644
--- a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/TransitionSupport.java
+++ b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/TransitionSupport.java
@@ -267,7 +267,9 @@ public class TransitionSupport {
}
ContainerShape targetContainer = FSMSupportUtil.getInstance().getStateGraphContainer((ContainerShape) context.getSourcePictogramElement().eContainer());
- boolean inherited = FSMSupportUtil.getInstance().isInherited(getDiagram(), sg);
+ // hrr: was boolean inherited = FSMSupportUtil.getInstance().isInherited(getDiagram(), sg);
+ // but if we are inside our own refined state it is treated as inherited which is wrong
+ boolean inherited = !EcoreUtil.isAncestor(FSMSupportUtil.getInstance().getModelComponent(getDiagram()), sg);
if (inherited) {
sg = FSMSupportUtil.getInstance().insertRefinedState(sg, mc, targetContainer, getFeatureProvider());
}