ソースを参照

Release the editor if simulation is terminated

Andreas Mülder 14 年 前
コミット
9e252f8792

+ 13 - 4
plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/model/presenter/SCTSourceDisplay.java

@@ -68,14 +68,14 @@ public class SCTSourceDisplay extends SimulationSessionListenerAdapter
 		StatechartDiagramEditor editor = openEditorAndSelectElements(
 				debugElement, page);
 
-		//Release the old editor
+		// Release the old editor
 		if (support.isLocked())
 			support.releaseEditor();
-		
+
 		support = (IHighlightingSupport) editor
 				.getAdapter(IHighlightingSupport.class);
-		
-		//Release the new editor
+
+		// Release the new editor
 		if (support.isLocked())
 			support.releaseEditor();
 
@@ -121,6 +121,15 @@ public class SCTSourceDisplay extends SimulationSessionListenerAdapter
 		});
 	}
 
+	@Override
+	public void simulationStateChanged(SimulationState oldState,
+			SimulationState newState) {
+		if (newState == SimulationState.TERMINATED) {
+			if (support.isLocked())
+				support.releaseEditor();
+		}
+	}
+
 	/**
 	 * Opens the editor for this resource and selects the selected Editparts
 	 *