package de.prob2.ui.consoles.b;

import java.io.File;
import java.util.ResourceBundle;

import com.google.inject.Inject;
import com.google.inject.Singleton;

import de.prob2.ui.consoles.Console;
import de.prob2.ui.prob2fx.CurrentTrace;

@Singleton
public final class BConsole extends Console {
	@Inject
	private BConsole(BInterpreter bInterpreter, ResourceBundle bundle, CurrentTrace currentTrace) {
		super(bundle, bundle.getString("consoles.b.header"), bundle.getString("consoles.b.prompt.classicalB"), bInterpreter);
		
		currentTrace.addListener((o, from, to) -> {
			final String message;
			if (to == null) {
				message = bundle.getString("consoles.b.message.modelUnloaded");
			} else {
				final File modelFile = to.getStateSpace().getModel().getModelFile();
				final String name = modelFile == null ? to.getStateSpace().getMainComponent().toString() : modelFile.getName();
				message = String.format(bundle.getString("consoles.b.message.modelLoaded"), name);
			}
			this.insertText(this.getLineNumber(), 0, message + '\n');
			this.requestFollowCaret();
		});
	}
}

@@ -531,16 +531,37 @@
 ntTrace.
+stateSpaceProperty().
 addListe
@@ -739,32 +739,16 @@
 le = to.
-getStateSpace().
 getModel
@@ -817,24 +817,8 @@
  to.
-getStateSpace().
 getM

Fix "Model loaded" messages appearing when animating