From 1ee86c5c320f72cde0741debd2224660d32bb476 Mon Sep 17 00:00:00 2001 From: ucrhh Date: Thu, 11 Mar 2021 00:41:08 +0100 Subject: [PATCH] fix checkstyle --- .../typeinferencecontent/ShareDialog.java | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/main/java/edu/kit/typicalc/view/content/typeinferencecontent/ShareDialog.java b/src/main/java/edu/kit/typicalc/view/content/typeinferencecontent/ShareDialog.java index 3da466e..0735db5 100644 --- a/src/main/java/edu/kit/typicalc/view/content/typeinferencecontent/ShareDialog.java +++ b/src/main/java/edu/kit/typicalc/view/content/typeinferencecontent/ShareDialog.java @@ -67,18 +67,8 @@ public class ShareDialog extends Dialog implements LocaleChangeObserver { latexAreaTree = new TextArea(); packageAreaUnification = new TextArea(); latexAreaUnification = new TextArea(); + initializeFields(url, latexCodeTree, latexCodeUnification); - urlField.setValue(url); - urlField.setClassName(FIELD_CLASS); - packageAreaTree.setValue(getTranslation("share.neededPackagesTree")); //todo - packageAreaTree.setClassName(FIELD_CLASS); - packageAreaUnification.setValue(getTranslation("share.neededPackagesUnification")); //todo - packageAreaUnification.setClassName(FIELD_CLASS); - latexAreaTree.setValue(latexCodeTree); - latexAreaTree.setClassName(FIELD_CLASS); - latexAreaUnification.setValue(latexCodeUnification - .replaceAll(Pattern.quote(LatexCreatorConstants.SUBSTITUTION_SIGN), RIGHT_ARROW_WHITE)); - latexAreaUnification.setClassName(FIELD_CLASS); UI.getCurrent().getPage().executeJs("window.autoSelect($0)", FIELD_CLASS); setReadOnly(); @@ -88,6 +78,20 @@ public class ShareDialog extends Dialog implements LocaleChangeObserver { add(headingLayout, layout); } + private void initializeFields(String url, String latexCodeTree, String latexCodeUnification) { + urlField.setValue(url); + urlField.setClassName(FIELD_CLASS); + packageAreaTree.setValue(getTranslation("share.neededPackagesTree")); + packageAreaTree.setClassName(FIELD_CLASS); + packageAreaUnification.setValue(getTranslation("share.neededPackagesUnification")); + packageAreaUnification.setClassName(FIELD_CLASS); + latexAreaTree.setValue(latexCodeTree); + latexAreaTree.setClassName(FIELD_CLASS); + latexAreaUnification.setValue(latexCodeUnification + .replaceAll(Pattern.quote(LatexCreatorConstants.SUBSTITUTION_SIGN), RIGHT_ARROW_WHITE)); + latexAreaUnification.setClassName(FIELD_CLASS); + } + @Override public void localeChange(LocaleChangeEvent localeChangeEvent) {