Commit d6cad329 authored by Hernan Ponce de Leon's avatar Hernan Ponce de Leon
Browse files

[YELLOW]

refs 3344
parent 38f627b5
CustomSimulationViewBase.java 09a8122cd68e62f4766e31c76192e3efa7108c59 GREEN
SimulationViewBase.java 25ab19587f78b7e9bb90a50d691396f6670c6040 GREEN
SimulationViewBase.java 3d6e5836e1f91f88e4a5ebf3658cd60081046138 YELLOW
......@@ -15,6 +15,7 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.simulator.views;
import static java.lang.Integer.parseInt;
import static org.fortiss.af3.component.ui.simulator.SimulationManager.INSTANCE;
import static org.fortiss.af3.component.ui.simulator.SimulationManager.SIMULATED_COMPONENT_CHANGED_EVENT;
import static org.fortiss.af3.component.ui.simulator.SimulationManager.SIMULATION_ABOUT_TO_PERFORM_EVENT;
......@@ -23,6 +24,7 @@ import static org.fortiss.af3.component.ui.simulator.SimulationManager.SIMULATIO
import static org.fortiss.af3.component.ui.simulator.SimulationManager.SIMULATION_PERFORMED_EVENT;
import static org.fortiss.af3.component.ui.simulator.SimulationManager.SIMULATION_REFRESH_EVENT;
import static org.fortiss.af3.component.ui.simulator.SimulationManager.SIMULATION_STEPPED_BACK_EVENT;
import static org.fortiss.tooling.kernel.utils.LoggingUtils.error;
import org.eclipse.ui.IPropertyListener;
import org.eclipse.ui.IViewSite;
......@@ -32,7 +34,6 @@ import org.fortiss.af3.component.AF3ComponentActivator;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.simulator.ExecutableComponent;
import org.fortiss.af3.component.ui.simulator.SimulationManager;
import org.fortiss.tooling.kernel.utils.LoggingUtils;
/**
* Base implementation of simulation views. Sub-classes may call {@link #postRefreshEventToViews()}
......@@ -58,10 +59,11 @@ public abstract class SimulationViewBase extends ViewPart implements IPropertyLi
@Override
public void init(IViewSite site) throws PartInitException {
super.init(site);
try {
elementId = Integer.parseInt(site.getSecondaryId());
} catch(NumberFormatException e) {
LoggingUtils.error(AF3ComponentActivator.getDefault(), "Parsing error", e);
String secID = site.getSecondaryId();
if(secID != null) {
elementId = parseInt(site.getSecondaryId());
} else {
error(AF3ComponentActivator.getDefault(), "Parsing error");
elementId = -1;
}
executable = INSTANCE.findExecutableById(getElementID());
......
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