// metadata about the datastore (might take several seconds)
new SwingWorker<SchemaTree, Void>() {
@Override
protected SchemaTree doInBackground() throws Exception {
Injector injector = _injectorBuilder.with(Datastore.class, datastore).createInjector();
SchemaTree tree = injector.getInstance(SchemaTree.class);
return tree;
}
protected void done() {
try {
SchemaTree schemaTree = get();
final JScrollPane schemaTreeScroll = WidgetUtils.scrolleable(schemaTree);
schemaTreeScroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
schemaTree.addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
updateParentPanel();
}
});
removeAll();
add(schemaTreeScroll, BorderLayout.CENTER);
updateParentPanel();
if (expandTree) {
schemaTree.expandAll();
}
} catch (Exception e) {
throw new RuntimeException(e);
}
};