srecord noeq G22VariablesPanel is Swingable { settable G22Utils g22utils; settable bool compactView; settable double updateInterval = 1.0; transient SimpleCRUD_v2 crud; transient SingleComponentPanel scpDetail; transient ReliableSingleThread rstUpdateDetail = rst(l0 _updateDetail); SimpleCRUD_v2 crud() { if (crud == null) { crud = new SimpleCRUD_v2<>(g22utils.concepts(), G22Variable); crud.updateInterval(updateInterval); } ret crud; } cachedVisualize { crud().iconButtons(true); crud.entityName = -> "Variable"; crud.renderValue = l1 strOrNull; // no huge images (e.g. live feed) in variables table - too slow! //if (compactView) crud.hideField("persistent"); var vis = jCenteredSection("Project Variables", crud.visualize()); if (compactView) ret vis; crud.onSingleSelectionChanged(-> { print("Selection: " + crud.selected(); rstUpdateDetail!; }); scpDetail = scp(); ret jvsplit(vis, scpDetail); } void updateCount { crud().update(); } void setSelected(G22Variable var) { crud().setSelected(var); } void _updateDetail { var var = crud.selected(); if (var == null) ret with scpDetail.clear(); O value = var.value(); var vis = new G22JavaObjectVisualizer(g22utils, value).visualize(); bindChangeListenerToComponent(vis, var.varValue(), -> { if (!eq(var.value(), value)) rstUpdateDetail!; }); scpDetail.set(jCenteredSection("Variable " + var.name, vis)); } }