sclass G22DatabasesPanel { G22Utils g22utils; Concepts concepts; JObjectTable table; *(G22Utils *g22utils, Concepts *concepts) {} record GazelleDB(S name, File dir) { simplyCached bool loaded() { ret sameFile(dir, concepts.conceptsDir()); } } visualize { table = swing(-> new JObjectTable); table.itemToMap = db -> litorderedmap( "Name" := db.name, "Directory" := f2s(db.dir), "Loaded" := db.loaded() ? "Yes" : "No" ); new L dbs; dbs.add(new GazelleDB("Legacy DB", programDir())); for (File dir : listDirsContainingFileNamed(g22utils.databasesMotherDir(), "concepts.structure.gz")) dbs.add(new GazelleDB(fileName(dir), dir)); table.setList(dbs); ret withTopAndBottomMargin(jCenteredRaisedSection("Gazelle Databases", centerAndEastWithMargins( table.visualize(), vstackWithSpacing( tableDependentButton(table, "Open"), tableDependentButton(table, "Delete"), toolTip("Create a new Gazelle database", jbutton("New...")), )))); } }