package de.prob2.ui.consoles.b;

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

import de.prob2.ui.consoles.Console;

@Singleton
public class BConsole extends Console {
	
	private BInterpreter interpreter;

	@Inject
	private BConsole(BInterpreter interpreter) {
		super();
		this.interpreter = interpreter;
		this.appendText("Prob 2.0 B Console \n >");
	}

	@Override
	protected void handleEnter() {
		super.handleEnterAbstract();
		String currentLine = getCurrentLine();
		if(currentLine.isEmpty()) {
			this.appendText("\nnull");
		} else {
			this.appendText("\n" + interpreter.exec(instructions.get(posInList)));
		}
		this.appendText("\n >");
		this.setEstimatedScrollY(Double.MAX_VALUE);
	}
	
}

@@ -132,16 +132,114 @@
 Console;
+%0Aimport de.prob2.ui.consoles.ConsoleExecResult;%0Aimport de.prob2.ui.consoles.ConsoleExecResultType;
 %0A%0A@Singl
@@ -664,30 +664,38 @@
 %0A%09%09%09
-this.appendText(%22%5Cn%22 +
+ConsoleExecResult execResult =
  int
@@ -740,38 +740,393 @@
 st))
-);%0A%09%09%7D%0A%09%09this.appendText(%22%5Cn %3E
+;%0A%09%09%09this.appendText(%22%5Cn%22 + execResult);%0A%09%09%09if(execResult.getResultType() == ConsoleExecResultType.ERROR) %7B%0A%09%09%09%09int begin = this.getText().length() - execResult.toString().length();%0A%09%09%09%09int end = this.getText().length();%0A%09%09%09%09this.setStyleClass(begin, end, %22error%22);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09this.appendText(%22%5Cn %3E%22);%0A%09%09this.setStyleClass(this.getText().length() - 2, this.getText().length(), %22current
 %22);%0A

Add error highlightening in B Console