abstract sclass ELESuggester > DynSCP { start-thread { ele_onInputAndNow(lambda1 process); dm_registerAs eleSuggester(); } Pt minimumSize() { ret pt(300, 300); } // override me void process_impl(S input) {} void process(S input) q { process_impl(input); } void showSuggestions(S madeFromInput, Iterable l) { setComponent(jscroll_trackWidth(vstackWithSpacing(map(l, s -> { JComponent c = withSideMargin(jLabelWithButtons(s, "+", rThread { logFeedback(true, s, madeFromInput) }, "-", rThread { logFeedback(false, s, madeFromInput) }, "Say", rThread { logFeedback(true, s, madeFromInput, button := "Say"); dm_say(s) }, "Submit", rThread { logFeedback(true, s, madeFromInput, button := "Submit"); dm_setAIBarTextAndFireWithInfo(s, "user-chosen in " + dm_moduleLibID()); })); setToolTip(findButton(c, "Submit"), "Submit as new input"); ret c; })))); } void logFeedback(bool plus, S item, S madeFromInput, O... _) { ele_logUserFeedback(plus, paramsPlus_inFront(_, +item, moduleID := dm_moduleSnippetID(), moduleName := dm_moduleName(), +madeFromInput)); } }