Search in sources :

Example 11 with TextWithOpenFile

use of org.jkiss.dbeaver.ui.controls.TextWithOpenFile in project dbeaver by serge-rider.

the class ConfigImportWizardPageNavicatSettings method createControl.

@Override
public void createControl(Composite parent) {
    Composite placeholder = new Composite(parent, SWT.NONE);
    placeholder.setLayout(new GridLayout(1, true));
    UIUtils.createControlLabel(placeholder, "Navicat Connection Export (NCX) file");
    filePathText = new TextWithOpenFile(placeholder, "Navicat Connection Export (NCX) file", new String[] { "*.ncx" });
    filePathText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    filePathText.getTextControl().addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            inputFile = new File(filePathText.getText());
            if (!inputFile.exists()) {
                setErrorMessage("File '" + inputFile.getAbsolutePath() + "' doesn't exist");
            } else {
                setErrorMessage(null);
            }
            getWizard().getContainer().updateButtons();
        }
    });
    UIUtils.createControlLabel(placeholder, "File encoding");
    encodingCombo = UIUtils.createEncodingCombo(placeholder, GeneralUtils.DEFAULT_ENCODING);
    setControl(placeholder);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) GridData(org.eclipse.swt.layout.GridData) TextWithOpenFile(org.jkiss.dbeaver.ui.controls.TextWithOpenFile) TextWithOpenFile(org.jkiss.dbeaver.ui.controls.TextWithOpenFile) File(java.io.File)

Example 12 with TextWithOpenFile

use of org.jkiss.dbeaver.ui.controls.TextWithOpenFile in project dbeaver by serge-rider.

the class PostgreRestoreWizardPageSettings method createControl.

@Override
public void createControl(Composite parent) {
    Composite composite = UIUtils.createPlaceholder(parent, 1);
    Listener updateListener = event -> updateState();
    Group formatGroup = UIUtils.createControlGroup(composite, PostgreMessages.wizard_restore_page_setting_label_setting, 2, GridData.FILL_HORIZONTAL, 0);
    formatCombo = UIUtils.createLabelCombo(formatGroup, PostgreMessages.wizard_restore_page_setting_label_format, SWT.DROP_DOWN | SWT.READ_ONLY);
    formatCombo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
    for (PostgreDatabaseBackupSettings.ExportFormat format : PostgreDatabaseBackupSettings.ExportFormat.values()) {
        formatCombo.add(format.getTitle());
    }
    formatCombo.select(wizard.getSettings().getFormat().ordinal());
    formatCombo.addListener(SWT.Selection, updateListener);
    cleanFirstButton = UIUtils.createCheckbox(formatGroup, PostgreMessages.wizard_restore_page_setting_btn_clean_first, null, wizard.getSettings().isCleanFirst(), 2);
    cleanFirstButton.addListener(SWT.Selection, updateListener);
    noOwnerCheck = UIUtils.createCheckbox(formatGroup, PostgreMessages.wizard_backup_page_setting_checkbox_no_owner, null, wizard.getSettings().isNoOwner(), 2);
    noOwnerCheck.addListener(SWT.Selection, updateListener);
    Group inputGroup = UIUtils.createControlGroup(composite, PostgreMessages.wizard_restore_page_setting_label_input, 2, GridData.FILL_HORIZONTAL, 0);
    UIUtils.createControlLabel(inputGroup, PostgreMessages.wizard_restore_page_setting_label_backup_file);
    inputFileText = new TextWithOpenFile(inputGroup, PostgreMessages.wizard_restore_page_setting_label_choose_backup_file, new String[] { "*.backup", "*.sql", "*" });
    inputFileText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    inputFileText.getTextControl().addListener(SWT.Modify, updateListener);
    inputFileText.setText(wizard.getSettings().getInputFile());
    createExtraArgsInput(inputGroup);
    Composite extraGroup = UIUtils.createComposite(composite, 2);
    createSecurityGroup(extraGroup);
    wizard.createTaskSaveGroup(extraGroup);
    setControl(composite);
}
Also used : TextWithOpenFile(org.jkiss.dbeaver.ui.controls.TextWithOpenFile) CommonUtils(org.jkiss.utils.CommonUtils) PostgreDatabaseRestoreSettings(org.jkiss.dbeaver.ext.postgresql.tasks.PostgreDatabaseRestoreSettings) UIUtils(org.jkiss.dbeaver.ui.UIUtils) SWT(org.eclipse.swt.SWT) org.eclipse.swt.widgets(org.eclipse.swt.widgets) PostgreMessages(org.jkiss.dbeaver.ext.postgresql.PostgreMessages) GridData(org.eclipse.swt.layout.GridData) PostgreDatabaseBackupSettings(org.jkiss.dbeaver.ext.postgresql.tasks.PostgreDatabaseBackupSettings) GridData(org.eclipse.swt.layout.GridData) TextWithOpenFile(org.jkiss.dbeaver.ui.controls.TextWithOpenFile) PostgreDatabaseBackupSettings(org.jkiss.dbeaver.ext.postgresql.tasks.PostgreDatabaseBackupSettings)

Example 13 with TextWithOpenFile

use of org.jkiss.dbeaver.ui.controls.TextWithOpenFile in project dbeaver by serge-rider.

the class MySQLSSLConfigurator method createControl.

//    private Button debugSSL;
@Override
public void createControl(Composite parent) {
    final Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(1, false));
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.minimumHeight = 200;
    composite.setLayoutData(gd);
    {
        Group certGroup = UIUtils.createControlGroup(composite, "Certificates", 2, GridData.FILL_HORIZONTAL, -1);
        UIUtils.createControlLabel(certGroup, "CA certificate");
        gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.minimumWidth = 130;
        clientCAText = new TextWithOpenFile(certGroup, "CA Certificate", new String[] { "*.*", "*.crt", "*.cert", "*.pem", "*" });
        clientCAText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        UIUtils.createControlLabel(certGroup, "SSL certificate");
        gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.minimumWidth = 130;
        clientCertText = new TextWithOpenFile(certGroup, "SSL Certificate", new String[] { "*.*", "*.cert", "*.pem", "*" });
        clientCertText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        UIUtils.createControlLabel(certGroup, "SSL certificate key");
        gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.minimumWidth = 130;
        clientKeyText = new TextWithOpenFile(certGroup, "SSL Certificate", new String[] { "*.*", "*.cert", "*.pem", "*" });
        clientKeyText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        cipherSuitesText = UIUtils.createLabelText(certGroup, "Cipher suites (optional)", "");
        cipherSuitesText.setToolTipText("Overrides the cipher suites enabled for use on the underlying SSL sockets.\nThis may be required when using external JSSE providers or to specify cipher suites compatible with both MySQL server and used JVM.");
    }
    {
        Group advGroup = UIUtils.createControlGroup(composite, "Advanced", 2, GridData.FILL_HORIZONTAL, -1);
        requireSSQL = UIUtils.createLabelCheckbox(advGroup, "Require SSL", "Require server support of SSL connection.", false);
        veryServerCert = UIUtils.createLabelCheckbox(advGroup, "Verify server certificate", "Should the driver verify the server's certificate?\nWhen using this feature, the explicit certificate parameters should be specified, rather than system properties.", true);
        allowPublicKeyRetrieval = UIUtils.createLabelCheckbox(advGroup, "Allow public key retrieval", "Allows special handshake roundtrip to get server RSA public key directly from server.", false);
    }
//        debugSSL = UIUtils.createLabelCheckbox(composite, "Debug SSL", "Prints debug information in standard output.", false);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) TextWithOpenFile(org.jkiss.dbeaver.ui.controls.TextWithOpenFile)

Example 14 with TextWithOpenFile

use of org.jkiss.dbeaver.ui.controls.TextWithOpenFile in project dbeaver by dbeaver.

the class PostgreSSLConfigurator method createControl.

@Override
public void createControl(Composite parent) {
    final Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(1, false));
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.minimumHeight = 200;
    composite.setLayoutData(gd);
    {
        Group certGroup = UIUtils.createControlGroup(composite, PostgreMessages.dialog_connection_network_postgres_ssl_certificates, 2, GridData.FILL_HORIZONTAL, -1);
        UIUtils.createControlLabel(certGroup, PostgreMessages.dialog_connection_network_postgres_ssl_certificates_root);
        gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.minimumWidth = 130;
        rootCertText = new TextWithOpenFile(certGroup, PostgreMessages.dialog_connection_network_postgres_ssl_certificates_ca, new String[] { "*.*", "*.crt", "*.cert", "*.pem", "*" });
        rootCertText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        UIUtils.createControlLabel(certGroup, PostgreMessages.dialog_connection_network_postgres_ssl_certificates_ssl);
        gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.minimumWidth = 130;
        clientCertText = new TextWithOpenFile(certGroup, PostgreMessages.dialog_connection_network_postgres_ssl_certificates_ssl, new String[] { "*.*", "*.cert", "*.pem", "*" });
        clientCertText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        UIUtils.createControlLabel(certGroup, PostgreMessages.dialog_connection_network_postgres_ssl_certificates_ssl_key);
        gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.minimumWidth = 130;
        clientKeyText = new TextWithOpenFile(certGroup, PostgreMessages.dialog_connection_network_postgres_ssl_certificates_ssl, new String[] { "*.*", "*.cert", "*.pem", "*" });
        clientKeyText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    }
    {
        Group advGroup = UIUtils.createControlGroup(composite, PostgreMessages.dialog_connection_network_postgres_ssl_advanced, 2, GridData.FILL_HORIZONTAL, -1);
        sslModeCombo = UIUtils.createLabelCombo(advGroup, PostgreMessages.dialog_connection_network_postgres_ssl_advanced_ssl_mode, SWT.READ_ONLY | SWT.DROP_DOWN);
        sslModeCombo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
        for (String mode : SSL_MODES) {
            sslModeCombo.add(mode);
        }
        sslFactoryCombo = UIUtils.createLabelCombo(advGroup, PostgreMessages.dialog_connection_network_postgres_ssl_advanced_ssl_factory, SWT.DROP_DOWN);
    }
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) TextWithOpenFile(org.jkiss.dbeaver.ui.controls.TextWithOpenFile)

Example 15 with TextWithOpenFile

use of org.jkiss.dbeaver.ui.controls.TextWithOpenFile in project dbeaver by dbeaver.

the class MySQLSSLConfigurator method createControl.

// private Button debugSSL;
@Override
public void createControl(Composite parent) {
    final Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(1, false));
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.minimumHeight = 200;
    composite.setLayoutData(gd);
    {
        Group certGroup = UIUtils.createControlGroup(composite, "Certificates", 2, GridData.FILL_HORIZONTAL, -1);
        UIUtils.createControlLabel(certGroup, "CA certificate");
        gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.minimumWidth = 130;
        clientCAText = new TextWithOpenFile(certGroup, "CA Certificate", new String[] { "*.*", "*.crt", "*.cert", "*.pem", "*" });
        clientCAText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        UIUtils.createControlLabel(certGroup, "SSL certificate");
        gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.minimumWidth = 130;
        clientCertText = new TextWithOpenFile(certGroup, "SSL Certificate", new String[] { "*.*", "*.cert", "*.pem", "*" });
        clientCertText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        UIUtils.createControlLabel(certGroup, "SSL certificate key");
        gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.minimumWidth = 130;
        clientKeyText = new TextWithOpenFile(certGroup, "SSL Certificate", new String[] { "*.*", "*.cert", "*.pem", "*" });
        clientKeyText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        cipherSuitesText = UIUtils.createLabelText(certGroup, "Cipher suites (optional)", "");
        cipherSuitesText.setToolTipText("Overrides the cipher suites enabled for use on the underlying SSL sockets.\nThis may be required when using external JSSE providers or to specify cipher suites compatible with both MySQL server and used JVM.");
    }
    {
        Group advGroup = UIUtils.createControlGroup(composite, "Advanced", 2, GridData.FILL_HORIZONTAL, -1);
        requireSSQL = UIUtils.createLabelCheckbox(advGroup, "Require SSL", "Require server support of SSL connection.", false);
        veryServerCert = UIUtils.createLabelCheckbox(advGroup, "Verify server certificate", "Should the driver verify the server's certificate?\nWhen using this feature, the explicit certificate parameters should be specified, rather than system properties.", true);
        allowPublicKeyRetrieval = UIUtils.createLabelCheckbox(advGroup, "Allow public key retrieval", "Allows special handshake roundtrip to get server RSA public key directly from server.", false);
    }
// debugSSL = UIUtils.createLabelCheckbox(composite, "Debug SSL", "Prints debug information in standard output.", false);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) TextWithOpenFile(org.jkiss.dbeaver.ui.controls.TextWithOpenFile)

Aggregations

GridData (org.eclipse.swt.layout.GridData)23 TextWithOpenFile (org.jkiss.dbeaver.ui.controls.TextWithOpenFile)23 GridLayout (org.eclipse.swt.layout.GridLayout)16 Composite (org.eclipse.swt.widgets.Composite)10 ModifyListener (org.eclipse.swt.events.ModifyListener)8 SWT (org.eclipse.swt.SWT)6 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)6 SelectionEvent (org.eclipse.swt.events.SelectionEvent)6 UIUtils (org.jkiss.dbeaver.ui.UIUtils)6 CommonUtils (org.jkiss.utils.CommonUtils)6 File (java.io.File)4 IDialogPage (org.eclipse.jface.dialogs.IDialogPage)4 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)4 ModifyEvent (org.eclipse.swt.events.ModifyEvent)4 Text (org.eclipse.swt.widgets.Text)4 Log (org.jkiss.dbeaver.Log)4 DBPDataSourceContainer (org.jkiss.dbeaver.model.DBPDataSourceContainer)4 DBPConnectionConfiguration (org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration)4 ICompositeDialogPage (org.jkiss.dbeaver.ui.ICompositeDialogPage)4 ConnectionPageAbstract (org.jkiss.dbeaver.ui.dialogs.connection.ConnectionPageAbstract)4