mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-08 18:30:42 +00:00
Set title in presenter
This commit is contained in:
parent
37b3be5066
commit
50a5662837
@ -2,6 +2,7 @@ package edu.kit.typicalc.presenter;
|
|||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.vaadin.flow.component.UI;
|
||||||
import edu.kit.typicalc.model.Model;
|
import edu.kit.typicalc.model.Model;
|
||||||
import edu.kit.typicalc.model.TypeInfererInterface;
|
import edu.kit.typicalc.model.TypeInfererInterface;
|
||||||
import edu.kit.typicalc.model.parser.ParseError;
|
import edu.kit.typicalc.model.parser.ParseError;
|
||||||
@ -30,6 +31,11 @@ public class Presenter implements MainViewListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void typeInferLambdaString(String lambdaTerm, Map<String, String> typeAssumptions) {
|
public void typeInferLambdaString(String lambdaTerm, Map<String, String> typeAssumptions) {
|
||||||
|
if (lambdaTerm.isBlank()) {
|
||||||
|
UI.getCurrent().getPage().setTitle(UI.getCurrent().getTranslation("root.typicalc"));
|
||||||
|
} else {
|
||||||
|
UI.getCurrent().getPage().setTitle(UI.getCurrent().getTranslation("root.typicalc") + " - " + lambdaTerm);
|
||||||
|
}
|
||||||
Result<TypeInfererInterface, ParseError> result = model.getTypeInferer(lambdaTerm, typeAssumptions);
|
Result<TypeInfererInterface, ParseError> result = model.getTypeInferer(lambdaTerm, typeAssumptions);
|
||||||
if (result.isError()) {
|
if (result.isError()) {
|
||||||
view.displayError(result.unwrapError());
|
view.displayError(result.unwrapError());
|
||||||
|
Loading…
Reference in New Issue
Block a user