fix that examples are now visualized on click

This commit is contained in:
ucrhh 2021-03-05 20:42:26 +01:00
parent f1df0fee45
commit e658060fd1

View File

@ -108,10 +108,14 @@ public class InputBar extends HorizontalLayout implements LocaleChangeObserver {
typeAssumptionsArea = new TypeAssumptionsArea(typeAssumptions); typeAssumptionsArea = new TypeAssumptionsArea(typeAssumptions);
} }
protected void setTermAndClickTypeInfer(String term) {
setTerm(term);
onTypeInferButtonClick();
}
private void onTypeInferButtonClick() { private void onTypeInferButtonClick() {
String currentInput = inputField.getOptionalValue().orElse(StringUtils.EMPTY); String currentInput = inputField.getOptionalValue().orElse(StringUtils.EMPTY);
inputField.blur(); inputField.blur();
callback.accept(Pair.of(currentInput, typeAssumptionsArea.getTypeAssumptions())); callback.accept(Pair.of(currentInput, typeAssumptionsArea.getTypeAssumptions()));
} }
@ -120,7 +124,7 @@ public class InputBar extends HorizontalLayout implements LocaleChangeObserver {
} }
private void onExampleButtonClick() { private void onExampleButtonClick() {
Dialog exampleDialog = new ExampleDialog(this::setTerm); Dialog exampleDialog = new ExampleDialog(this::setTermAndClickTypeInfer);
exampleDialog.open(); exampleDialog.open();
} }