use of org.jkiss.dbeaver.tools.transfer.DataTransferSettings in project dbeaver by serge-rider.
the class DatabaseConsumerPageMapping method showPreview.
private void showPreview(DatabaseMappingContainer mappingContainer) {
DataTransferPipe pipe = getPipe(mappingContainer);
DataTransferSettings dtSettings = getWizard().getSettings();
PreviewMappingDialog previewDialog = new PreviewMappingDialog(getShell(), pipe, mappingContainer, dtSettings);
previewDialog.open();
}
use of org.jkiss.dbeaver.tools.transfer.DataTransferSettings in project dbeaver by serge-rider.
the class DatabaseProducerPageInputObjects method activatePage.
@Override
public void activatePage() {
// final DatabaseProducerSettings settings = getWizard().getPageSettings(this, DatabaseProducerSettings.class);
DataTransferSettings settings = getWizard().getSettings();
mappingTable.removeAll();
for (DataTransferPipe pipe : settings.getDataPipes()) {
TableItem item = new TableItem(mappingTable, SWT.NONE);
item.setData(pipe);
updateItemData(item, pipe);
}
updatePageCompletion();
}
use of org.jkiss.dbeaver.tools.transfer.DataTransferSettings in project dbeaver by serge-rider.
the class DataTransferPagePipes method loadConsumers.
private void loadConsumers() {
DataTransferSettings settings = getWizard().getSettings();
Collection<DBSObject> objects = settings.getSourceObjects();
List<TransferTarget> transferTargets = new ArrayList<>();
for (DataTransferNodeDescriptor consumer : DataTransferRegistry.getInstance().getAvailableConsumers(objects)) {
Collection<DataTransferProcessorDescriptor> processors = consumer.getAvailableProcessors(objects);
if (CommonUtils.isEmpty(processors)) {
transferTargets.add(new TransferTarget(consumer, null));
} else {
for (DataTransferProcessorDescriptor processor : processors) {
transferTargets.add(new TransferTarget(consumer, processor));
}
}
}
nodesTable.setInput(transferTargets);
}
use of org.jkiss.dbeaver.tools.transfer.DataTransferSettings in project dbeaver by serge-rider.
the class DataTransferPagePipes method setSelectedSettings.
private void setSelectedSettings() {
final IStructuredSelection selection = (IStructuredSelection) nodesTable.getSelection();
TransferTarget target;
if (!selection.isEmpty()) {
target = (TransferTarget) selection.getFirstElement();
} else {
target = null;
}
DataTransferSettings settings = getWizard().getSettings();
if (target == null) {
settings.selectConsumer(null, null, true);
} else {
if (settings.isConsumerOptional()) {
settings.selectConsumer(target.node, target.processor, true);
} else if (settings.isProducerOptional()) {
settings.selectProducer(target.node, target.processor, true);
} else {
// no optional nodes
}
}
updatePageCompletion();
}
use of org.jkiss.dbeaver.tools.transfer.DataTransferSettings in project dbeaver by serge-rider.
the class DataTransferPagePipes method loadProducers.
private void loadProducers() {
DataTransferSettings settings = getWizard().getSettings();
Collection<DBSObject> objects = settings.getSourceObjects();
List<TransferTarget> transferTargets = new ArrayList<>();
for (DataTransferNodeDescriptor producer : DataTransferRegistry.getInstance().getAvailableProducers(objects)) {
Collection<DataTransferProcessorDescriptor> processors = producer.getAvailableProcessors(objects);
if (CommonUtils.isEmpty(processors)) {
transferTargets.add(new TransferTarget(producer, null));
} else {
for (DataTransferProcessorDescriptor processor : processors) {
transferTargets.add(new TransferTarget(producer, processor));
}
}
}
nodesTable.setInput(transferTargets);
}
Aggregations