From 9a5c8af21bd813e0c62ffcd7e4c0c3e2c33b9947 Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Thu, 21 Oct 2021 17:02:47 +0200 Subject: [PATCH] JAL-3878 Make interactive service arguments persistent between starts. --- src/jalview/ws2/operations/AnnotationOperation.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/jalview/ws2/operations/AnnotationOperation.java b/src/jalview/ws2/operations/AnnotationOperation.java index 884d327..55ed03b 100644 --- a/src/jalview/ws2/operations/AnnotationOperation.java +++ b/src/jalview/ws2/operations/AnnotationOperation.java @@ -1,5 +1,6 @@ package jalview.ws2.operations; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.concurrent.CompletionStage; @@ -188,6 +189,7 @@ public class AnnotationOperation implements Operation { final var calcName = service.getName(); final var calcManager = frame.getViewport().getCalcManager(); + final var arguments = new ArrayList(); final JCheckBoxMenuItem runItem; { // TODO use MessageManager and set tool tip text @@ -195,7 +197,7 @@ public class AnnotationOperation implements Operation String.format("%s calculations", calcName)); runItem.addActionListener((event) -> { calcManager.removeWorkersForName(calcName); - var worker = createWorker(Collections.emptyList(), frame, calcManager); + var worker = createWorker(arguments, frame, calcManager); calcManager.registerWorker(worker); }); parent.add(runItem); @@ -208,9 +210,11 @@ public class AnnotationOperation implements Operation String.format("Edit %s settings", calcName)); _editItem.addActionListener((event) -> { openEditParamsDialog(service, null, null) - .thenAcceptAsync((arguments) -> { + .thenAcceptAsync((args) -> { if (arguments != null) { + arguments.clear(); + arguments.addAll(args); calcManager.removeWorkersForName(calcName); var worker = createWorker(arguments, frame, calcManager); calcManager.registerWorker(worker); -- 1.7.10.2