!7 concept Grouping { S text, grouped; } cmodule Groupings > DynCRUD { start { dbIndexingCI(Grouping, 'text); } afterVisualize { replaceComponent(crud.tableSearcher.tfInput, func(JComponent c) -> JComponent { centerAndEastWithMargin(c, jbutton("Group...", rThread { define(searchTerm()) })) }); onEnter(crud.tableSearcher.tfInput, rThread { define(searchTerm()) }); } void define(fS text) enter { final JTextField tfText = jtextfield(or2(text, dm_topInput())), tfGrouped = jtextfield(); showFormTitled("Add Grouping", "Text:", tfText, "Grouped:", tfGrouped, rThread { S text = gtt(tfText), grouped = gtt(tfGrouped); if (empty(text)) text = tok_dropCurlyBrackets(grouped); uniq_sync(Grouping, +text, +grouped); }); focus(nempty(text) ? tfGrouped : tfText); } // API void addGroupingInput(S text) { if (nempty(text = trim(text))) uniqCI_sync Grouping(+text); } }