Search in sources :

Example 1 with ActiveWizardPage

use of org.jkiss.dbeaver.ui.dialogs.ActiveWizardPage in project dbeaver by dbeaver.

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();
        }
    }
}
Also used : DataTransferSettings(org.jkiss.dbeaver.tools.transfer.DataTransferSettings) SashForm(org.eclipse.swt.custom.SashForm) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout) DataTransferPipe(org.jkiss.dbeaver.tools.transfer.DataTransferPipe) ActiveWizardPage(org.jkiss.dbeaver.ui.dialogs.ActiveWizardPage)

Example 2 with ActiveWizardPage

use of org.jkiss.dbeaver.ui.dialogs.ActiveWizardPage 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();
        }
    }
}
Also used : DataTransferSettings(org.jkiss.dbeaver.tools.transfer.DataTransferSettings) SashForm(org.eclipse.swt.custom.SashForm) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout) DataTransferPipe(org.jkiss.dbeaver.tools.transfer.DataTransferPipe) ActiveWizardPage(org.jkiss.dbeaver.ui.dialogs.ActiveWizardPage)

Aggregations

SashForm (org.eclipse.swt.custom.SashForm)2 FillLayout (org.eclipse.swt.layout.FillLayout)2 GridData (org.eclipse.swt.layout.GridData)2 Composite (org.eclipse.swt.widgets.Composite)2 DataTransferPipe (org.jkiss.dbeaver.tools.transfer.DataTransferPipe)2 DataTransferSettings (org.jkiss.dbeaver.tools.transfer.DataTransferSettings)2 ActiveWizardPage (org.jkiss.dbeaver.ui.dialogs.ActiveWizardPage)2