!7 sclass Entry { S listName; bool selected; *() {} *(S *listName) {} } module MechListsSelector > DynObjectTable { transient JTextArea taDetail; start { dm_useLocalMechListCopies(); set withSearcher; } visualize { if (empty(data)) addLists(mechListNames()); // TODO: update later JComponent c = super.visualize(); onTableSelectionChanged(table(), r { if (selected() == null) clearTextAndDisable(taDetail); else setTextAndEnable(taDetail, mL_raw(selected().listName)); }); onTableCellLeftClick(table(), voidfunc(int col, int row) { if (tableColumnNameIs(table(), col, "Selected")) { data.get(row).selected = !data.get(row).selected; fireDataChanged(); } }); ret jhsplit(c, taDetail = wordWrapTypeWriterTextArea(), 0.3); } // API void addLists(Collection names) { L l = cloneList(data); Map index = indexByFieldCI name(l); for (S name : unnull(names)) if (!index.containsKey(name)) l.add(Entry(name)); setData(sortedByFieldIC name(l)); } }