/**
* Refresh the selected catalog or catalog directory (reload, discarding
* any cached information)
*/
private void _refreshSelected() {
final Catalog selectedCatalog = getSelectedCatalog();
if (selectedCatalog == _rootCatDir) {
_reload();
return;
}
// Run in a background thread, since it can hang
new SwingWorker() {
public Object construct() {
try {
return selectedCatalog.reload();
} catch (Exception e) {
return e;
}
}
public void finished() {
Object o = getValue();
if (o instanceof Catalog) {
Catalog cat = (Catalog) o;
selectedCatalog.getParent().replaceCatalog(selectedCatalog, cat);
setQueryResult(_rootCatDir);
setSelectedCatalog(cat, false);
} else if (o instanceof Exception) {
DialogUtil.error((Exception) o);