use of org.jkiss.dbeaver.ui.controls.TextWithOpenFile in project dbeaver by dbeaver.
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);
}
use of org.jkiss.dbeaver.ui.controls.TextWithOpenFile in project dbeaver by serge-rider.
the class SpannerConnectionPage method createControl.
@Override
public void createControl(Composite composite) {
setImageDescriptor(logoImage);
Composite settingsGroup = new Composite(composite, SWT.NONE);
settingsGroup.setLayout(new GridLayout(1, false));
settingsGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
ModifyListener textListener = e -> site.updateButtons();
{
Composite addrGroup = UIUtils.createControlGroup(settingsGroup, SpannerMessages.label_connection, 2, 0, 0);
addrGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// $NON-NLS-2$
projectText = UIUtils.createLabelText(addrGroup, SpannerMessages.label_project, "");
projectText.addModifyListener(textListener);
// $NON-NLS-2$
instanceText = UIUtils.createLabelText(addrGroup, SpannerMessages.label_instance, "");
// $NON-NLS-1$
instanceText.setToolTipText("Spanner Instance ID");
instanceText.addModifyListener(textListener);
// $NON-NLS-2$
databaseText = UIUtils.createLabelText(addrGroup, SpannerMessages.label_database, "");
// $NON-NLS-1$
databaseText.setToolTipText("Spanner Database ID");
databaseText.addModifyListener(textListener);
UIUtils.createControlLabel(addrGroup, SpannerMessages.label_private_key_path);
// $NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
privateKeyFile = new TextWithOpenFile(addrGroup, SpannerMessages.label_private_key_path, new String[] { "*", "*.json" });
GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
// gd.horizontalSpan = 3;
privateKeyFile.setLayoutData(gd);
}
createDriverPanel(settingsGroup);
setControl(settingsGroup);
}
use of org.jkiss.dbeaver.ui.controls.TextWithOpenFile in project dbeaver by serge-rider.
the class SSLConfiguratorTrustStoreUI method createTrustStoreConfigGroup.
protected Group createTrustStoreConfigGroup(Composite composite) {
final boolean certificatesSupported = isCertificatesSupported();
final boolean keyStoreSupported = isKeystoreSupported();
assert certificatesSupported || keyStoreSupported;
Group sslParameters = UIUtils.createControlGroup(composite, UIConnectionMessages.dialog_setting_ssl_configurator_legend_parameters, 1, GridData.FILL_HORIZONTAL, SWT.DEFAULT);
if (certificatesSupported && keyStoreSupported) {
final SelectionAdapter methodSwitcher = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
showMethodControls((SSLConfigurationMethod) e.widget.getData());
}
};
Composite sslMethodComposite = UIUtils.createComposite(sslParameters, 3);
UIUtils.createControlLabel(sslMethodComposite, UIConnectionMessages.dialog_setting_ssl_configurator_method);
certRadioButton = UIUtils.createRadioButton(sslMethodComposite, UIConnectionMessages.dialog_setting_ssl_configurator_method_certs, SSLConfigurationMethod.CERTIFICATES, methodSwitcher);
keyStoreRadioButton = UIUtils.createRadioButton(sslMethodComposite, UIConnectionMessages.dialog_setting_ssl_configurator_method_keystore, SSLConfigurationMethod.KEYSTORE, methodSwitcher);
}
{
sslCertComposite = UIUtils.createComposite(sslParameters, 2);
sslCertComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
if (useCACertificate()) {
UIUtils.createControlLabel(sslCertComposite, UIConnectionMessages.dialog_setting_ssl_configurator_certs_ca_name);
caCertPath = new TextWithOpenFile(sslCertComposite, UIConnectionMessages.dialog_setting_ssl_configurator_certs_ca_title, new String[] { "*.*", "*.crt", "*" });
caCertPath.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
UIUtils.createControlLabel(sslCertComposite, UIConnectionMessages.dialog_setting_ssl_configurator_certs_client_name);
clientCertPath = new TextWithOpenFile(sslCertComposite, UIConnectionMessages.dialog_setting_ssl_configurator_certs_client_title, new String[] { "*.*", "*.crt", "*" });
clientCertPath.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
UIUtils.createControlLabel(sslCertComposite, UIConnectionMessages.dialog_setting_ssl_configurator_certs_client_key_name);
clientKeyPath = new TextWithOpenFile(sslCertComposite, UIConnectionMessages.dialog_setting_ssl_configurator_certs_client_key_title, new String[] { "*.*", "*.key", "*" });
clientKeyPath.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
{
sslKeyStoreComposite = UIUtils.createComposite(sslParameters, 2);
sslKeyStoreComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
UIUtils.createControlLabel(sslKeyStoreComposite, UIConnectionMessages.dialog_setting_ssl_configurator_keystore_name);
keyStorePath = new TextWithOpenFile(sslKeyStoreComposite, UIConnectionMessages.dialog_setting_ssl_configurator_keystore_title, new String[] { "*.jks;*.pfx", "*.*" });
keyStorePath.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
UIUtils.createControlLabel(sslKeyStoreComposite, UIConnectionMessages.dialog_setting_ssl_configurator_keystore_password_name);
keyStorePassword = new Text(sslKeyStoreComposite, SWT.BORDER | SWT.PASSWORD);
keyStorePassword.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
return sslParameters;
}
use of org.jkiss.dbeaver.ui.controls.TextWithOpenFile in project dbeaver by serge-rider.
the class OracleScriptExecuteWizardPageSettings method createControl.
@Override
public void createControl(Composite parent) {
Composite composite = UIUtils.createPlaceholder(parent, 1);
Group outputGroup = UIUtils.createControlGroup(composite, OracleUIMessages.tools_script_execute_wizard_page_settings_group_input, 3, GridData.FILL_HORIZONTAL, 0);
outputGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
inputFileText = new TextWithOpenFile(outputGroup, OracleUIMessages.tools_script_execute_wizard_page_settings_label_input_file, new String[] { "*.sql", "*.txt", "*" });
inputFileText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
wizard.createTaskSaveGroup(composite);
setControl(composite);
// updateState();
}
use of org.jkiss.dbeaver.ui.controls.TextWithOpenFile in project dbeaver by serge-rider.
the class ConfigImportWizardPageCustomSettings method createControl.
@Override
public void createControl(Composite parent) {
Composite placeholder = new Composite(parent, SWT.NONE);
placeholder.setLayout(new GridLayout(1, true));
Composite typeGroup = UIUtils.createControlGroup(placeholder, "Input type", 2, GridData.FILL_HORIZONTAL, SWT.DEFAULT);
xmlButton = new Button(typeGroup, SWT.RADIO);
xmlButton.setText("XML");
xmlButton.setSelection(true);
csvButton = new Button(typeGroup, SWT.RADIO);
csvButton.setText("CSV");
UIUtils.createControlLabel(placeholder, "Input file");
filePathText = new TextWithOpenFile(placeholder, "Configuration Input File", new String[] { "*", "*.csv", "*.xml", "*.*" });
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);
/*
* final SelectionAdapter typeListener = new SelectionAdapter() {
*
* @Override public void widgetSelected(SelectionEvent e) { boolean
* isCSV = csvButton.getSelection(); } };
* csvButton.addSelectionListener(typeListener);
* xmlButton.addSelectionListener(typeListener);
*/
setControl(placeholder);
}
Aggregations