1 package jalview.ws2.gui;
4 import java.util.concurrent.CompletionStage;
6 import javax.swing.JMenu;
8 import jalview.gui.AlignFrame;
9 import jalview.gui.WsJobParameters;
10 import jalview.util.MessageManager;
11 import jalview.ws.params.ArgumentI;
12 import jalview.ws.params.ParamDatastoreI;
13 import jalview.ws.params.WsParamSetI;
16 * Functional interface provided by {@link jalview.ws2.operations.Operation}
17 * instances to construct the menu entry for the operations. The instances are
18 * passed to the {@link jalview.gui.WebServicesMenuBuilder} and called during
24 public interface MenuEntryProviderI
27 * Build menu entries directly under the given menu. This method is called by
28 * {@link jalview.gui.WebServicesMenuBuilder} during menu construction.
35 public void buildMenu(JMenu parent, AlignFrame frame);
37 static CompletionStage<List<ArgumentI>> openEditParamsDialog(
38 ParamDatastoreI paramStore, WsParamSetI preset,
39 List<ArgumentI> arguments)
41 WsJobParameters jobParams;
42 if (preset == null && arguments != null && arguments.size() > 0)
43 jobParams = new WsJobParameters(paramStore, preset, arguments);
45 jobParams = new WsJobParameters(paramStore, preset, null);
48 jobParams.setName(MessageManager.getString(
49 "label.adjusting_parameters_for_calculation"));
51 var stage = jobParams.showRunDialog();
52 return stage.thenApply((startJob) -> {
55 if (jobParams.getPreset() == null)
57 return jobParams.getJobParams();
61 return jobParams.getPreset().getArguments();