Search in sources :

Example 11 with StreamConsumerSettings

use of org.jkiss.dbeaver.tools.transfer.stream.StreamConsumerSettings in project dbeaver by dbeaver.

the class ResultSetHandlerOpenWith method openResultsWith.

private static void openResultsWith(IResultSetController resultSet, DataTransferProcessorDescriptor processor) {
    ResultSetDataContainerOptions options = new ResultSetDataContainerOptions();
    IResultSetSelection rsSelection = resultSet.getSelection();
    List<ResultSetRow> rsSelectedRows = rsSelection.getSelectedRows();
    List<DBDAttributeBinding> rsSelectedAttributes = rsSelection.getSelectedAttributes();
    if (rsSelectedRows.size() > 1 || rsSelectedAttributes.size() > 1) {
        List<Long> selectedRows = new ArrayList<>();
        for (ResultSetRow selectedRow : rsSelectedRows) {
            selectedRows.add((long) selectedRow.getRowNumber());
        }
        List<String> selectedAttributes = new ArrayList<>();
        for (DBDAttributeBinding attributeBinding : rsSelectedAttributes) {
            selectedAttributes.add(attributeBinding.getName());
        }
        options.setSelectedRows(selectedRows);
        options.setSelectedColumns(selectedAttributes);
    }
    ResultSetDataContainer dataContainer = new ResultSetDataContainer(resultSet, options);
    if (dataContainer.getDataSource() == null) {
        DBWorkbench.getPlatformUI().showError("Open " + processor.getAppName(), ModelMessages.error_not_connected_to_database);
        return;
    }
    DBPPreferenceStore preferenceStore = DBWorkbench.getPlatform().getPreferenceStore();
    String prevActiveApp = preferenceStore.getString(PARAM_ACTIVE_APP);
    if (!CommonUtils.equalObjects(prevActiveApp, processor.getFullId())) {
    // preferenceStore.setValue(PARAM_ACTIVE_APP, processor.getFullId());
    // resultSet.updateEditControls();
    // resultSet.getControl().layout(true);
    }
    AbstractJob exportJob = new AbstractJob("Open " + processor.getAppName()) {

        {
            setUser(true);
            setSystem(false);
        }

        @Override
        protected IStatus run(DBRProgressMonitor monitor) {
            try {
                File tempDir = DBWorkbench.getPlatform().getTempFolder(monitor, "data-files");
                File tempFile = new File(tempDir, new SimpleDateFormat("yyyyMMdd-HHmmss").format(System.currentTimeMillis()) + "." + processor.getAppFileExtension());
                tempFile.deleteOnExit();
                IDataTransferProcessor processorInstance = processor.getInstance();
                if (!(processorInstance instanceof IStreamDataExporter)) {
                    return Status.CANCEL_STATUS;
                }
                IStreamDataExporter exporter = (IStreamDataExporter) processorInstance;
                StreamTransferConsumer consumer = new StreamTransferConsumer();
                StreamConsumerSettings settings = new StreamConsumerSettings();
                settings.setOutputEncodingBOM(false);
                settings.setOpenFolderOnFinish(false);
                settings.setOutputFolder(tempDir.getAbsolutePath());
                settings.setOutputFilePattern(tempFile.getName());
                Map<String, Object> properties = new HashMap<>();
                // Default values from wizard
                IDialogSettings dtSettings = DataTransferWizard.getWizardDialogSettings();
                IDialogSettings procListSection = dtSettings.getSection("processors");
                IDialogSettings procSettings = null;
                if (procListSection != null) {
                    procSettings = procListSection.getSection("stream_consumer:" + processor.getId());
                }
                for (DBPPropertyDescriptor prop : processor.getProperties()) {
                    Object defValue = procSettings == null ? null : procSettings.get(CommonUtils.toString(prop.getId()));
                    properties.put(prop.getId(), defValue != null ? defValue : prop.getDefaultValue());
                }
                // Remove extension property (we specify file name directly)
                properties.remove(StreamConsumerSettings.PROP_FILE_EXTENSION);
                consumer.initTransfer(dataContainer, settings, new IDataTransferConsumer.TransferParameters(processor.isBinaryFormat(), processor.isHTMLFormat()), exporter, properties);
                DBDDataFilter dataFilter = resultSet.getModel().getDataFilter();
                DatabaseTransferProducer producer = new DatabaseTransferProducer(dataContainer, dataFilter);
                DatabaseProducerSettings producerSettings = new DatabaseProducerSettings();
                producerSettings.setExtractType(DatabaseProducerSettings.ExtractType.SINGLE_QUERY);
                producerSettings.setQueryRowCount(false);
                // disable OpenNewconnection by default (#6432)
                producerSettings.setOpenNewConnections(false);
                producerSettings.setSelectedRowsOnly(!CommonUtils.isEmpty(options.getSelectedRows()));
                producerSettings.setSelectedColumnsOnly(!CommonUtils.isEmpty(options.getSelectedColumns()));
                producer.transferData(monitor, consumer, null, producerSettings, null);
                consumer.finishTransfer(monitor, false);
                UIUtils.asyncExec(() -> {
                    if (!UIUtils.launchProgram(tempFile.getAbsolutePath())) {
                        DBWorkbench.getPlatformUI().showError("Open " + processor.getAppName(), "Can't open " + processor.getAppFileExtension() + " file '" + tempFile.getAbsolutePath() + "'");
                    }
                });
            } catch (Exception e) {
                DBWorkbench.getPlatformUI().showError("Error opening in " + processor.getAppName(), null, e);
            }
            return Status.OK_STATUS;
        }
    };
    exportJob.schedule();
}
Also used : DBDAttributeBinding(org.jkiss.dbeaver.model.data.DBDAttributeBinding) StreamConsumerSettings(org.jkiss.dbeaver.tools.transfer.stream.StreamConsumerSettings) DBDDataFilter(org.jkiss.dbeaver.model.data.DBDDataFilter) StreamTransferConsumer(org.jkiss.dbeaver.tools.transfer.stream.StreamTransferConsumer) IDataTransferConsumer(org.jkiss.dbeaver.tools.transfer.IDataTransferConsumer) DBPPreferenceStore(org.jkiss.dbeaver.model.preferences.DBPPreferenceStore) IDataTransferProcessor(org.jkiss.dbeaver.tools.transfer.IDataTransferProcessor) ExecutionException(org.eclipse.core.commands.ExecutionException) DBPPropertyDescriptor(org.jkiss.dbeaver.model.preferences.DBPPropertyDescriptor) AbstractJob(org.jkiss.dbeaver.model.runtime.AbstractJob) IDialogSettings(org.eclipse.jface.dialogs.IDialogSettings) DatabaseTransferProducer(org.jkiss.dbeaver.tools.transfer.database.DatabaseTransferProducer) DatabaseProducerSettings(org.jkiss.dbeaver.tools.transfer.database.DatabaseProducerSettings) IStreamDataExporter(org.jkiss.dbeaver.tools.transfer.stream.IStreamDataExporter) DBRProgressMonitor(org.jkiss.dbeaver.model.runtime.DBRProgressMonitor) File(java.io.File) SimpleDateFormat(java.text.SimpleDateFormat)

Example 12 with StreamConsumerSettings

use of org.jkiss.dbeaver.tools.transfer.stream.StreamConsumerSettings in project dbeaver by dbeaver.

the class StreamConsumerPageOutput method determinePageCompletion.

@Override
protected boolean determinePageCompletion() {
    final StreamConsumerSettings settings = getWizard().getPageSettings(this, StreamConsumerSettings.class);
    if (settings == null) {
        return false;
    }
    if (settings.isOutputClipboard()) {
        return true;
    }
    boolean valid = true;
    if (CommonUtils.isEmpty(settings.getOutputFolder())) {
        valid = false;
    }
    if (CommonUtils.isEmpty(settings.getOutputFilePattern())) {
        valid = false;
    }
    if (settings.isExecuteProcessOnFinish() && CommonUtils.isEmpty(settings.getFinishProcessCommand())) {
        return false;
    }
    return valid;
}
Also used : StreamConsumerSettings(org.jkiss.dbeaver.tools.transfer.stream.StreamConsumerSettings)

Example 13 with StreamConsumerSettings

use of org.jkiss.dbeaver.tools.transfer.stream.StreamConsumerSettings in project dbeaver by dbeaver.

the class StreamConsumerPageSettings method reloadFormatProfiles.

private void reloadFormatProfiles() {
    DBPDataFormatterRegistry registry = DBWorkbench.getPlatform().getDataFormatterRegistry();
    formatProfilesCombo.removeAll();
    formatProfilesCombo.add(DTMessages.data_transfer_wizard_settings_listbox_formatting_item_default);
    for (DBDDataFormatterProfile profile : registry.getCustomProfiles()) {
        formatProfilesCombo.add(profile.getProfileName());
    }
    final StreamConsumerSettings settings = getWizard().getPageSettings(this, StreamConsumerSettings.class);
    DBDDataFormatterProfile formatterProfile = settings.getFormatterProfile();
    if (formatterProfile != null) {
        if (!UIUtils.setComboSelection(formatProfilesCombo, formatterProfile.getProfileName())) {
            formatProfilesCombo.select(0);
        }
    } else {
        formatProfilesCombo.select(0);
    }
}
Also used : StreamConsumerSettings(org.jkiss.dbeaver.tools.transfer.stream.StreamConsumerSettings) DBPDataFormatterRegistry(org.jkiss.dbeaver.model.app.DBPDataFormatterRegistry) DBDDataFormatterProfile(org.jkiss.dbeaver.model.data.DBDDataFormatterProfile)

Example 14 with StreamConsumerSettings

use of org.jkiss.dbeaver.tools.transfer.stream.StreamConsumerSettings in project dbeaver by dbeaver.

the class StreamConsumerPageSettings method createControl.

@Override
public void createControl(Composite parent) {
    DBPDataFormatterRegistry dataFormatterRegistry = DBWorkbench.getPlatform().getDataFormatterRegistry();
    initializeDialogUnits(parent);
    final StreamConsumerSettings settings = getWizard().getPageSettings(this, StreamConsumerSettings.class);
    Composite composite = UIUtils.createComposite(parent, 1);
    {
        Composite generalSettings = UIUtils.createControlGroup(composite, DTMessages.data_transfer_wizard_settings_group_general, 5, GridData.FILL_HORIZONTAL, 0);
        ((GridLayout) generalSettings.getLayout()).verticalSpacing = 0;
        ((GridLayout) generalSettings.getLayout()).marginHeight = 0;
        ((GridLayout) generalSettings.getLayout()).marginWidth = 0;
        {
            formatProfilesCombo = UIUtils.createLabelCombo(generalSettings, DTMessages.data_transfer_wizard_settings_label_formatting, SWT.DROP_DOWN | SWT.READ_ONLY);
            GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
            gd.horizontalSpan = 3;
            formatProfilesCombo.setLayoutData(gd);
            formatProfilesCombo.addSelectionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                    if (formatProfilesCombo.getSelectionIndex() > 0) {
                        settings.setFormatterProfile(dataFormatterRegistry.getCustomProfile(UIUtils.getComboSelection(formatProfilesCombo)));
                    } else {
                        settings.setFormatterProfile(null);
                    }
                }
            });
            UIUtils.createDialogButton(generalSettings, DTMessages.data_transfer_wizard_settings_button_edit, new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                    PreferenceDialog propDialog = PreferencesUtil.createPropertyDialogOn(getShell(), dataFormatterRegistry, // TODO: replace this hardcode with some model invocation
                    "org.jkiss.dbeaver.preferences.main.dataformat", null, getSelectedFormatterProfile(), PreferencesUtil.OPTION_NONE);
                    if (propDialog != null) {
                        propDialog.open();
                        reloadFormatProfiles();
                    }
                }
            });
            reloadFormatProfiles();
            UIUtils.createControlLabel(generalSettings, DTMessages.data_transfer_wizard_settings_label_binaries);
            Composite binariesPanel = UIUtils.createComposite(generalSettings, 4);
            gd = new GridData(GridData.FILL_HORIZONTAL);
            gd.horizontalSpan = 4;
            binariesPanel.setLayoutData(gd);
            lobExtractType = new Combo(binariesPanel, SWT.DROP_DOWN | SWT.READ_ONLY);
            lobExtractType.setItems(DTMessages.data_transfer_wizard_settings_binaries_item_set_to_null, DTMessages.data_transfer_wizard_settings_binaries_item_save_to_file, DTMessages.data_transfer_wizard_settings_binaries_item_inline);
            lobExtractType.addSelectionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                    switch(lobExtractType.getSelectionIndex()) {
                        case EXTRACT_LOB_SKIP:
                            settings.setLobExtractType(StreamConsumerSettings.LobExtractType.SKIP);
                            break;
                        case EXTRACT_LOB_FILES:
                            settings.setLobExtractType(StreamConsumerSettings.LobExtractType.FILES);
                            break;
                        case EXTRACT_LOB_INLINE:
                            settings.setLobExtractType(StreamConsumerSettings.LobExtractType.INLINE);
                            break;
                    }
                    updatePageCompletion();
                }
            });
            lobEncodingLabel = UIUtils.createControlLabel(binariesPanel, DTMessages.data_transfer_wizard_settings_label_encoding);
            lobEncodingCombo = new Combo(binariesPanel, SWT.DROP_DOWN | SWT.READ_ONLY);
            lobEncodingCombo.setItems(// $NON-NLS-1$
            "Base64", // $NON-NLS-1$
            "Hex", // $NON-NLS-1$
            "Binary", // $NON-NLS-1$
            "Native");
            lobEncodingCombo.addSelectionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                    switch(lobEncodingCombo.getSelectionIndex()) {
                        case LOB_ENCODING_BASE64:
                            settings.setLobEncoding(StreamConsumerSettings.LobEncoding.BASE64);
                            break;
                        case LOB_ENCODING_HEX:
                            settings.setLobEncoding(StreamConsumerSettings.LobEncoding.HEX);
                            break;
                        case LOB_ENCODING_BINARY:
                            settings.setLobEncoding(StreamConsumerSettings.LobEncoding.BINARY);
                            break;
                        case LOB_ENCODING_NATIVE:
                            settings.setLobEncoding(StreamConsumerSettings.LobEncoding.NATIVE);
                            break;
                    }
                }
            });
        }
    }
    {
        Composite exporterSettings = UIUtils.createControlGroup(composite, DTMessages.data_transfer_wizard_settings_group_exporter, 1, GridData.FILL_BOTH, 0);
        propsEditor = new PropertyTreeViewer(exporterSettings, SWT.BORDER);
    }
    setControl(composite);
}
Also used : StreamConsumerSettings(org.jkiss.dbeaver.tools.transfer.stream.StreamConsumerSettings) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) PreferenceDialog(org.eclipse.jface.preference.PreferenceDialog) PropertyTreeViewer(org.jkiss.dbeaver.ui.properties.PropertyTreeViewer) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) DBPDataFormatterRegistry(org.jkiss.dbeaver.model.app.DBPDataFormatterRegistry) Combo(org.eclipse.swt.widgets.Combo)

Example 15 with StreamConsumerSettings

use of org.jkiss.dbeaver.tools.transfer.stream.StreamConsumerSettings in project dbeaver by serge-rider.

the class StreamConsumerPageOutput method createControl.

@Override
public void createControl(Composite parent) {
    initializeDialogUnits(parent);
    Composite composite = UIUtils.createComposite(parent, 1);
    final StreamConsumerSettings settings = getWizard().getPageSettings(this, StreamConsumerSettings.class);
    {
        Group generalSettings = UIUtils.createControlGroup(composite, DTMessages.data_transfer_wizard_output_group_general, 5, GridData.FILL_HORIZONTAL, 0);
        clipboardCheck = UIUtils.createCheckbox(generalSettings, DTMessages.data_transfer_wizard_output_label_copy_to_clipboard, null, false, 5);
        clipboardCheck.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                settings.setOutputClipboard(clipboardCheck.getSelection());
                updateControlsEnablement();
                updatePageCompletion();
            }
        });
        // Output path/pattern
        directoryText = DialogUtils.createOutputFolderChooser(generalSettings, null, e -> {
            settings.setOutputFolder(directoryText.getText());
            updatePageCompletion();
        });
        ((GridData) directoryText.getParent().getLayoutData()).horizontalSpan = 4;
        UIUtils.createControlLabel(generalSettings, DTMessages.data_transfer_wizard_output_label_file_name_pattern);
        fileNameText = new Text(generalSettings, SWT.BORDER);
        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.horizontalSpan = 4;
        UIUtils.setContentProposalToolTip(fileNameText, DTUIMessages.stream_consumer_page_output_tooltip_output_file_name_pattern, StreamTransferConsumer.VARIABLE_DATASOURCE, StreamTransferConsumer.VARIABLE_CATALOG, StreamTransferConsumer.VARIABLE_SCHEMA, StreamTransferConsumer.VARIABLE_TABLE, StreamTransferConsumer.VARIABLE_TIMESTAMP, StreamTransferConsumer.VARIABLE_DATE, StreamTransferConsumer.VARIABLE_INDEX, StreamTransferConsumer.VARIABLE_PROJECT, StreamTransferConsumer.VARIABLE_CONN_TYPE);
        fileNameText.setLayoutData(gd);
        fileNameText.addModifyListener(e -> {
            settings.setOutputFilePattern(fileNameText.getText());
            updatePageCompletion();
        });
        ContentAssistUtils.installContentProposal(fileNameText, new SmartTextContentAdapter(), new StringContentProposalProvider(GeneralUtils.variablePattern(StreamTransferConsumer.VARIABLE_DATASOURCE), GeneralUtils.variablePattern(StreamTransferConsumer.VARIABLE_CATALOG), GeneralUtils.variablePattern(StreamTransferConsumer.VARIABLE_SCHEMA), GeneralUtils.variablePattern(StreamTransferConsumer.VARIABLE_TABLE), GeneralUtils.variablePattern(StreamTransferConsumer.VARIABLE_TIMESTAMP), GeneralUtils.variablePattern(StreamTransferConsumer.VARIABLE_DATE), GeneralUtils.variablePattern(StreamTransferConsumer.VARIABLE_INDEX), GeneralUtils.variablePattern(StreamTransferConsumer.VARIABLE_CONN_TYPE), GeneralUtils.variablePattern(StreamTransferConsumer.VARIABLE_PROJECT)));
        {
            UIUtils.createControlLabel(generalSettings, DTMessages.data_transfer_wizard_output_label_encoding);
            encodingCombo = UIUtils.createEncodingCombo(generalSettings, settings.getOutputEncoding());
            // encodingCombo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_BEGINNING, true, false, 1, 1));
            encodingCombo.addModifyListener(e -> {
                int index = encodingCombo.getSelectionIndex();
                if (index >= 0) {
                    settings.setOutputEncoding(encodingCombo.getItem(index));
                }
                updatePageCompletion();
            });
            timestampPattern = UIUtils.createLabelText(generalSettings, DTMessages.data_transfer_wizard_output_label_timestamp_pattern, GeneralUtils.DEFAULT_TIMESTAMP_PATTERN, SWT.BORDER);
            timestampPattern.addModifyListener(e -> {
                settings.setOutputTimestampPattern(timestampPattern.getText());
            });
            encodingBOMCheckbox = UIUtils.createCheckbox(generalSettings, DTMessages.data_transfer_wizard_output_label_insert_bom, DTMessages.data_transfer_wizard_output_label_insert_bom_tooltip, false, 1);
            encodingBOMCheckbox.addSelectionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                    settings.setOutputEncodingBOM(encodingBOMCheckbox.getSelection());
                }
            });
        }
        singleFileCheck = UIUtils.createCheckbox(generalSettings, DTMessages.data_transfer_wizard_output_label_use_single_file, DTMessages.data_transfer_wizard_output_label_use_single_file_tip, false, 5);
        singleFileCheck.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                settings.setUseSingleFile(singleFileCheck.getSelection());
                updatePageCompletion();
            }
        });
        compressCheckbox = UIUtils.createCheckbox(generalSettings, DTMessages.data_transfer_wizard_output_checkbox_compress, null, false, 1);
        compressCheckbox.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                settings.setCompressResults(compressCheckbox.getSelection());
                updateControlsEnablement();
            }
        });
        {
            Composite outFilesSettings = UIUtils.createComposite(generalSettings, 3);
            outFilesSettings.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, true, false, 5, 1));
            splitFilesCheckbox = UIUtils.createCheckbox(outFilesSettings, DTMessages.data_transfer_wizard_output_checkbox_split_files, DTMessages.data_transfer_wizard_output_checkbox_split_files_tip, false, 1);
            splitFilesCheckbox.addSelectionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                    settings.setSplitOutFiles(splitFilesCheckbox.getSelection());
                    updateControlsEnablement();
                }
            });
            maximumFileSizeLabel = UIUtils.createControlLabel(outFilesSettings, DTUIMessages.stream_consumer_page_output_label_maximum_file_size);
            maximumFileSizeText = new Text(outFilesSettings, SWT.BORDER);
            maximumFileSizeText.addVerifyListener(UIUtils.getIntegerVerifyListener(Locale.ENGLISH));
            maximumFileSizeText.addModifyListener(e -> settings.setMaxOutFileSize(CommonUtils.toLong(maximumFileSizeText.getText())));
            gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
            gd.widthHint = UIUtils.getFontHeight(maximumFileSizeText) * 10;
            maximumFileSizeText.setLayoutData(gd);
        }
    }
    {
        Group resultsSettings = UIUtils.createControlGroup(composite, DTUIMessages.stream_consumer_page_output_label_results, 2, GridData.FILL_HORIZONTAL, 0);
        showFolderCheckbox = UIUtils.createCheckbox(resultsSettings, DTMessages.data_transfer_wizard_output_checkbox_open_folder, true);
        showFolderCheckbox.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                settings.setOpenFolderOnFinish(showFolderCheckbox.getSelection());
            }
        });
        showFolderCheckbox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_BEGINNING, false, false, 2, 1));
        execProcessCheckbox = UIUtils.createCheckbox(resultsSettings, DTUIMessages.stream_consumer_page_output_checkbox_execute_process, true);
        execProcessCheckbox.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                settings.setExecuteProcessOnFinish(execProcessCheckbox.getSelection());
                updateControlsEnablement();
                updatePageCompletion();
            }
        });
        execProcessText = new Text(resultsSettings, SWT.BORDER);
        execProcessText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        execProcessText.addModifyListener(e -> {
            settings.setFinishProcessCommand(execProcessText.getText());
            updatePageCompletion();
        });
        UIUtils.setContentProposalToolTip(execProcessText, DTUIMessages.stream_consumer_page_output_tooltip_process_command_line, StreamTransferConsumer.VARIABLE_FILE, StreamTransferConsumer.VARIABLE_TABLE, StreamTransferConsumer.VARIABLE_TIMESTAMP, StreamTransferConsumer.VARIABLE_DATE, StreamTransferConsumer.VARIABLE_PROJECT, StreamTransferConsumer.VARIABLE_CONN_TYPE);
        ContentAssistUtils.installContentProposal(execProcessText, new SmartTextContentAdapter(), new StringContentProposalProvider(GeneralUtils.variablePattern(StreamTransferConsumer.VARIABLE_TABLE), GeneralUtils.variablePattern(StreamTransferConsumer.VARIABLE_TIMESTAMP), GeneralUtils.variablePattern(StreamTransferConsumer.VARIABLE_DATE), GeneralUtils.variablePattern(StreamTransferConsumer.VARIABLE_PROJECT), GeneralUtils.variablePattern(StreamTransferConsumer.VARIABLE_CONN_TYPE), GeneralUtils.variablePattern(StreamTransferConsumer.VARIABLE_FILE)));
        showFinalMessageCheckbox = UIUtils.createCheckbox(resultsSettings, DTUIMessages.stream_consumer_page_output_label_show_finish_message, null, getWizard().getSettings().isShowFinalMessage(), 4);
        showFinalMessageCheckbox.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                getWizard().getSettings().setShowFinalMessage(showFinalMessageCheckbox.getSelection());
            }
        });
    }
    setControl(composite);
}
Also used : DTUIMessages(org.jkiss.dbeaver.tools.transfer.ui.internal.DTUIMessages) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) ActiveWizardPage(org.jkiss.dbeaver.ui.dialogs.ActiveWizardPage) GeneralUtils(org.jkiss.dbeaver.utils.GeneralUtils) CommonUtils(org.jkiss.utils.CommonUtils) StreamConsumerSettings(org.jkiss.dbeaver.tools.transfer.stream.StreamConsumerSettings) org.eclipse.swt.widgets(org.eclipse.swt.widgets) StreamTransferConsumer(org.jkiss.dbeaver.tools.transfer.stream.StreamTransferConsumer) StringContentProposalProvider(org.jkiss.dbeaver.ui.contentassist.StringContentProposalProvider) SmartTextContentAdapter(org.jkiss.dbeaver.ui.contentassist.SmartTextContentAdapter) ContentAssistUtils(org.jkiss.dbeaver.ui.contentassist.ContentAssistUtils) DataTransferWizard(org.jkiss.dbeaver.tools.transfer.ui.wizard.DataTransferWizard) UIUtils(org.jkiss.dbeaver.ui.UIUtils) Locale(java.util.Locale) SWT(org.eclipse.swt.SWT) DialogUtils(org.jkiss.dbeaver.ui.dialogs.DialogUtils) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData) DTMessages(org.jkiss.dbeaver.tools.transfer.internal.DTMessages) StreamConsumerSettings(org.jkiss.dbeaver.tools.transfer.stream.StreamConsumerSettings) SmartTextContentAdapter(org.jkiss.dbeaver.ui.contentassist.SmartTextContentAdapter) StringContentProposalProvider(org.jkiss.dbeaver.ui.contentassist.StringContentProposalProvider) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData)

Aggregations

StreamConsumerSettings (org.jkiss.dbeaver.tools.transfer.stream.StreamConsumerSettings)21 StreamTransferConsumer (org.jkiss.dbeaver.tools.transfer.stream.StreamTransferConsumer)8 ExecutionException (org.eclipse.core.commands.ExecutionException)6 DBDAttributeBinding (org.jkiss.dbeaver.model.data.DBDAttributeBinding)6 DBDDataFilter (org.jkiss.dbeaver.model.data.DBDDataFilter)6 AbstractJob (org.jkiss.dbeaver.model.runtime.AbstractJob)6 DBRProgressMonitor (org.jkiss.dbeaver.model.runtime.DBRProgressMonitor)6 IDataTransferConsumer (org.jkiss.dbeaver.tools.transfer.IDataTransferConsumer)6 DatabaseProducerSettings (org.jkiss.dbeaver.tools.transfer.database.DatabaseProducerSettings)6 DatabaseTransferProducer (org.jkiss.dbeaver.tools.transfer.database.DatabaseTransferProducer)6 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)5 SelectionEvent (org.eclipse.swt.events.SelectionEvent)5 GridData (org.eclipse.swt.layout.GridData)5 File (java.io.File)4 SimpleDateFormat (java.text.SimpleDateFormat)4 DBPDataFormatterRegistry (org.jkiss.dbeaver.model.app.DBPDataFormatterRegistry)4 DBPPropertyDescriptor (org.jkiss.dbeaver.model.preferences.DBPPropertyDescriptor)4 IDataTransferProcessor (org.jkiss.dbeaver.tools.transfer.IDataTransferProcessor)4 IStreamDataExporter (org.jkiss.dbeaver.tools.transfer.stream.IStreamDataExporter)4 PreferenceDialog (org.eclipse.jface.preference.PreferenceDialog)3