use of org.jkiss.dbeaver.ext.mysql.tasks.MySQLDatabaseExportInfo in project dbeaver by serge-rider.
the class MySQLExportWizardPageObjects method saveState.
public void saveState() {
List<MySQLDatabaseExportInfo> objects = wizard.getSettings().getExportObjects();
objects.clear();
for (TableItem item : catalogTable.getItems()) {
if (item.getChecked()) {
MySQLCatalog catalog = (MySQLCatalog) item.getData();
MySQLDatabaseExportInfo info = new MySQLDatabaseExportInfo(catalog, checkedObjects.get(catalog));
objects.add(info);
}
}
}
use of org.jkiss.dbeaver.ext.mysql.tasks.MySQLDatabaseExportInfo in project dbeaver by dbeaver.
the class MySQLExportWizardPageObjects method saveState.
public void saveState() {
List<MySQLDatabaseExportInfo> objects = wizard.getSettings().getExportObjects();
objects.clear();
for (TableItem item : catalogTable.getItems()) {
if (item.getChecked()) {
MySQLCatalog catalog = (MySQLCatalog) item.getData();
MySQLDatabaseExportInfo info = new MySQLDatabaseExportInfo(catalog, checkedObjects.get(catalog));
objects.add(info);
}
}
}
use of org.jkiss.dbeaver.ext.mysql.tasks.MySQLDatabaseExportInfo in project dbeaver by serge-rider.
the class MySQLExportWizardPageObjects method loadSettings.
private void loadSettings() {
checkedObjects.clear();
catalogTable.removeAll();
boolean hasViews = false;
MySQLDataSource dataSource = null;
Set<MySQLCatalog> activeCatalogs = new LinkedHashSet<>();
for (MySQLDatabaseExportInfo info : wizard.getSettings().getExportObjects()) {
activeCatalogs.add(info.getDatabase());
dataSource = info.getDatabase().getDataSource();
if (!CommonUtils.isEmpty(info.getTables())) {
Set<MySQLTableBase> tables = checkedObjects.computeIfAbsent(info.getDatabase(), k -> new HashSet<>());
for (MySQLTableBase table : info.getTables()) {
tables.add(table);
if (table.isView()) {
hasViews = true;
}
}
}
}
if (hasViews) {
wizard.getSettings().setShowViews(true);
exportViewsCheck.setSelection(true);
}
if (dataSource != null) {
boolean tablesLoaded = false;
for (MySQLCatalog catalog : dataSource.getCatalogs()) {
TableItem item = new TableItem(catalogTable, SWT.NONE);
item.setImage(DBeaverIcons.getImage(DBIcon.TREE_DATABASE));
item.setText(0, catalog.getName());
item.setData(catalog);
if (activeCatalogs.contains(catalog)) {
item.setChecked(true);
catalogTable.select(catalogTable.indexOf(item));
if (!tablesLoaded) {
loadTables(catalog);
tablesLoaded = true;
}
}
}
}
updateState();
}
use of org.jkiss.dbeaver.ext.mysql.tasks.MySQLDatabaseExportInfo in project dbeaver by dbeaver.
the class MySQLExportWizardPageObjects method loadSettings.
private void loadSettings() {
checkedObjects.clear();
catalogTable.removeAll();
boolean hasViews = false;
MySQLDataSource dataSource = null;
Set<MySQLCatalog> activeCatalogs = new LinkedHashSet<>();
for (MySQLDatabaseExportInfo info : wizard.getSettings().getExportObjects()) {
activeCatalogs.add(info.getDatabase());
dataSource = info.getDatabase().getDataSource();
if (!CommonUtils.isEmpty(info.getTables())) {
Set<MySQLTableBase> tables = checkedObjects.computeIfAbsent(info.getDatabase(), k -> new HashSet<>());
for (MySQLTableBase table : info.getTables()) {
tables.add(table);
if (table.isView()) {
hasViews = true;
}
}
}
}
if (hasViews) {
wizard.getSettings().setShowViews(true);
exportViewsCheck.setSelection(true);
}
if (dataSource != null) {
boolean tablesLoaded = false;
for (MySQLCatalog catalog : dataSource.getCatalogs()) {
TableItem item = new TableItem(catalogTable, SWT.NONE);
item.setImage(DBeaverIcons.getImage(DBIcon.TREE_DATABASE));
item.setText(0, catalog.getName());
item.setData(catalog);
if (activeCatalogs.contains(catalog)) {
item.setChecked(true);
catalogTable.select(catalogTable.indexOf(item));
if (!tablesLoaded) {
loadTables(catalog);
tablesLoaded = true;
}
}
}
}
updateState();
}
Aggregations