Search in sources :

Example 1 with DataTransferSettings

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();
}
Also used : DataTransferSettings(org.jkiss.dbeaver.tools.transfer.DataTransferSettings) DataTransferPipe(org.jkiss.dbeaver.tools.transfer.DataTransferPipe)

Example 2 with DataTransferSettings

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();
}
Also used : DataTransferSettings(org.jkiss.dbeaver.tools.transfer.DataTransferSettings) DataTransferPipe(org.jkiss.dbeaver.tools.transfer.DataTransferPipe)

Example 3 with DataTransferSettings

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);
}
Also used : DataTransferSettings(org.jkiss.dbeaver.tools.transfer.DataTransferSettings) DBSObject(org.jkiss.dbeaver.model.struct.DBSObject) ArrayList(java.util.ArrayList) DataTransferNodeDescriptor(org.jkiss.dbeaver.tools.transfer.registry.DataTransferNodeDescriptor) DataTransferProcessorDescriptor(org.jkiss.dbeaver.tools.transfer.registry.DataTransferProcessorDescriptor)

Example 4 with DataTransferSettings

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();
}
Also used : DataTransferSettings(org.jkiss.dbeaver.tools.transfer.DataTransferSettings)

Example 5 with DataTransferSettings

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);
}
Also used : DataTransferSettings(org.jkiss.dbeaver.tools.transfer.DataTransferSettings) DBSObject(org.jkiss.dbeaver.model.struct.DBSObject) ArrayList(java.util.ArrayList) DataTransferNodeDescriptor(org.jkiss.dbeaver.tools.transfer.registry.DataTransferNodeDescriptor) DataTransferProcessorDescriptor(org.jkiss.dbeaver.tools.transfer.registry.DataTransferProcessorDescriptor)

Aggregations

DataTransferSettings (org.jkiss.dbeaver.tools.transfer.DataTransferSettings)22 DataTransferPipe (org.jkiss.dbeaver.tools.transfer.DataTransferPipe)8 DBSObject (org.jkiss.dbeaver.model.struct.DBSObject)6 ArrayList (java.util.ArrayList)4 GridData (org.eclipse.swt.layout.GridData)4 DBNDatabaseNode (org.jkiss.dbeaver.model.navigator.DBNDatabaseNode)4 DBNModel (org.jkiss.dbeaver.model.navigator.DBNModel)4 DBNNode (org.jkiss.dbeaver.model.navigator.DBNNode)4 DataTransferNodeDescriptor (org.jkiss.dbeaver.tools.transfer.registry.DataTransferNodeDescriptor)4 DataTransferProcessorDescriptor (org.jkiss.dbeaver.tools.transfer.registry.DataTransferProcessorDescriptor)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 SashForm (org.eclipse.swt.custom.SashForm)2 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 FillLayout (org.eclipse.swt.layout.FillLayout)2 Composite (org.eclipse.swt.widgets.Composite)2 DBException (org.jkiss.dbeaver.DBException)2 DBSDataContainer (org.jkiss.dbeaver.model.struct.DBSDataContainer)2 DBSDataManipulator (org.jkiss.dbeaver.model.struct.DBSDataManipulator)2 DBSObjectContainer (org.jkiss.dbeaver.model.struct.DBSObjectContainer)2