use of org.jkiss.dbeaver.model.impl.jdbc.struct.JDBCTable in project dbeaver by serge-rider.
the class PostgreBackupWizardPageObjects method loadTables.
private void loadTables(final PostgreSchema catalog) {
if (catalog != null) {
curSchema = catalog;
}
if (curSchema == null) {
return;
}
final boolean isCatalogChecked = isChecked(curSchema);
final Set<PostgreTableBase> checkedObjects = this.checkedObjects.get(curSchema);
new AbstractJob("Load '" + curSchema.getName() + "' tables") {
{
setUser(true);
}
@Override
protected IStatus run(DBRProgressMonitor monitor) {
monitor.beginTask("Collect tables", 1);
try {
monitor.subTask("Collect tables to dump");
final List<PostgreTableBase> objects = new ArrayList<>();
for (JDBCTable table : curSchema.getTables(monitor)) {
if (table instanceof PostgreTableBase) {
objects.add((PostgreTableBase) table);
}
}
if (wizard.getSettings().isShowViews()) {
objects.addAll(curSchema.getViews(monitor));
}
objects.sort(DBUtils.nameComparator());
UIUtils.syncExec(() -> {
tablesTable.removeAll();
for (PostgreTableBase table : objects) {
TableItem item = new TableItem(tablesTable, SWT.NONE);
item.setImage(DBeaverIcons.getImage(table.isView() ? DBIcon.TREE_VIEW : DBIcon.TREE_TABLE));
item.setText(0, table.getName());
item.setData(table);
item.setChecked(isCatalogChecked && (checkedObjects == null || checkedObjects.contains(table)));
}
});
} catch (DBException e) {
DBWorkbench.getPlatformUI().showError("Table list", "Can't read table list", e);
} finally {
monitor.done();
}
return Status.OK_STATUS;
}
}.schedule();
}
use of org.jkiss.dbeaver.model.impl.jdbc.struct.JDBCTable in project dbeaver by dbeaver.
the class PostgreBackupWizardPageObjects method loadTables.
private void loadTables(final PostgreSchema catalog) {
if (catalog != null) {
curSchema = catalog;
}
if (curSchema == null) {
return;
}
final boolean isCatalogChecked = isChecked(curSchema);
final Set<PostgreTableBase> checkedObjects = this.checkedObjects.get(curSchema);
new AbstractJob("Load '" + curSchema.getName() + "' tables") {
{
setUser(true);
}
@Override
protected IStatus run(DBRProgressMonitor monitor) {
monitor.beginTask("Collect tables", 1);
try {
monitor.subTask("Collect tables to dump");
final List<PostgreTableBase> objects = new ArrayList<>();
for (JDBCTable table : curSchema.getTables(monitor)) {
if (table instanceof PostgreTableBase) {
objects.add((PostgreTableBase) table);
}
}
if (wizard.getSettings().isShowViews()) {
objects.addAll(curSchema.getViews(monitor));
}
objects.sort(DBUtils.nameComparator());
UIUtils.syncExec(() -> {
tablesTable.removeAll();
for (PostgreTableBase table : objects) {
TableItem item = new TableItem(tablesTable, SWT.NONE);
item.setImage(DBeaverIcons.getImage(table.isView() ? DBIcon.TREE_VIEW : DBIcon.TREE_TABLE));
item.setText(0, table.getName());
item.setData(table);
item.setChecked(isCatalogChecked && (checkedObjects == null || checkedObjects.contains(table)));
}
});
} catch (DBException e) {
DBWorkbench.getPlatformUI().showError("Table list", "Can't read table list", e);
} finally {
monitor.done();
}
return Status.OK_STATUS;
}
}.schedule();
}
Aggregations