use of org.jkiss.dbeaver.tasks.nativetool.AbstractImportExportSettings in project dbeaver by serge-rider.
the class NativeToolConfigPanel method createControl.
@Override
public void createControl(Composite parent, TaskConfigurationWizard wizard, Runnable propertyChangeListener) {
ieWizard = (AbstractNativeToolWizard) wizard;
{
Group databasesGroup = UIUtils.createControlGroup(parent, TaskNativeUIMessages.tools_wizard_database_group_title, 1, GridData.FILL_BOTH, 0);
selectorPanel = new DatabaseObjectsSelectorPanel(databasesGroup, false, this.runnableContext) {
@Override
protected boolean isDatabaseFolderVisible(DBNDatabaseFolder folder) {
return folder.getChildrenClass() == objectClass;
}
@Override
protected boolean isDatabaseObjectVisible(DBSObject obj) {
return objectClass.isInstance(obj);
}
@Override
protected void onSelectionChange(Object element) {
selectedObject = element instanceof DBSWrapper && objectClass.isInstance(((DBSWrapper) element).getObject()) ? objectClass.cast(((DBSWrapper) element).getObject()) : null;
AbstractNativeToolSettings settings = ieWizard.getSettings();
List<DBSObject> databaseObjects = settings.getDatabaseObjects();
databaseObjects.clear();
if (selectedObject != null) {
databaseObjects.add(selectedObject);
}
if (settings instanceof AbstractImportExportSettings) {
((AbstractImportExportSettings) settings).fillExportObjectsFromInput();
}
updateHomeSelector();
propertyChangeListener.run();
}
@Override
protected boolean isFolderVisible(DBNLocalFolder folder) {
for (DBNDataSource ds : folder.getNestedDataSources()) {
if (isDataSourceVisible(ds)) {
return true;
}
}
return false;
}
@Override
protected boolean isDataSourceVisible(DBNDataSource dataSource) {
try {
return providerClass.isInstance(dataSource.getDataSourceContainer().getDriver().getDataSourceProvider());
} catch (Exception e) {
log.debug(e);
return false;
}
}
};
}
{
Composite clientGroup = UIUtils.createControlGroup((Composite) parent, TaskNativeUIMessages.tools_wizard_client_group_title, 1, GridData.FILL_HORIZONTAL, 0);
homesSelector = new ClientHomesSelector(clientGroup, TaskNativeUIMessages.tools_wizard_client_group_client);
homesSelector.addSelectionChangedListener(event -> propertyChangeListener.run());
homesSelector.getPanel().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
}
use of org.jkiss.dbeaver.tasks.nativetool.AbstractImportExportSettings in project dbeaver by dbeaver.
the class NativeToolConfigPanel method createControl.
@Override
public void createControl(Composite parent, TaskConfigurationWizard wizard, Runnable propertyChangeListener) {
ieWizard = (AbstractNativeToolWizard) wizard;
{
Group databasesGroup = UIUtils.createControlGroup(parent, TaskNativeUIMessages.tools_wizard_database_group_title, 1, GridData.FILL_BOTH, 0);
selectorPanel = new DatabaseObjectsSelectorPanel(databasesGroup, false, this.runnableContext) {
@Override
protected boolean isDatabaseFolderVisible(DBNDatabaseFolder folder) {
return folder.getChildrenClass() == objectClass;
}
@Override
protected boolean isDatabaseObjectVisible(DBSObject obj) {
return objectClass.isInstance(obj);
}
@Override
protected void onSelectionChange(Object element) {
selectedObject = element instanceof DBSWrapper && objectClass.isInstance(((DBSWrapper) element).getObject()) ? objectClass.cast(((DBSWrapper) element).getObject()) : null;
AbstractNativeToolSettings settings = ieWizard.getSettings();
List<DBSObject> databaseObjects = settings.getDatabaseObjects();
databaseObjects.clear();
if (selectedObject != null) {
databaseObjects.add(selectedObject);
}
if (settings instanceof AbstractImportExportSettings) {
((AbstractImportExportSettings) settings).fillExportObjectsFromInput();
}
updateHomeSelector();
propertyChangeListener.run();
}
@Override
protected boolean isFolderVisible(DBNLocalFolder folder) {
for (DBNDataSource ds : folder.getNestedDataSources()) {
if (isDataSourceVisible(ds)) {
return true;
}
}
return false;
}
@Override
protected boolean isDataSourceVisible(DBNDataSource dataSource) {
try {
return providerClass.isInstance(dataSource.getDataSourceContainer().getDriver().getDataSourceProvider());
} catch (Exception e) {
log.debug(e);
return false;
}
}
};
}
{
Composite clientGroup = UIUtils.createControlGroup((Composite) parent, TaskNativeUIMessages.tools_wizard_client_group_title, 1, GridData.FILL_HORIZONTAL, 0);
homesSelector = new ClientHomesSelector(clientGroup, TaskNativeUIMessages.tools_wizard_client_group_client);
homesSelector.addSelectionChangedListener(event -> propertyChangeListener.run());
homesSelector.getPanel().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
}
Aggregations