From eb33ce11bf05ef8d44642a8012d9ced4f0d9549e Mon Sep 17 00:00:00 2001 From: Moritz Dieing <63721811+moritzdieing@users.noreply.github.com> Date: Wed, 17 Feb 2021 17:36:17 +0100 Subject: [PATCH] Fix pipeline --- .../view/main/TypeAssumptionsArea.java | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) 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 7f8fca3..c86b616 100644 --- a/src/main/java/edu/kit/typicalc/view/main/TypeAssumptionsArea.java +++ b/src/main/java/edu/kit/typicalc/view/main/TypeAssumptionsArea.java @@ -69,16 +69,8 @@ public class TypeAssumptionsArea extends Dialog implements LocaleChangeObserver assumptionContainer = new VerticalLayout(); assumptionContainer.setId(ASS_CONTAINER_ID); - - for (Map.Entry param : types.entrySet()) { - TypeAssumptionField assumption = new TypeAssumptionField(value -> { - assumptionContainer.remove(value); - fields.remove(value); - }, param.getKey(), param.getValue()); - assumptionContainer.add(assumption); - fields.add(assumption); - } - + + initializeWithAssumptions(types); layout.add(heading, buttons, assumptionContainer); add(layout); setCloseOnOutsideClick(false); @@ -90,6 +82,17 @@ public class TypeAssumptionsArea extends Dialog implements LocaleChangeObserver protected TypeAssumptionsArea() { this(new HashMap<>()); } + + private void initializeWithAssumptions(Map types) { + for (Map.Entry param : types.entrySet()) { + TypeAssumptionField assumption = new TypeAssumptionField(value -> { + assumptionContainer.remove(value); + fields.remove(value); + }, param.getKey(), param.getValue()); + assumptionContainer.add(assumption); + fields.add(assumption); + } + } private void onAddAssumptionClicked() { TypeAssumptionField assumption = new TypeAssumptionField(value -> {