1 package org.simantics.sysdyn.ui.handlers.simulationPlayback;
\r
3 import org.eclipse.core.commands.AbstractHandler;
\r
4 import org.eclipse.core.commands.ExecutionEvent;
\r
5 import org.eclipse.core.commands.ExecutionException;
\r
6 import org.simantics.simulation.experiment.IExperiment;
\r
7 import org.simantics.simulation.project.IExperimentManager;
\r
8 import org.simantics.sysdyn.manager.SysdynPlaybackExperiment;
\r
9 import org.simantics.sysdyn.ui.utils.HandlerUtils;
\r
10 import org.simantics.ui.SimanticsUI;
\r
12 public class PlaybackReloadHandler extends AbstractHandler {
\r
15 public Object execute(ExecutionEvent event) throws ExecutionException {
\r
16 HandlerUtils.saveBeforeExperimentRun(event);
\r
18 IExperimentManager manager = SimanticsUI.getProject().getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);
\r
19 IExperiment experiment = manager.getActiveExperiment();
\r
20 if(experiment == null || !(experiment instanceof SysdynPlaybackExperiment))
\r
22 SysdynPlaybackExperiment spe = (SysdynPlaybackExperiment)experiment;
\r