// optional parameter sayAction: IVF1 // optional parameter submitAction: IVF1 static JComponent ele_renderSuggestions(S madeFromInput, Iterable suggestions, O... _) { optPar IVF1 sayAction; optPar IVF1 submitAction; ret scrollableStackWithSpacing(map(takeFirst(100, suggestions), s -> { JComponent c = jLabelWithButtonsAndSideMargin(s, "+", rThread { ele_logItemFeedback(true, s, madeFromInput) }, "-", rThread { ele_logItemFeedback(false, s, madeFromInput) }, "Submit", rThread { ele_logItemFeedback(true, s, madeFromInput, button := "Submit"); if (submitAction != null) submitAction.get(s); else dm_setAIBarTextAndFireWithInfo(s, "user-chosen in " + dm_moduleLibID()); }, "Say", rThread { ele_logItemFeedback(true, s, madeFromInput, button := "Say"); callF(or(sayAction, lambda1 dm_say), s); }); setToolTip(findButton(c, "Submit"), "Submit as new input"); ret c; })); }