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"); crud.itemToMap_inner2 = var -> { var map = crud.itemToMap_inner2_base(var); if (var.big()) map.put("Size on disk" := str_toKB(var.bigFile())); ret map; }; var vis = jCenteredSection("Project Variables", crud.visualize()); var cbPauseUpdates = jCheckBox("Pause updates"); onChange(cbPauseUpdates, -> crud.pauseUpdates(isChecked(cbPauseUpdates))); crud.addButton(cbPauseUpdates); IVF1 rUpdate = v -> crud.update(); bindToComponent(vis, -> g22utils.onBigVariableLoaded(rUpdate), -> g22utils.removeBigVariableLoadedListener(rUpdate)); if (compactView) ret vis; crud.onSingleSelectionChanged(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)); } }