sclass SavedSessions extends Module { SS sessions = synchroMap(); // TODO: notifyingMap(rSetVarToTrue(changed)); transient JTable table; transient new Var changed; svoid triggerUpdate { changed.set(true); super.triggerUpdate(); } JComponent visualize() { table = sexyTable(); triggerUpdate(); ret centerAndSouthWithMargins(table, jbutton("Save session", r { fS text = struct(ll(programID(), localDateWithMilliseconds())) + "\n" + mainConcepts.xfullgrab(); inputText("Save session as", voidfunc(S name) { sessions.put(or2(trim(name), "Unnamed Session") + " [" + localDateWithSeconds() + ", " + computerID() + ", OS: " + programID() + "]", text); triggerUpdate(); }); })); } void unvisualize2() { table = null; } void update() { if (atomicFlipVarToFalse(changed)) dataToTable_uneditable(table, listToMapsWithSingleKey("Session Name", sortedKeys(sessions))); } }