try
{
SimulationEngine.eclipseEnvironment = true;
final SimulationEngine engine = getEngine();
UIJob listeners = new UIJob("Set Listeners")
{
@Override
public IStatus runInUIThread(IProgressMonitor monitor)
{
final String engineViewId = IDebugConstants.ENGINE_VIEW_ID;
final InfoTableView engineView = getInfoTableView(engineViewId);
views.add(engineView);
engine.engineListeners.add(new EngineListener(engineView));
if (showDebugInfo)
{
final String messageViewId = IDebugConstants.MESSAGE_VIEW_ID;
final String simulationViewId = IDebugConstants.SIMULATION_VIEW_ID;
final InfoTableView messageView = getInfoTableView(messageViewId);
final InfoTableView simulationView = getInfoTableView(simulationViewId);
views.add(messageView);
views.add(simulationView);
engine.messageListeners.add(new MessageListener(messageView));
engine.simulationListeners.add(new SimulationListener(simulationView));
for (InfoTableView view : views)
{
view.refreshPackTable();
}
}
return new Status(IStatus.OK, IDebugConstants.PLUGIN_ID, "Listeners OK");
}
};
listeners.schedule();
if (enableLogging)
{
engine.engineListeners.add(log);
engine.messageListeners.add(log);
engine.simulationListeners.add(log);