use of org.jkiss.dbeaver.ext.athena.model.AWSRegion in project dbeaver by serge-rider.
the class AthenaConnectionPage method loadSettings.
@Override
public void loadSettings() {
super.loadSettings();
// Load values from new connection info
DBPConnectionConfiguration connectionInfo = site.getActiveDataSource().getConnectionConfiguration();
if (awsRegionCombo != null) {
awsRegionCombo.removeAll();
for (AWSRegion region : AWSRegion.values()) {
awsRegionCombo.add(region.getId());
}
if (!CommonUtils.isEmpty(connectionInfo.getServerName())) {
awsRegionCombo.setText(connectionInfo.getServerName());
}
if (awsRegionCombo.getText().isEmpty()) {
awsRegionCombo.setText(AWSRegion.us_west_1.getId());
}
}
if (s3LocationText != null) {
String databaseName = connectionInfo.getDatabaseName();
if (CommonUtils.isEmpty(databaseName)) {
// $NON-NLS-1$
databaseName = "s3://";
}
s3LocationText.setText(databaseName);
}
if (accessKeyText != null) {
accessKeyText.setText(CommonUtils.notEmpty(connectionInfo.getUserName()));
}
if (passwordText != null) {
passwordText.setText(CommonUtils.notEmpty(connectionInfo.getUserPassword()));
}
}
use of org.jkiss.dbeaver.ext.athena.model.AWSRegion in project dbeaver by dbeaver.
the class AthenaConnectionPage method loadSettings.
@Override
public void loadSettings() {
super.loadSettings();
// Load values from new connection info
DBPConnectionConfiguration connectionInfo = site.getActiveDataSource().getConnectionConfiguration();
if (awsRegionCombo != null) {
awsRegionCombo.removeAll();
for (AWSRegion region : AWSRegion.values()) {
awsRegionCombo.add(region.getId());
}
if (!CommonUtils.isEmpty(connectionInfo.getServerName())) {
awsRegionCombo.setText(connectionInfo.getServerName());
}
if (awsRegionCombo.getText().isEmpty()) {
awsRegionCombo.setText(AWSRegion.us_west_1.getId());
}
}
if (s3LocationText != null) {
String databaseName = connectionInfo.getDatabaseName();
if (CommonUtils.isEmpty(databaseName)) {
// $NON-NLS-1$
databaseName = "s3://";
}
s3LocationText.setText(databaseName);
}
if (accessKeyText != null) {
accessKeyText.setText(CommonUtils.notEmpty(connectionInfo.getUserName()));
}
if (passwordText != null) {
passwordText.setText(CommonUtils.notEmpty(connectionInfo.getUserPassword()));
}
}
Aggregations