use of org.jkiss.dbeaver.tools.transfer.DataTransferSettings in project dbeaver by serge-rider.
the class DatabaseProducerPageInputObjects method createControl.
@Override
public void createControl(Composite parent) {
initializeDialogUnits(parent);
Composite composite = UIUtils.createComposite(parent, 1);
DataTransferSettings settings = getWizard().getSettings();
{
Group tablesGroup = UIUtils.createControlGroup(composite, DTMessages.data_transfer_wizard_mappings_name, 3, GridData.FILL_BOTH, 0);
mappingTable = new Table(tablesGroup, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION);
mappingTable.setLayoutData(new GridData(GridData.FILL_BOTH));
mappingTable.setHeaderVisible(true);
mappingTable.setLinesVisible(true);
UIUtils.createTableColumn(mappingTable, SWT.LEFT, DTUIMessages.data_transfer_wizard_final_column_source);
UIUtils.createTableColumn(mappingTable, SWT.LEFT, DTUIMessages.data_transfer_wizard_final_column_target);
mappingTable.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (mappingTable.getSelectionIndex() < 0) {
return;
}
TableItem item = mappingTable.getItem(mappingTable.getSelectionIndex());
DataTransferPipe pipe = (DataTransferPipe) item.getData();
if (chooseEntity(pipe)) {
updateItemData(item, pipe);
updatePageCompletion();
}
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
});
UIUtils.asyncExec(() -> UIUtils.packColumns(mappingTable, true));
}
{
Composite controlGroup = UIUtils.createComposite(composite, 1);
Button autoAssignButton = new Button(controlGroup, SWT.PUSH);
autoAssignButton.setImage(DBeaverIcons.getImage(UIIcon.ASTERISK));
autoAssignButton.setText(DTMessages.data_transfer_db_consumer_auto_assign);
autoAssignButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
autoAssignMappings();
}
});
}
setControl(composite);
}
use of org.jkiss.dbeaver.tools.transfer.DataTransferSettings in project dbeaver by serge-rider.
the class DataTransferPageSettings method createSettingsPages.
private void createSettingsPages(Composite composite) {
DataTransferSettings dtSettings = getWizard().getSettings();
{
DataTransferPipe dataPipe = dtSettings.getDataPipes().get(0);
StringBuilder title = new StringBuilder();
title.append(DTMessages.data_transfer_wizard_settings_title).append(" (").append(dtSettings.getProducer().getName()).append(" to ").append(dtSettings.getConsumer().getName());
if (dtSettings.getProcessor() != null) {
title.append(", ").append(dtSettings.getProcessor().getName());
}
title.append(")");
setTitle(title.toString());
producerSettingsPage = getSettingsPage(dataPipe.getProducer());
consumerSettingsPage = getSettingsPage(dataPipe.getConsumer());
}
Composite settingsComposite = composite;
if (producerSettingsPage != null && consumerSettingsPage != null) {
SashForm sash = new SashForm(composite, SWT.HORIZONTAL);
sash.setLayoutData(new GridData(GridData.FILL_BOTH));
settingsComposite = sash;
}
if (producerSettingsPage != null) {
producerSettingsPage.setWizard(getWizard());
Composite producerGroup = UIUtils.createPlaceholder(settingsComposite, 1);
UIUtils.createInfoLabel(producerGroup, producerSettingsPage.getTitle());
Composite settingPanel = new Composite(producerGroup, SWT.NONE);
settingPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
settingPanel.setLayout(new FillLayout());
producerSettingsPage.createControl(settingPanel);
if (producerSettingsPage instanceof ActiveWizardPage) {
((ActiveWizardPage) producerSettingsPage).activatePage();
}
}
if (consumerSettingsPage != null) {
consumerSettingsPage.setWizard(getWizard());
Composite consumerGroup = UIUtils.createPlaceholder(settingsComposite, 1);
UIUtils.createInfoLabel(consumerGroup, consumerSettingsPage.getTitle());
Composite settingPanel = new Composite(consumerGroup, SWT.NONE);
settingPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
settingPanel.setLayout(new FillLayout());
consumerSettingsPage.createControl(settingPanel);
if (consumerSettingsPage instanceof ActiveWizardPage) {
((ActiveWizardPage) consumerSettingsPage).activatePage();
}
}
}
Aggregations