mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-08 18:30:42 +00:00
navigate to startpage when empty term is entered
This commit is contained in:
parent
7a689d12a9
commit
d4a6acbc07
@ -94,6 +94,11 @@ public class MainViewImpl extends AppLayout
|
|||||||
|
|
||||||
private void setTermInURL(Pair<String, Map<String, String>> lambdaTermAndAssumptions) {
|
private void setTermInURL(Pair<String, Map<String, String>> lambdaTermAndAssumptions) {
|
||||||
String lambdaTerm = lambdaTermAndAssumptions.getLeft();
|
String lambdaTerm = lambdaTermAndAssumptions.getLeft();
|
||||||
|
if ("".equals(lambdaTerm)) {
|
||||||
|
UI.getCurrent().getPage().getHistory().pushState(null, new Location(""));
|
||||||
|
setContent(new StartPageView());
|
||||||
|
return;
|
||||||
|
}
|
||||||
StringBuilder types = new StringBuilder();
|
StringBuilder types = new StringBuilder();
|
||||||
for (Map.Entry<String, String> type : lambdaTermAndAssumptions.getRight().entrySet()) {
|
for (Map.Entry<String, String> type : lambdaTermAndAssumptions.getRight().entrySet()) {
|
||||||
if (types.length() > 0) {
|
if (types.length() > 0) {
|
||||||
|
@ -69,8 +69,10 @@ public class UpperBar extends HorizontalLayout {
|
|||||||
*/
|
*/
|
||||||
protected void typeInfer(Pair<String, Map<String, String>> termAndAssumptions) {
|
protected void typeInfer(Pair<String, Map<String, String>> termAndAssumptions) {
|
||||||
setTermInURL.accept(termAndAssumptions);
|
setTermInURL.accept(termAndAssumptions);
|
||||||
|
if (!"".equals(termAndAssumptions.getLeft())) {
|
||||||
startInfer(termAndAssumptions.getLeft(), termAndAssumptions.getRight());
|
startInfer(termAndAssumptions.getLeft(), termAndAssumptions.getRight());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void startInfer(String term, Map<String, String> typeAssumptions) {
|
private void startInfer(String term, Map<String, String> typeAssumptions) {
|
||||||
presenter.typeInferLambdaString(term, typeAssumptions);
|
presenter.typeInferLambdaString(term, typeAssumptions);
|
||||||
|
Loading…
Reference in New Issue
Block a user