Selaa lähdekoodia

Renamed plugin org.yakindu.sct.ui.simulation to org.yakindu.sct.simulation.ui

Andreas Mülder 14 vuotta sitten
vanhempi
commit
4d91e03e0b
39 muutettua tiedostoa jossa 2054 lisäystä ja 0 poistoa
  1. 7 0
      plugins/org.yakindu.sct.simulation.core/.classpath
  2. 28 0
      plugins/org.yakindu.sct.simulation.core/.project
  3. 8 0
      plugins/org.yakindu.sct.simulation.core/.settings/org.eclipse.jdt.core.prefs
  4. 15 0
      plugins/org.yakindu.sct.simulation.core/META-INF/MANIFEST.MF
  5. 5 0
      plugins/org.yakindu.sct.simulation.core/build.properties
  6. 15 0
      plugins/org.yakindu.sct.simulation.core/plugin.xml
  7. 102 0
      plugins/org.yakindu.sct.simulation.core/schema/org.yakindu.sct.simulation.core.sgraph.executionbuilder.exsd
  8. 32 0
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/Activator.java
  9. 30 0
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/ISGraphExecutionBuilder.java
  10. 32 0
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/ISGraphExecutionFacade.java
  11. 33 0
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/ISGraphExecutionListener.java
  12. 53 0
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/ISGraphExecutionScope.java
  13. 184 0
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/ISGraphSimulationSession.java
  14. 56 0
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/ISimulationSessionListener.java
  15. 55 0
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/SGraphSimulationSessionRegistry.java
  16. 8 0
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/debugmodel/IDebugConstants.java
  17. 130 0
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/debugmodel/SCTDebugTarget.java
  18. 141 0
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/debugmodel/SCTDebugThread.java
  19. 53 0
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/extensions/Extensions.java
  20. 7 0
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/extensions/IExtensionPoints.java
  21. 22 0
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/launch/IStatechartLaunchConfigurationType.java
  22. 24 0
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/launch/IStatechartLaunchParameters.java
  23. 99 0
      plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/launch/StatechartLaunchConfigurationDelegate.java
  24. 7 0
      plugins/org.yakindu.sct.simulation.ui/.classpath
  25. 28 0
      plugins/org.yakindu.sct.simulation.ui/.project
  26. 8 0
      plugins/org.yakindu.sct.simulation.ui/.settings/org.eclipse.jdt.core.prefs
  27. 22 0
      plugins/org.yakindu.sct.simulation.ui/META-INF/MANIFEST.MF
  28. 5 0
      plugins/org.yakindu.sct.simulation.ui/build.properties
  29. BIN
      plugins/org.yakindu.sct.simulation.ui/icons/yakindu.png
  30. 76 0
      plugins/org.yakindu.sct.simulation.ui/plugin.xml
  31. 34 0
      plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/SimulationActivator.java
  32. 95 0
      plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/editor/HighlightingExecutionListener.java
  33. 42 0
      plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/editor/IHighlightingSupportAdapterFactory.java
  34. 22 0
      plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/handler/GenericStatusHandler.java
  35. 108 0
      plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/launch/StatechartLaunchShortcut.java
  36. 152 0
      plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/launch/tabs/StatechartLaunchConfigurationTab.java
  37. 33 0
      plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/launch/tabs/StatechartLaunchConfigurationTabGroup.java
  38. 24 0
      plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/view/ClassViewerFilter.java
  39. 259 0
      plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/view/DeclarationView.java

+ 7 - 0
plugins/org.yakindu.sct.simulation.core/.classpath

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

+ 28 - 0
plugins/org.yakindu.sct.simulation.core/.project

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.yakindu.sct.simulation.core</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

+ 8 - 0
plugins/org.yakindu.sct.simulation.core/.settings/org.eclipse.jdt.core.prefs

@@ -0,0 +1,8 @@
+#Tue Jul 05 16:54:38 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6

+ 15 - 0
plugins/org.yakindu.sct.simulation.core/META-INF/MANIFEST.MF

@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Simulation
+Bundle-SymbolicName: org.yakindu.sct.simulation.core;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.yakindu.sct.simulation.core.Activator
+Bundle-Vendor: YAKINDU
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.debug.core;bundle-version="3.7.0",
+ org.eclipse.emf.ecore;bundle-version="2.7.0",
+ org.yakindu.sct.model.sgraph;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Export-Package: org.yakindu.sct.simulation.core,
+ org.yakindu.sct.simulation.core.launch

+ 5 - 0
plugins/org.yakindu.sct.simulation.core/build.properties

@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml

+ 15 - 0
plugins/org.yakindu.sct.simulation.core/plugin.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension-point id="org.yakindu.sct.simulation.core.sgraph.executionbuilder" name="SGraphExecutionBuilder" schema="schema/org.yakindu.sct.simulation.core.sgraph.executionbuilder.exsd"/>
+
+<extension point="org.eclipse.debug.core.launchConfigurationTypes">
+    <launchConfigurationType
+          delegate="org.yakindu.sct.simulation.core.launch.StatechartLaunchConfigurationDelegate"
+          id="org.yakindu.sct.simulation.core.launch.statechart"
+          modes="run, debug"
+          name="YAKINDU Statechart">        
+    </launchConfigurationType>
+</extension>
+
+</plugin>

+ 102 - 0
plugins/org.yakindu.sct.simulation.core/schema/org.yakindu.sct.simulation.core.sgraph.executionbuilder.exsd

@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.yakindu.sct.core.simulation" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appinfo>
+         <meta.schema plugin="org.yakindu.sct.core.simulation" id="org.yakindu.sct.simulation.core.sgraph.executionbuilder" name="SGraphExecutionBuilder"/>
+      </appinfo>
+      <documentation>
+         [Enter description of this extension point.]
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
+      <complexType>
+         <sequence>
+            <element ref="SGraphExecutionBuilder"/>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute translatable="true"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="SGraphExecutionBuilder">
+      <complexType>
+         <attribute name="class" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn=":org.yakindu.sct.core.simulation.builder.ISGraphExecutionBuilder"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="since"/>
+      </appinfo>
+      <documentation>
+         [Enter the first release in which this extension point appears.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="examples"/>
+      </appinfo>
+      <documentation>
+         [Enter extension point usage example here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="apiinfo"/>
+      </appinfo>
+      <documentation>
+         [Enter API information here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="implementation"/>
+      </appinfo>
+      <documentation>
+         [Enter information about supplied implementation of this extension point.]
+      </documentation>
+   </annotation>
+
+
+</schema>

+ 32 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/Activator.java

@@ -0,0 +1,32 @@
+package org.yakindu.sct.simulation.core;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+	private static BundleContext context;
+	
+	public static final String PLUGIN_ID = "org.yakindu.sct.simulation.core";
+
+	static BundleContext getContext() {
+		return context;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext bundleContext) throws Exception {
+		Activator.context = bundleContext;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext bundleContext) throws Exception {
+		Activator.context = null;
+	}
+
+}

+ 30 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/ISGraphExecutionBuilder.java

@@ -0,0 +1,30 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.simulation.core;
+
+import org.yakindu.sct.model.sgraph.Statechart;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public interface ISGraphExecutionBuilder {
+	/**
+	 * Returns an execution facade for a statechart model. Execution Builder can
+	 * be registered via extension point
+	 * "org.yakindu.sct.simulation.core.sgraph.executionbuilder"
+	 * 
+	 * @param statechart
+	 * @return
+	 */
+	public ISGraphExecutionFacade build(Statechart statechart);
+}

+ 32 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/ISGraphExecutionFacade.java

@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.simulation.core;
+
+/**
+ * Facade for executable statechart implementation.
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public interface ISGraphExecutionFacade {
+
+	public void enter();
+
+	public void runCycle();
+
+	public void raise(String eventName);
+
+	public void addExecutionListener(ISGraphExecutionListener listener);
+
+	public void removeExecutionListener(ISGraphExecutionListener listener);
+
+	public ISGraphExecutionScope getExecutionScope();
+}

+ 33 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/ISGraphExecutionListener.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.simulation.core;
+
+import org.yakindu.sct.model.sgraph.Transition;
+import org.yakindu.sct.model.sgraph.Vertex;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public interface ISGraphExecutionListener {
+
+	void stateEntered(Vertex vertex);
+
+	void stateLeft(Vertex vertex);
+
+	void transitionFired(Transition transition);
+
+	void variableValueChanged(String variableName, Object value);
+
+	void eventRaised(String eventName);
+
+}

+ 53 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/ISGraphExecutionScope.java

@@ -0,0 +1,53 @@
+package org.yakindu.sct.simulation.core;
+
+import java.util.List;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public interface ISGraphExecutionScope {
+
+	public ScopeVariable getVariable(String varName);
+
+	public List<ScopeVariable> getVariables();
+
+	public void setVariableValue(ScopeVariable variable, Object object);
+
+	public void createVariable(String varName, Object value, Class<?> type);
+
+	public void call(String procedureId);
+
+	public void raise(String signal);
+
+	/**
+	 * Read only access to ScopeVariables. Value can only be changed via
+	 * {@link ISGraphExecutionScope}#setVariableValue
+	 * 
+	 */
+	public class ScopeVariable {
+		private String name;
+		private Class<?> type;
+		private Object value;
+
+		public ScopeVariable(String name, Class<?> type, Object value) {
+			super();
+			this.name = name;
+			this.type = type;
+			this.value = value;
+		}
+
+		public String getName() {
+			return name;
+		}
+
+		public Class<?> getType() {
+			return type;
+		}
+
+		public Object getValue() {
+			return value;
+		}
+	}
+}

+ 184 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/ISGraphSimulationSession.java

@@ -0,0 +1,184 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.simulation.core;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import org.yakindu.sct.model.sgraph.Transition;
+import org.yakindu.sct.model.sgraph.Vertex;
+import org.yakindu.sct.simulation.core.ISimulationSessionListener.SimulationState;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class ISGraphSimulationSession implements Runnable,
+		ISGraphExecutionListener {
+
+	private List<ISimulationSessionListener> listeners;
+
+	private BlockingQueue<Runnable> taskQueue;
+
+	private SimulationState currentState;
+
+	private final ISGraphExecutionFacade facade;
+
+	private Timer timer;
+
+	public ISGraphSimulationSession(ISGraphExecutionFacade facade) {
+		this.facade = facade;
+		facade.addExecutionListener(this);
+		listeners = new ArrayList<ISimulationSessionListener>();
+		taskQueue = new LinkedBlockingQueue<Runnable>();
+		timer = new Timer();
+	}
+
+	public void start() {
+		taskQueue.add(new Runnable() {
+			public void run() {
+				SGraphSimulationSessionRegistry.INSTANCE
+						.registerSimulationSession(ISGraphSimulationSession.this);
+				changeSimulationState(SimulationState.STARTED);
+				facade.enter();
+				changeSimulationState(SimulationState.RUNNING);
+				scheduleCycle();
+			}
+		});
+	}
+
+	public void singleStep() {
+		taskQueue.add(new Runnable() {
+			public void run() {
+				changeSimulationState(SimulationState.SINGLESTEP);
+			}
+		});
+	}
+
+	public void resume() {
+		taskQueue.add(new Runnable() {
+			public void run() {
+				changeSimulationState(SimulationState.RUNNING);
+				scheduleCycle();
+			}
+		});
+	}
+
+	public void suspend() {
+		taskQueue.add(new Runnable() {
+			public void run() {
+				changeSimulationState(SimulationState.PAUSED);
+			}
+		});
+	}
+
+	public void terminate() {
+		taskQueue.add(new Runnable() {
+			public void run() {
+				changeSimulationState(SimulationState.TERMINATED);
+				SGraphSimulationSessionRegistry.INSTANCE
+						.unregisterSimulationSession(ISGraphSimulationSession.this);
+			}
+		});
+	}
+
+	public void raiseEvent(final String eventName) {
+		taskQueue.add(new Runnable() {
+			public void run() {
+				facade.raise(eventName);
+			}
+		});
+	}
+
+	public void setVariableValue(String variableName, Object value) {
+
+	}
+
+	protected void scheduleCycle() {
+		if (currentState == SimulationState.RUNNING) {
+			timer.schedule(new TimerTask() {
+				public void run() {
+					taskQueue.add(new Runnable() {
+						public void run() {
+							facade.runCycle();
+						}
+					});
+					scheduleCycle();
+				}
+			}, 100);
+
+		}
+	}
+
+	public void run() {
+		while (!(currentState == SimulationState.TERMINATED)) {
+			try {
+				Runnable task = taskQueue.take();
+				task.run();
+			} catch (InterruptedException e) {
+				e.printStackTrace();
+			}
+		}
+	}
+
+	protected void changeSimulationState(SimulationState newState) {
+		for (ISimulationSessionListener listener : listeners) {
+			listener.simulationStateChanged(this.currentState, newState);
+		}
+		this.currentState = newState;
+	}
+
+	public void stateEntered(Vertex vertex) {
+		for (ISimulationSessionListener listener : listeners) {
+			listener.stateEntered(vertex);
+		}
+	}
+
+	public void stateLeft(Vertex vertex) {
+		for (ISimulationSessionListener listener : listeners) {
+			listener.stateLeft(vertex);
+		}
+
+	}
+
+	public void transitionFired(Transition transition) {
+		for (ISimulationSessionListener listener : listeners) {
+			listener.transitionFired(transition);
+		}
+
+	}
+
+	public List<ISimulationSessionListener> getListeners() {
+		return listeners;
+	}
+
+	public void variableValueChanged(String variableName, Object value) {
+		for (ISimulationSessionListener listener : listeners) {
+			listener.variableValueChanged(variableName, value);
+		}
+
+	}
+
+	public void eventRaised(String eventName) {
+		for (ISimulationSessionListener listener : listeners) {
+			listener.eventRaised(eventName);
+		}
+	}
+
+	public ISGraphExecutionScope getExecutionScope() {
+		return facade.getExecutionScope();
+	}
+}

+ 56 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/ISimulationSessionListener.java

@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.simulation.core;
+
+import org.yakindu.sct.model.sgraph.Transition;
+import org.yakindu.sct.model.sgraph.Vertex;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public interface ISimulationSessionListener extends ISGraphExecutionListener {
+
+	public static enum SimulationState {
+		STARTED, RUNNING, SINGLESTEP, PAUSED, TERMINATED
+	}
+
+	public void simulationStateChanged(SimulationState oldState,
+			SimulationState newState);
+
+	/**
+	 * Null implementation
+	 * 
+	 */
+	public static class SimulationSessionListenerAdapter implements
+			ISimulationSessionListener {
+
+		public void stateEntered(Vertex vertex) {
+		}
+
+		public void stateLeft(Vertex vertex) {
+		}
+
+		public void transitionFired(Transition transition) {
+		}
+
+		public void simulationStateChanged(SimulationState oldState,
+				SimulationState newState) {
+		}
+
+		public void variableValueChanged(String variableName, Object value) {
+		}
+
+		public void eventRaised(String eventName) {
+		}
+	}
+}

+ 55 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/SGraphSimulationSessionRegistry.java

@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.simulation.core;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class SGraphSimulationSessionRegistry {
+
+	public static final SGraphSimulationSessionRegistry INSTANCE = new SGraphSimulationSessionRegistry();
+
+	private List<ISimulationSessionListener> sessionListener;
+
+	private List<ISGraphSimulationSession> sessions;
+
+	private SGraphSimulationSessionRegistry() {
+		sessionListener = new ArrayList<ISimulationSessionListener>();
+		sessions = new ArrayList<ISGraphSimulationSession>();
+	}
+
+	public void registerSimulationSession(ISGraphSimulationSession session) {
+		session.getListeners().addAll(getListeners());
+		sessions.add(session);
+	}
+
+	public void unregisterSimulationSession(ISGraphSimulationSession session) {
+		session.getListeners().clear();
+		sessions.remove(session);
+	}
+
+	public List<ISimulationSessionListener> getListeners() {
+		return sessionListener;
+	}
+
+	public ISGraphSimulationSession getActiveSession() {
+		// TODO
+		if (sessions.isEmpty())
+			return null;
+		return sessions.get(0);
+	}
+
+}

+ 8 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/debugmodel/IDebugConstants.java

@@ -0,0 +1,8 @@
+package org.yakindu.sct.simulation.core.debugmodel;
+
+public interface IDebugConstants {
+
+	public static final String ID_DEBUG_MODEL = "sct_debug";
+	public static final String DEBUG_TARGET = "YAKINDU Statechart Simulation";
+	public static final String DEBUG_THREAD = "Thread[1]";
+}

+ 130 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/debugmodel/SCTDebugTarget.java

@@ -0,0 +1,130 @@
+package org.yakindu.sct.simulation.core.debugmodel;
+
+import org.eclipse.core.resources.IMarkerDelta;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IMemoryBlock;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.model.IThread;
+import org.yakindu.sct.simulation.core.ISGraphExecutionFacade;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class SCTDebugTarget extends PlatformObject implements IDebugTarget {
+
+	private IProcess process;
+
+	private ILaunch launch;
+
+	private SCTDebugThread thread;
+
+	public SCTDebugTarget(ILaunch launch, ISGraphExecutionFacade facade)
+			throws CoreException {
+		this.launch = launch;
+		thread = new SCTDebugThread(this, facade);
+		DebugPlugin.getDefault().getBreakpointManager()
+				.addBreakpointListener(this);
+	}
+
+	public IProcess getProcess() {
+		return process;
+	}
+
+	public IThread[] getThreads() throws DebugException {
+		return new IThread[] { thread };
+	}
+
+	public boolean hasThreads() throws DebugException {
+		return true;
+	}
+
+	public String getName() throws DebugException {
+		return IDebugConstants.DEBUG_TARGET;
+	}
+
+	public boolean supportsBreakpoint(IBreakpoint breakpoint) {
+		return false;
+	}
+
+	public boolean canTerminate() {
+		return thread.canTerminate();
+	}
+
+	public boolean isTerminated() {
+		return thread.isTerminated();
+	}
+
+	public void terminate() throws DebugException {
+
+		thread.terminate();
+	}
+
+	public boolean canResume() {
+		return thread.canResume();
+	}
+
+	public boolean canSuspend() {
+		return thread.canSuspend();
+	}
+
+	public boolean isSuspended() {
+		return thread.isSuspended();
+	}
+
+	public void resume() throws DebugException {
+		thread.resume();
+	}
+
+	public void suspend() throws DebugException {
+		thread.suspend();
+	}
+
+	public void breakpointAdded(IBreakpoint breakpoint) {
+	}
+
+	public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
+	}
+
+	public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
+	}
+
+	public boolean canDisconnect() {
+		return false;
+	}
+
+	public void disconnect() throws DebugException {
+
+	}
+
+	public boolean isDisconnected() {
+		return false;
+	}
+
+	public boolean supportsStorageRetrieval() {
+		return false;
+	}
+	public IMemoryBlock getMemoryBlock(long startAddress, long length)
+			throws DebugException {
+		return null;
+	}
+
+	public ILaunch getLaunch() {
+		return launch;
+	}
+
+	public String getModelIdentifier() {
+		return IDebugConstants.DEBUG_TARGET;
+	}
+
+	public IDebugTarget getDebugTarget() {
+		return this;
+	}
+}

+ 141 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/debugmodel/SCTDebugThread.java

@@ -0,0 +1,141 @@
+package org.yakindu.sct.simulation.core.debugmodel;
+
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IStackFrame;
+import org.eclipse.debug.core.model.IThread;
+import org.yakindu.sct.simulation.core.ISGraphExecutionFacade;
+import org.yakindu.sct.simulation.core.ISGraphSimulationSession;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class SCTDebugThread extends PlatformObject implements IThread {
+
+	private boolean stepping = false;
+	private boolean terminated = false;
+	private boolean suspended = false;
+	private Thread thread;
+	private ISGraphSimulationSession session;
+	private final SCTDebugTarget target;
+
+	public SCTDebugThread(SCTDebugTarget target, ISGraphExecutionFacade facade) {
+		this.target = target;
+		session = new ISGraphSimulationSession(facade);
+		thread = new Thread(session);
+		thread.start();
+		session.start();
+	}
+
+	public IStackFrame[] getStackFrames() throws DebugException {
+		return new IStackFrame[] {};
+	}
+
+	public boolean hasStackFrames() throws DebugException {
+		return false;
+	}
+
+	public int getPriority() throws DebugException {
+		return 0;
+	}
+
+	public String getName() throws DebugException {
+		return IDebugConstants.DEBUG_THREAD;
+	}
+
+	public IBreakpoint[] getBreakpoints() {
+		return null;
+	}
+
+	public boolean canResume() {
+		return suspended && !terminated;
+	}
+
+	public boolean canSuspend() {
+		return !suspended && !terminated;
+	}
+
+	public boolean isSuspended() {
+		return suspended;
+	}
+
+	public void resume() throws DebugException {
+		fireEvent(new DebugEvent(this, DebugEvent.RESUME));
+		session.resume();
+		suspended = false;
+	}
+
+	public void suspend() throws DebugException {
+		fireEvent(new DebugEvent(this, DebugEvent.SUSPEND));
+		session.suspend();
+		suspended = true;
+	}
+
+	public boolean canStepInto() {
+		return false;
+	}
+
+	public boolean canStepOver() {
+		return isSuspended() && !isTerminated();
+	}
+
+	public boolean canStepReturn() {
+		return false;
+	}
+
+	public boolean isStepping() {
+		return stepping;
+	}
+
+	public void stepInto() throws DebugException {
+	}
+
+	public void stepOver() throws DebugException {
+		fireEvent(new DebugEvent(getDebugTarget(), DebugEvent.STEP_OVER));
+		session.singleStep();
+	}
+
+	public void stepReturn() throws DebugException {
+	}
+
+	public boolean canTerminate() {
+		return !terminated;
+	}
+
+	public boolean isTerminated() {
+		return terminated;
+	}
+
+	public void terminate() throws DebugException {
+		fireEvent(new DebugEvent(getDebugTarget(), DebugEvent.TERMINATE));
+		terminated = true;
+		session.terminate();
+	}
+
+	public IStackFrame getTopStackFrame() throws DebugException {
+		return null;
+	}
+
+	public ILaunch getLaunch() {
+		return getDebugTarget().getLaunch();
+	}
+
+	protected void fireEvent(DebugEvent event) {
+		DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] { event });
+	}
+
+	public String getModelIdentifier() {
+		return IDebugConstants.DEBUG_THREAD;
+	}
+
+	public IDebugTarget getDebugTarget() {
+		return target;
+	}
+}

+ 53 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/extensions/Extensions.java

@@ -0,0 +1,53 @@
+package org.yakindu.sct.simulation.core.extensions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+
+/**
+ * 
+ * @author andreas muelder
+ * 
+ */
+public class Extensions<T> {
+
+	private String extensionPointId;
+
+	public Extensions(String extensionPointId) {
+		this.extensionPointId = extensionPointId;
+	}
+
+	public T getFirstExtension() {
+		return getExtensions().get(0);
+	}
+
+	public List<T> getExtensions() {
+		List<T> extensions = loadRegisteredProvider();
+		if (extensions.size() == 0)
+			throw new IllegalStateException(
+					"No extensions registered for extension point"
+							+ extensionPointId);
+		return extensions;
+	}
+
+	public List<T> loadRegisteredProvider() {
+		List<T> providers = new ArrayList<T>();
+		IConfigurationElement[] configurationElements = Platform
+				.getExtensionRegistry().getConfigurationElementsFor(
+						extensionPointId);
+		for (IConfigurationElement configurationElement : configurationElements) {
+			try {
+				@SuppressWarnings("unchecked")
+				T provider = (T) configurationElement
+						.createExecutableExtension("class");
+				providers.add(provider);
+			} catch (CoreException e) {
+				e.printStackTrace();
+			}
+		}
+		return providers;
+	}
+}

+ 7 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/extensions/IExtensionPoints.java

@@ -0,0 +1,7 @@
+package org.yakindu.sct.simulation.core.extensions;
+
+public interface IExtensionPoints {
+
+	public static final String EXECUTION_BUILDER = "org.yakindu.sct.simulation.core.sgraph.executionbuilder";
+
+}

+ 22 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/launch/IStatechartLaunchConfigurationType.java

@@ -0,0 +1,22 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.simulation.core.launch;
+
+/**
+ * 
+ * @author andreas muelder
+ * 
+ */
+public interface IStatechartLaunchConfigurationType {
+
+	String CONFIG_TYPE = "org.yakindu.sct.simulation.core.launch.statechart";
+
+}

+ 24 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/launch/IStatechartLaunchParameters.java

@@ -0,0 +1,24 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.simulation.core.launch;
+
+/**
+ * Attribute constants for the YAKINDU Statechart launch configuration.
+ * 
+ * @author andreas muelder
+ * 
+ */
+public interface IStatechartLaunchParameters {
+
+	String FILE_NAME = "filename";
+	String DEFAULT_FILE_NAME = "";
+
+}

+ 99 - 0
plugins/org.yakindu.sct.simulation.core/src/org/yakindu/sct/simulation/core/launch/StatechartLaunchConfigurationDelegate.java

@@ -0,0 +1,99 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.simulation.core.launch;
+
+import java.io.IOException;
+import java.util.Collections;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.IStatusHandler;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.Resource.Factory;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceFactoryRegistryImpl;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.yakindu.sct.model.sgraph.SGraphPackage;
+import org.yakindu.sct.model.sgraph.Statechart;
+import org.yakindu.sct.simulation.core.Activator;
+import org.yakindu.sct.simulation.core.ISGraphExecutionBuilder;
+import org.yakindu.sct.simulation.core.ISGraphExecutionFacade;
+import org.yakindu.sct.simulation.core.debugmodel.SCTDebugTarget;
+import org.yakindu.sct.simulation.core.extensions.Extensions;
+import org.yakindu.sct.simulation.core.extensions.IExtensionPoints;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class StatechartLaunchConfigurationDelegate implements
+		ILaunchConfigurationDelegate, IExtensionPoints {
+
+	private static final int STATUS_CODE = 200;
+
+	public void launch(ILaunchConfiguration configuration, String mode,
+			ILaunch launch, IProgressMonitor monitor) throws CoreException {
+		String filename = configuration.getAttribute(
+				IStatechartLaunchParameters.FILE_NAME, "");
+		Resource resource = loadResource(filename);
+		
+		Statechart statechart = (Statechart) EcoreUtil.getObjectByType(
+				resource.getContents(), SGraphPackage.Literals.STATECHART);
+		
+		ISGraphExecutionBuilder builder = getBuilder();
+		ISGraphExecutionFacade executionFacade = builder.build(statechart);
+		IDebugTarget target = new SCTDebugTarget(launch, executionFacade);
+		launch.addDebugTarget(target);
+
+	}
+
+	protected ISGraphExecutionBuilder getBuilder() {
+		Extensions<ISGraphExecutionBuilder> extensions = new Extensions<ISGraphExecutionBuilder>(
+				EXECUTION_BUILDER);
+		return extensions.getFirstExtension();
+	}
+
+	protected void handleStatusInformation(int severity, String message) {
+		Status status = new Status(severity, Activator.PLUGIN_ID, STATUS_CODE,
+				message, null);
+		IStatusHandler statusHandler = DebugPlugin.getDefault()
+				.getStatusHandler(status);
+		try {
+			statusHandler.handleStatus(status, this);
+		} catch (CoreException e) {
+			e.printStackTrace();
+		}
+	}
+
+	protected Resource loadResource(String filename) {
+		URI uri = URI.createFileURI(filename);
+		Factory factory = ResourceFactoryRegistryImpl.INSTANCE.getFactory(uri);
+		Resource resource = factory.createResource(uri);
+		ResourceSet resourceSet = new ResourceSetImpl();
+		resourceSet.getResources().add(resource);
+		try {
+			resource.load(Collections.EMPTY_MAP);
+			return resource;
+		} catch (IOException e) {
+			throw new IllegalStateException("Error loading resource", e);
+		}
+	}
+
+}

+ 7 - 0
plugins/org.yakindu.sct.simulation.ui/.classpath

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

+ 28 - 0
plugins/org.yakindu.sct.simulation.ui/.project

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.yakindu.sct.simulation.ui</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

+ 8 - 0
plugins/org.yakindu.sct.simulation.ui/.settings/org.eclipse.jdt.core.prefs

@@ -0,0 +1,8 @@
+#Tue Jun 07 06:42:27 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5

+ 22 - 0
plugins/org.yakindu.sct.simulation.ui/META-INF/MANIFEST.MF

@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Simulation UI
+Bundle-SymbolicName: org.yakindu.sct.simulation.ui;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.yakindu.sct.simulation.ui.SimulationActivator
+Bundle-Vendor: YAKINDU
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.emf.ecore;bundle-version="2.7.0",
+ de.itemis.gmf.runtime.commons;bundle-version="1.0.0",
+ org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="1.4.1",
+ org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.5.0",
+ org.eclipse.debug.ui;bundle-version="3.7.0",
+ org.eclipse.jdt.launching;bundle-version="3.6.0",
+ org.eclipse.jdt.debug.ui;bundle-version="3.6.0",
+ org.yakindu.sct.simulation.core;bundle-version="1.0.0",
+ org.yakindu.sct.model.sgraph;bundle-version="1.0.0",
+ de.itemis.xtext.utils.jface;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Import-Package: org.eclipse.ui.dialogs

+ 5 - 0
plugins/org.yakindu.sct.simulation.ui/build.properties

@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml

BIN
plugins/org.yakindu.sct.simulation.ui/icons/yakindu.png


+ 76 - 0
plugins/org.yakindu.sct.simulation.ui/plugin.xml

@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+	<!-- Editor Highlighting Adapter -->
+   <extension
+         point="org.eclipse.core.runtime.adapters">
+      <factory
+            adaptableType="org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor"
+            class="org.yakindu.sct.simulation.ui.editor.IHighlightingSupportAdapterFactory">
+         <adapter
+               type="org.yakindu.sct.simulation.ui.editor.IHighlightingSupportAdapterFactory">
+         </adapter>
+      </factory>
+   </extension>
+	
+	<!-- Launch configuration images -->
+   <extension point="org.eclipse.debug.ui.launchConfigurationTypeImages">
+    	<launchConfigurationTypeImage
+        	icon="icons/yakindu.png"
+        	configTypeID="org.yakindu.sct.core.simulation.launch.statechart"
+        	id="org.yakindu.sct.core.simulation.launch.statechartTypeImage">
+	    </launchConfigurationTypeImage>
+	</extension>
+	
+	<!-- launch tab group -->
+	<extension point="org.eclipse.debug.ui.launchConfigurationTabGroups">
+  	  <launchConfigurationTabGroup
+    	 type="org.yakindu.sct.core.simulation.launch.statechart"
+  	     class="org.yakindu.sct.simulation.ui.launch.tabs.StatechartLaunchConfigurationTabGroup"
+  	     id="org.yakindu.sct.simulation.ui.launch.tabs.statechart.tabs">
+   	 </launchConfigurationTabGroup>
+	</extension>
+	
+	<!-- launch shortcuts -->
+	<extension point="org.eclipse.debug.ui.launchShortcuts">
+	    <shortcut
+	        id="org.yakindu.sct.core.simulation.launch.shortcut"
+	        class="org.yakindu.sct.simulation.ui.launch.StatechartLaunchShortcut"
+	        label="YAKINDU Statechart"
+	        icon="icons/yakindu.png"
+	        modes="run, debug">
+	         <contextualLaunch>
+				<enablement>
+					<with variable="selection">
+					<count value="1"/>
+						<iterate>
+							<test property="org.eclipse.debug.ui.matchesPattern" value="*.sct"/>
+						</iterate>
+					</with>
+				</enablement>
+		  	 </contextualLaunch>
+	    </shortcut>
+	</extension>
+	
+<!-- Session Listener -->
+ <extension
+       point="org.eclipse.ui.views">
+    <view
+          allowMultiple="false"
+          class="org.yakindu.sct.simulation.ui.view.DeclarationView"
+          icon="icons/yakindu.png"
+          id="org.yakindu.sct.simulation.ui.declarationview"
+          name="Declarations View"
+          restorable="true">
+    </view>
+ </extension>
+ <extension
+       point="org.eclipse.debug.core.statusHandlers">
+    <statusHandler
+          class="org.yakindu.sct.simulation.ui.handler.GenericStatusHandler"
+          code="200"
+          id="org.yakindu.sct.simulation.ui.statushandler"
+          plugin="org.yakindu.sct.simulation.core">
+    </statusHandler>
+ </extension>
+</plugin>

+ 34 - 0
plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/SimulationActivator.java

@@ -0,0 +1,34 @@
+package org.yakindu.sct.simulation.ui;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+import org.yakindu.sct.simulation.core.SGraphSimulationSessionRegistry;
+import org.yakindu.sct.simulation.ui.editor.HighlightingExecutionListener;
+
+public class SimulationActivator extends AbstractUIPlugin {
+
+	public static final String PLUGIN_ID = "org.yakindu.sct.statechart.simulation.ui"; //$NON-NLS-1$
+
+	private static SimulationActivator plugin;
+
+	public SimulationActivator() {
+	}
+
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+		
+		SGraphSimulationSessionRegistry.INSTANCE.getListeners().add(
+				new HighlightingExecutionListener());
+	}
+
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	public static SimulationActivator getDefault() {
+		return plugin;
+	}
+
+}

+ 95 - 0
plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/editor/HighlightingExecutionListener.java

@@ -0,0 +1,95 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.simulation.ui.editor;
+
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorPart;
+import org.yakindu.sct.model.sgraph.Transition;
+import org.yakindu.sct.model.sgraph.Vertex;
+import org.yakindu.sct.simulation.core.ISimulationSessionListener;
+import org.yakindu.sct.simulation.core.ISimulationSessionListener.SimulationSessionListenerAdapter;
+
+import de.itemis.gmf.runtime.commons.highlighting.HighlightingParameters;
+import de.itemis.gmf.runtime.commons.highlighting.IHighlightingSupport;
+import de.itemis.xtext.utils.jface.viewers.util.ActiveEditorResolver;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class HighlightingExecutionListener extends
+		SimulationSessionListenerAdapter implements ISimulationSessionListener {
+
+	private IHighlightingSupport highlightingSupport;
+
+	private HighlightingParameters parameters;
+
+	public HighlightingExecutionListener() {
+		parameters = new HighlightingParameters();
+	}
+
+	protected IHighlightingSupport getSupport() {
+		if (highlightingSupport != null)
+			return highlightingSupport;
+		IEditorPart activeEditor = ActiveEditorResolver.getActiveEditor();
+		if (activeEditor != null) {
+			// TODO The active editor should be adaptable to IHighlightSupport
+			// via registered factory
+			IHighlightingSupportAdapterFactory factory = new IHighlightingSupportAdapterFactory();
+			IHighlightingSupport support = (IHighlightingSupport) factory
+					.getAdapter(activeEditor, IHighlightingSupport.class);
+			if (support != null)
+				return highlightingSupport = support;
+		}
+		return new IHighlightingSupport.HighlightingSupportNullImpl();
+	}
+
+	public void stateEntered(final Vertex vertex) {
+		Display.getDefault().asyncExec(new Runnable() {
+			public void run() {
+				getSupport().fadeIn(vertex, parameters);
+			}
+		});
+	}
+
+	public void stateLeft(final Vertex vertex) {
+		Display.getDefault().asyncExec(new Runnable() {
+			public void run() {
+				getSupport().fadeOut(vertex, parameters);
+			}
+		});
+	}
+
+	public void transitionFired(final Transition transition) {
+		Display.getDefault().asyncExec(new Runnable() {
+			public void run() {
+				getSupport().flash(transition, parameters);
+			}
+		});
+	}
+
+	public void simulationStateChanged(SimulationState oldState,
+			final SimulationState newState) {
+		Display.getDefault().asyncExec(new Runnable() {
+			public void run() {
+				switch (newState) {
+				case STARTED:
+					getSupport().lockEditor();
+					break;
+				case TERMINATED:
+					getSupport().releaseEditor();
+					break;
+				}
+			}
+		});
+	}
+}

+ 42 - 0
plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/editor/IHighlightingSupportAdapterFactory.java

@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.simulation.ui.editor;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor;
+
+import de.itemis.gmf.runtime.commons.highlighting.HighlightingSupportAdapter;
+import de.itemis.gmf.runtime.commons.highlighting.IHighlightingSupport;
+
+/**
+ * Adapts GMF Editors to a {@link IHighlightingSupport}
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+@SuppressWarnings({ "rawtypes" })
+public class IHighlightingSupportAdapterFactory implements IAdapterFactory {
+
+	public Object getAdapter(Object adaptableObject, Class adapterType) {
+		if (adapterType == IHighlightingSupport.class) {
+			if (adaptableObject instanceof DiagramDocumentEditor) {
+				return new HighlightingSupportAdapter(
+						(DiagramDocumentEditor) adaptableObject);
+			}
+		}
+		return null;
+	}
+
+	public Class[] getAdapterList() {
+		return new Class[] { IHighlightingSupport.class };
+	}
+
+}

+ 22 - 0
plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/handler/GenericStatusHandler.java

@@ -0,0 +1,22 @@
+package org.yakindu.sct.simulation.ui.handler;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.debug.core.IStatusHandler;
+import org.eclipse.ui.statushandlers.StatusManager;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class GenericStatusHandler implements IStatusHandler {
+
+	public Object handleStatus(IStatus status, Object source)
+			throws CoreException {
+		StatusManager.getManager().handle(status, StatusManager.SHOW);
+		return null;
+
+	}
+
+}

+ 108 - 0
plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/launch/StatechartLaunchShortcut.java

@@ -0,0 +1,108 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.simulation.ui.launch;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.ILaunchShortcut;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorPart;
+import org.yakindu.sct.simulation.core.launch.IStatechartLaunchConfigurationType;
+import org.yakindu.sct.simulation.core.launch.IStatechartLaunchParameters;
+
+/**
+ * 
+ * @author andreas muelder
+ * 
+ */
+public class StatechartLaunchShortcut implements ILaunchShortcut,
+		IStatechartLaunchConfigurationType, IStatechartLaunchParameters {
+
+	public void launch(ISelection selection, String mode) {
+		if (selection instanceof IStructuredSelection) {
+			final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+			final Object object = structuredSelection.getFirstElement();
+			if (object instanceof IAdaptable) {
+				IFile file = (IFile) ((IAdaptable) object)
+						.getAdapter(IResource.class);
+				launch(file, mode);
+			}
+		}
+	}
+
+	public void launch(IEditorPart editor, String mode) {
+		IResource resource = (IResource) editor.getEditorInput().getAdapter(
+				IResource.class);
+		launch((IFile) resource, mode);
+	}
+
+	protected void launch(IFile file, String mode) {
+		final ILaunchManager launchManager = DebugPlugin.getDefault()
+				.getLaunchManager();
+		final ILaunchConfigurationType configType = launchManager
+				.getLaunchConfigurationType(CONFIG_TYPE);
+		ILaunchConfiguration launchConfig = findLaunchConfiguration(configType,
+				file);
+		if (launchConfig != null) {
+			DebugUITools.launch(launchConfig, mode);
+		} else {
+			ILaunchConfiguration launchConfiguration = createNewLaunchConfiguration(file);
+			DebugUITools.launch(launchConfiguration, mode);
+		}
+	}
+
+	private ILaunchConfiguration createNewLaunchConfiguration(IFile file) {
+		final ILaunchManager launchManager = DebugPlugin.getDefault()
+				.getLaunchManager();
+		final ILaunchConfigurationType configType = launchManager
+				.getLaunchConfigurationType(CONFIG_TYPE);
+		try {
+			ILaunchConfigurationWorkingCopy newConfig = configType.newInstance(
+					null, launchManager.generateLaunchConfigurationName(file
+							.getName()));
+
+			newConfig.setAttribute(FILE_NAME, file.getFullPath().toString());
+			return newConfig.doSave();
+
+		} catch (CoreException e) {
+			e.printStackTrace();
+		}
+		throw new IllegalStateException();
+	}
+
+	protected ILaunchConfiguration findLaunchConfiguration(
+			ILaunchConfigurationType configType, IFile file) {
+		ILaunchConfiguration[] configs;
+		try {
+			configs = DebugPlugin.getDefault().getLaunchManager()
+					.getLaunchConfigurations(configType);
+			for (ILaunchConfiguration config : configs) {
+				String attribute = config.getAttribute(FILE_NAME, "");
+				if (attribute.equals(file.getFullPath().toString())) {
+					return config;
+				}
+			}
+		} catch (CoreException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+}

+ 152 - 0
plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/launch/tabs/StatechartLaunchConfigurationTab.java

@@ -0,0 +1,152 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.simulation.ui.launch.tabs;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchTab;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.ResourceListSelectionDialog;
+import org.yakindu.sct.simulation.core.launch.IStatechartLaunchParameters;
+
+/**
+ * 
+ * @author andreas muelder
+ * 
+ */
+public class StatechartLaunchConfigurationTab extends JavaLaunchTab implements
+		IStatechartLaunchParameters {
+
+	private Image image;
+	private Text modelfile;
+
+	public StatechartLaunchConfigurationTab() {
+		image = new Image(Display.getDefault(), getClass().getClassLoader()
+				.getResourceAsStream("icons/yakindu.png"));
+	}
+
+	public void createControl(Composite parent) {
+		Composite comp = new Composite(parent, SWT.NONE);
+		setControl(comp);
+		comp.setLayout(new GridLayout(1, true));
+		createFileSelectionGroup(comp);
+		new Label(comp, SWT.NONE);
+	}
+
+	private void createFileSelectionGroup(Composite comp) {
+		Group fileGroup = new Group(comp, SWT.NONE);
+		GridDataFactory.fillDefaults().grab(true, false).applyTo(fileGroup);
+		fileGroup.setText("Model file:");
+		fileGroup.setLayout(new GridLayout(2, false));
+
+		modelfile = new Text(fileGroup, SWT.BORDER);
+		modelfile.addModifyListener(new UpdateListener());
+		GridDataFactory.fillDefaults().grab(true, false).applyTo(modelfile);
+
+		Button browse = new Button(fileGroup, SWT.NONE);
+		browse.setText("Search");
+		browse.addSelectionListener(new SelectionListener() {
+
+			public void widgetSelected(SelectionEvent e) {
+				ResourceListSelectionDialog dialog = new ResourceListSelectionDialog(
+						getShell(), ResourcesPlugin.getWorkspace().getRoot(),
+						IResource.FILE);
+				dialog.setTitle("Select Statechart model");
+				dialog.setMessage("Please select the YAKINDU statechart model file you want to execute.");
+				if (dialog.open() == 0) {
+					Object[] files = dialog.getResult();
+					IFile file = (IFile) files[0];
+					modelfile.setText((file.getFullPath().toString()));
+				}
+			}
+
+			public void widgetDefaultSelected(SelectionEvent e) {
+				// Nothing to do
+			}
+		});
+
+		GridDataFactory.fillDefaults().applyTo(browse);
+
+	}
+
+	public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+	}
+
+	public void initializeFrom(ILaunchConfiguration configuration) {
+		try {
+			modelfile.setText(configuration.getAttribute(FILE_NAME,
+					DEFAULT_FILE_NAME));
+
+		} catch (CoreException e) {
+			e.printStackTrace();
+		}
+	}
+
+	public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+		configuration.setAttribute(FILE_NAME, modelfile.getText());
+	}
+
+	@Override
+	public void dispose() {
+		image.dispose();
+		super.dispose();
+	}
+
+	public String getName() {
+		return "Main";
+	}
+
+	@Override
+	public Image getImage() {
+		return image;
+	}
+
+	@Override
+	public boolean isValid(ILaunchConfiguration launchConfig) {
+		setMessage(null);
+		setErrorMessage(null);
+		String model = this.modelfile.getText().trim();
+		if (model.length() > 0)
+			if (ResourcesPlugin.getWorkspace().getRoot().findMember(model) == null) {
+				setErrorMessage("file " + model + " does not exist!");
+				return false;
+			}
+
+		return super.isValid(launchConfig);
+	}
+
+	private class UpdateListener implements ModifyListener {
+
+		public void modifyText(ModifyEvent e) {
+			StatechartLaunchConfigurationTab.this
+					.updateLaunchConfigurationDialog();
+		}
+
+	}
+
+}

+ 33 - 0
plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/launch/tabs/StatechartLaunchConfigurationTabGroup.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.simulation.ui.launch.tabs;
+
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+
+/**
+ * 
+ * @author andreas muelder
+ * 
+ */
+public class StatechartLaunchConfigurationTabGroup extends
+		AbstractLaunchConfigurationTabGroup {
+
+	public StatechartLaunchConfigurationTabGroup() {
+	}
+
+	public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+		ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { new StatechartLaunchConfigurationTab() };
+		setTabs(tabs);
+	}
+
+}

+ 24 - 0
plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/view/ClassViewerFilter.java

@@ -0,0 +1,24 @@
+package org.yakindu.sct.simulation.ui.view;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class ClassViewerFilter extends ViewerFilter {
+
+	private final Class<?> clazz;
+
+	public ClassViewerFilter(Class<?> clazz) {
+		this.clazz = clazz;
+	}
+
+	@Override
+	public boolean select(Viewer viewer, Object parentElement, Object element) {
+		return clazz.isAssignableFrom(element.getClass());
+	}
+
+}

+ 259 - 0
plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/view/DeclarationView.java

@@ -0,0 +1,259 @@
+package org.yakindu.sct.simulation.ui.view;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.TableEditor;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.part.ViewPart;
+import org.yakindu.sct.model.sgraph.Declaration;
+import org.yakindu.sct.model.sgraph.Event;
+import org.yakindu.sct.model.sgraph.NamedElement;
+import org.yakindu.sct.model.sgraph.Transition;
+import org.yakindu.sct.model.sgraph.Variable;
+import org.yakindu.sct.model.sgraph.Vertex;
+import org.yakindu.sct.simulation.core.ISGraphSimulationSession;
+import org.yakindu.sct.simulation.core.ISimulationSessionListener;
+import org.yakindu.sct.simulation.core.SGraphSimulationSessionRegistry;
+
+import de.itemis.xtext.utils.jface.viewers.util.ActiveEditorResolver;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class DeclarationView extends ViewPart implements
+		ISimulationSessionListener {
+
+	private TableViewer eventViewer;
+
+	private TableViewer variableViewer;
+
+	private List<Control> controls;
+
+	public DeclarationView() {
+		SGraphSimulationSessionRegistry.INSTANCE.getListeners().add(this);
+	}
+
+	@Override
+	public void createPartControl(Composite parent) {
+		controls = new ArrayList<Control>();
+		parent.setLayout(new GridLayout(1, true));
+
+		eventViewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL
+				| SWT.V_SCROLL | SWT.FULL_SELECTION);
+		eventViewer.getTable().setLinesVisible(true);
+		eventViewer.getTable().setHeaderVisible(true);
+		createEventColumns(eventViewer);
+		eventViewer.setContentProvider(new ArrayContentProvider());
+		eventViewer.addFilter(new ClassViewerFilter(Event.class));
+		GridDataFactory.fillDefaults().grab(true, true)
+				.applyTo(eventViewer.getTable());
+
+		variableViewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL
+				| SWT.V_SCROLL | SWT.FULL_SELECTION);
+		variableViewer.getTable().setLinesVisible(true);
+		variableViewer.getTable().setHeaderVisible(true);
+		createVariableColumns(variableViewer);
+		variableViewer.setContentProvider(new ArrayContentProvider());
+		variableViewer.addFilter(new ClassViewerFilter(Variable.class));
+		GridDataFactory.fillDefaults().grab(true, true)
+				.applyTo(variableViewer.getTable());
+
+		setEventViewerInput(getViewerInput());
+	}
+
+	@Override
+	public void dispose() {
+		SGraphSimulationSessionRegistry.INSTANCE.getListeners().remove(this);
+		super.dispose();
+	}
+
+	private void createVariableColumns(TableViewer viewer) {
+		TableViewerColumn variableColumn = new TableViewerColumn(viewer,
+				SWT.NONE);
+		variableColumn.getColumn().setText("variable name");
+		variableColumn.getColumn().setWidth(120);
+		variableColumn.getColumn().setResizable(true);
+		variableColumn.getColumn().setMoveable(true);
+		variableColumn.setLabelProvider(new ColumnLabelProvider() {
+			@Override
+			public String getText(Object element) {
+				if (element instanceof NamedElement) {
+					return ((NamedElement) element).getName();
+				}
+				return super.getText(element);
+			}
+		});
+
+		TableViewerColumn valueColumn = new TableViewerColumn(viewer, SWT.NONE);
+		valueColumn.getColumn().setText("value");
+		valueColumn.getColumn().setWidth(120);
+		valueColumn.getColumn().setResizable(true);
+		valueColumn.getColumn().setMoveable(true);
+		valueColumn.setLabelProvider(new ColumnLabelProvider());
+	}
+
+	private void createEventColumns(final TableViewer viewer) {
+		TableViewerColumn eventColumn = new TableViewerColumn(viewer, SWT.NONE);
+		eventColumn.getColumn().setText("event name");
+		eventColumn.getColumn().setWidth(120);
+		eventColumn.getColumn().setResizable(true);
+		eventColumn.getColumn().setMoveable(true);
+		eventColumn.setLabelProvider(new ColumnLabelProvider() {
+			@Override
+			public String getText(Object element) {
+				if (element instanceof NamedElement) {
+					return ((NamedElement) element).getName();
+				}
+				return super.getText(element);
+			}
+		});
+
+		TableViewerColumn executeColumn = new TableViewerColumn(viewer,
+				SWT.NONE);
+		executeColumn.getColumn().setText("execute event");
+		executeColumn.getColumn().setWidth(120);
+		executeColumn.getColumn().setResizable(true);
+		executeColumn.getColumn().setMoveable(true);
+		executeColumn.setLabelProvider(new ColumnLabelProvider());
+
+	}
+
+	@Override
+	public void setFocus() {
+		eventViewer.getTable().setFocus();
+	}
+
+	public void setEventViewerInput(List<Declaration> events) {
+		eventViewer.setInput(events);
+		TableItem[] items = eventViewer.getTable().getItems();
+		for (TableItem tableItem : items) {
+			final TableEditor editor = new TableEditor(eventViewer.getTable());
+			editor.horizontalAlignment = SWT.LEFT;
+			editor.grabHorizontal = true;
+			editor.grabVertical = true;
+			Button button = new Button(eventViewer.getTable(), SWT.FLAT);
+			button.setText("raise");
+			button.addSelectionListener(new ButtonListener(tableItem.getText()));
+			editor.setEditor(button, tableItem, 1);
+			controls.add(button);
+		}
+	}
+
+	public void clearViewerInput() {
+		for (Control control : controls) {
+			control.dispose();
+		}
+		eventViewer.setInput(null);
+		variableViewer.setInput(null);
+	}
+
+	private static final class ButtonListener implements SelectionListener {
+
+		private final String eventName;
+
+		public ButtonListener(String eventName) {
+			this.eventName = eventName;
+		}
+
+		public void widgetSelected(SelectionEvent e) {
+			ISGraphSimulationSession activeSession = SGraphSimulationSessionRegistry.INSTANCE
+					.getActiveSession();
+			if (activeSession != null) {
+				activeSession.raiseEvent(eventName);
+			}
+
+		}
+
+		public void widgetDefaultSelected(SelectionEvent e) {
+			// Nothing to do
+		}
+
+	}
+
+	public static List<Declaration> getViewerInput() {
+		List<Declaration> declarations = new ArrayList<Declaration>();
+		Resource activeEditorResource = ActiveEditorResolver
+				.getActiveEditorResource();
+		if (activeEditorResource == null)
+			return Collections.emptyList();
+		TreeIterator<EObject> allContents = activeEditorResource
+				.getAllContents();
+		while (allContents.hasNext()) {
+			EObject next = allContents.next();
+			if (next instanceof Declaration) {
+				declarations.add((Declaration) next);
+			}
+		}
+		return declarations;
+
+	}
+
+	public void simulationStateChanged(SimulationState oldState,
+			SimulationState newState) {
+		switch (newState) {
+		case STARTED:
+			updateDeclarationView();
+			break;
+		case TERMINATED:
+			clearDeclarationView();
+			break;
+		}
+	}
+
+	public void variableValueChanged(String variableName, Object value) {
+		//TODO Implement Variable view
+	}
+
+	private void clearDeclarationView() {
+		Display.getDefault().asyncExec(new Runnable() {
+			public void run() {
+				clearViewerInput();
+			}
+		});
+	}
+
+	private void updateDeclarationView() {
+		Display.getDefault().asyncExec(new Runnable() {
+			public void run() {
+				setEventViewerInput(getViewerInput());
+			}
+		});
+	}
+
+	public void stateEntered(Vertex vertex) {
+		// Nothing to do
+	}
+
+	public void stateLeft(Vertex vertex) {
+		// Nothing to do
+	}
+
+	public void transitionFired(Transition transition) {
+		// Nothing to do
+	}
+
+	public void eventRaised(String eventName) {
+		// Nothing to do
+	}
+
+}