Commit b2385f7f authored by Daniel Ratiu's avatar Daniel Ratiu
Browse files

fixing the issue for state automata - now state-automata can be safely deleted...

fixing the issue for state automata - now state-automata can be safely deleted when their editor is open
refs 921
parent c91e7695
......@@ -67,7 +67,7 @@ import org.fortiss.tooling.kernel.ui.util.ObservableUtils;
* @author ratiu
* @author $Author: ratiu $
* @version $Rev: 1097 $
* @ConQAT.Rating GREEN Hash: 2ED862CB06E7E78946BD1A923F6BF488
* @ConQAT.Rating YELLOW Hash: B97AB826F47300E93C98B310CF529408
*/
public class StateAutomatonTabularEditor extends EditorBase<StateAutomaton> {
......@@ -119,7 +119,9 @@ public class StateAutomatonTabularEditor extends EditorBase<StateAutomaton> {
if(element instanceof State) {
return ((State)element).getName();
}
return ((TransitionSegment)element).getTargetState().getName();
TransitionSegment ts = (TransitionSegment)element;
return ts.getTargetConnector() == null ? "" : ts.getTargetState()
.getName();
}
});
......
......@@ -6,7 +6,7 @@
<eClassifiers xsi:type="ecore:EClass" name="StateAutomaton" eSuperTypes="platform:/plugin/org.fortiss.af3.component/model/component.ecore#//behavior/IComponentBehaviorDefinitionSpecification platform:/plugin/org.fortiss.tooling.base/model/base.ecore#//element/IHierarchicElementContainer platform:/plugin/org.fortiss.af3.project/model/project.ecore#//typesystem/IVariableScope platform:/plugin/org.fortiss.af3.component/model/component.ecore#//behavior/common/IDataStateVariableProvider">
<eOperations name="getRootState" eType="#//State">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="return org.fortiss.tooling.kernel.utils.EcoreUtils.convertList(&#xA;&#x9;&#x9;&#x9;&#x9;State.class, getContainedElementsList()).get(0);"/>
<details key="body" value="return org.fortiss.tooling.kernel.utils.EcoreUtils.pickFirstInstanceOf(State.class,&#xA;&#x9;&#x9;&#x9;&#x9;getContainedElementsList());"/>
</eAnnotations>
</eOperations>
<eOperations name="getComponent" eType="ecore:EClass platform:/plugin/org.fortiss.af3.component/model/component.ecore#//Component">
......
......@@ -50,7 +50,7 @@ import org.fortiss.tooling.base.model.element.IConnector;
* @author ratiu
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating GREEN Hash: E2D4B31985699CF95929C32FD95188E0
* @ConQAT.Rating YELLOW Hash: 8A2C9D6A2C86DADECB2584278D6F00E6
*/
public class StateAutomatonUtils {
......@@ -241,7 +241,7 @@ public class StateAutomatonUtils {
*/
public static List<State> getSubStatesRecursively(State aState) {
List<State> subStates = new ArrayList<State>();
if(aState.getSubStates().size() > 0) {
if(aState != null && aState.getSubStates().size() > 0) {
subStates.addAll(aState.getSubStates());
for(State subState : aState.getSubStates()) {
subStates.addAll(getSubStatesRecursively(subState));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment