From c6eb7940499b81ff6fccd7df5961f60ad69aff02 Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Sat, 13 Feb 2021 10:11:48 +0100 Subject: [PATCH] Focus new type assumption field --- .../edu/kit/typicalc/view/main/TypeAssumptionField.java | 7 +++++++ .../edu/kit/typicalc/view/main/TypeAssumptionsArea.java | 1 + 2 files changed, 8 insertions(+) diff --git a/src/main/java/edu/kit/typicalc/view/main/TypeAssumptionField.java b/src/main/java/edu/kit/typicalc/view/main/TypeAssumptionField.java index 333c3c8..b726960 100644 --- a/src/main/java/edu/kit/typicalc/view/main/TypeAssumptionField.java +++ b/src/main/java/edu/kit/typicalc/view/main/TypeAssumptionField.java @@ -62,6 +62,13 @@ public class TypeAssumptionField extends HorizontalLayout implements LocaleChang setId(ASSUMPTIONS_FIELD_ID); } + /** + * Focus the variable field of this element. + */ + protected void focus() { + variableInputField.focus(); + } + /** * Gets the variable of the type assumption. * diff --git a/src/main/java/edu/kit/typicalc/view/main/TypeAssumptionsArea.java b/src/main/java/edu/kit/typicalc/view/main/TypeAssumptionsArea.java index 565250b..3c28a63 100644 --- a/src/main/java/edu/kit/typicalc/view/main/TypeAssumptionsArea.java +++ b/src/main/java/edu/kit/typicalc/view/main/TypeAssumptionsArea.java @@ -94,6 +94,7 @@ public class TypeAssumptionsArea extends Dialog implements LocaleChangeObserver }); assumptionContainer.add(assumption); fields.add(assumption); + assumption.focus(); } private void onDeleteAllClick() {