!7 srecord Entry(S text, S annotations, S guess) { LS annotations() { ret tok_splitAtComma_emptyOnEmpty(annotations); } } /*c*/module QuickAnnotator > DynObjectTable { start { addCountToName(); } afterVisualize { tablePopupMenuItemAndDoubleClick(table, "Edit annotations...", voidfunc(int row) { Entry e = getRow(row); if (e == null) ret; JTextField tf = jTextField(e.annotations); showFormTitled("Edit annotations", "Line", e.text, "Annotations (comma-separated)", tf, r { e.annotations = gtt(tf); fireDataChanged(); }); }); } IntRange visibleRows() { ret jTable_visibleRows(table); } // API void fillData(Collection l) { setList(map(l, p -> nu Entry(text := p.a, annotations := p.b))); } void fillData(SS map) { fillData(mapToPairs(map)); } void setItems(Collection l) { fillData(map(l, s -> pair(s, ""))); } Set allAnnotations() { Set set = ciSet(); for (Entry e : data()) _addAll(set, e.annotations()); ret set; } }