use of com.centurylink.mdw.plugin.project.model.JdbcDataSource in project mdw-designer by CenturyLinkCloud.
the class DataSourcePage method createDbPasswordControls.
private void createDbPasswordControls(Composite parent, int ncol) {
new Label(parent, SWT.NONE).setText("DB Password:");
dbPasswordTextField = new Text(parent, SWT.SINGLE | SWT.BORDER | SWT.PASSWORD);
GridData gd = new GridData(GridData.BEGINNING);
gd.widthHint = 200;
gd.horizontalSpan = ncol - 1;
dbPasswordTextField.setLayoutData(gd);
dbPasswordTextField.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
JdbcDataSource dataSource = getDataSource();
if (dataSource != null)
dataSource.setDbPassword(dbPasswordTextField.getText().trim());
handleFieldChanged();
}
});
}
use of com.centurylink.mdw.plugin.project.model.JdbcDataSource in project mdw-designer by CenturyLinkCloud.
the class DataSourcePage method initValues.
@Override
public void initValues() {
String prevDriver = "";
String prevUrl = "";
String prevUser = "";
if (!getProject().isRemote()) {
String prefix = "MDW" + getProject().getMdwVersion();
prevDriver = MdwPlugin.getStringPref(prefix + "-" + ProjectPersist.MDW_DB_DRIVER);
prevUrl = MdwPlugin.getStringPref(prefix + "-" + ProjectPersist.MDW_DB_URL);
prevUser = MdwPlugin.getStringPref(prefix + "-" + ProjectPersist.MDW_DB_USER);
}
boolean isMdw6 = getProject().checkRequiredVersion(6, 0);
JdbcDataSource dataSource = getDataSource();
if (dataSource != null) {
if (isMdw6)
dataSource.setDriver(JdbcDataSource.DEFAULT_DRIVER_MDW6);
else if (prevDriver.length() > 0)
dataSource.setDriver(prevDriver);
else
dataSource.setDriver(JdbcDataSource.DEFAULT_DRIVER);
driverComboBox.setText(dataSource.getDriver());
if (isMdw6)
dataSource.setJdbcUrl(JdbcDataSource.DEFAULT_JDBC_URL_MDW6);
else if (prevUrl.length() > 0)
dataSource.setJdbcUrl(prevUrl);
else
dataSource.setJdbcUrl(JdbcDataSource.DEFAULT_JDBC_URL);
jdbcUrlTextField.setText(dataSource.getJdbcUrl());
if (isMdw6) {
dataSource.setDbUser(JdbcDataSource.DEFAULT_DB_USER_OLD);
dataSource.setDbPassword(JdbcDataSource.DEFAULT_DB_PASSWORD_OLD);
} else if (prevUser.length() > 0) {
dataSource.setDbUser(prevUser);
} else {
dataSource.setDbUser(JdbcDataSource.DEFAULT_DB_USER);
dataSource.setDbPassword(JdbcDataSource.DEFAULT_DB_PASSWORD);
if (!getProject().isRemote() && !getProject().checkRequiredVersion(5, 5)) {
// triggers server call to retrieve mdw version -- not for
// remote
dataSource.setDbUser(JdbcDataSource.DEFAULT_DB_USER_OLD);
dataSource.setDbPassword(JdbcDataSource.DEFAULT_DB_PASSWORD_OLD);
}
}
dbUserTextField.setText(dataSource.getDbUser());
if (prevUser.length() == 0)
dbPasswordTextField.setText(dataSource.getDbPassword());
}
}
use of com.centurylink.mdw.plugin.project.model.JdbcDataSource in project mdw-designer by CenturyLinkCloud.
the class DataSourcePage method createJdbcUrlControls.
private void createJdbcUrlControls(Composite parent, int ncol) {
new Label(parent, SWT.NONE).setText("JDBC URL:");
jdbcUrlTextField = new Text(parent, SWT.SINGLE | SWT.BORDER);
GridData gd = new GridData(GridData.BEGINNING);
gd.widthHint = 400;
gd.horizontalSpan = ncol - 1;
jdbcUrlTextField.setLayoutData(gd);
jdbcUrlTextField.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
JdbcDataSource dataSource = getDataSource();
if (dataSource != null)
dataSource.setJdbcUrl(jdbcUrlTextField.getText().trim());
handleFieldChanged();
}
});
}
use of com.centurylink.mdw.plugin.project.model.JdbcDataSource in project mdw-designer by CenturyLinkCloud.
the class DataSourcePage method createDriverControls.
private void createDriverControls(Composite parent, int ncol) {
new Label(parent, SWT.NONE).setText("Driver:");
driverComboBox = new Combo(parent, SWT.DROP_DOWN);
GridData gd = new GridData(GridData.BEGINNING);
gd.horizontalSpan = ncol - 1;
gd.widthHint = 200;
driverComboBox.setLayoutData(gd);
driverComboBox.removeAll();
for (int i = 0; i < JdbcDataSource.JDBC_DRIVERS.length; i++) driverComboBox.add(JdbcDataSource.JDBC_DRIVERS[i]);
driverComboBox.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
String driver = driverComboBox.getText();
JdbcDataSource dataSource = getDataSource();
if (dataSource != null)
dataSource.setDriver(driver);
handleFieldChanged();
}
});
}
use of com.centurylink.mdw.plugin.project.model.JdbcDataSource in project mdw-designer by CenturyLinkCloud.
the class DataSourcePage method createDbUserControls.
private void createDbUserControls(Composite parent, int ncol) {
new Label(parent, SWT.NONE).setText("DB User:");
dbUserTextField = new Text(parent, SWT.SINGLE | SWT.BORDER);
GridData gd = new GridData(GridData.BEGINNING);
gd.widthHint = 200;
gd.horizontalSpan = ncol - 1;
dbUserTextField.setLayoutData(gd);
dbUserTextField.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
JdbcDataSource dataSource = getDataSource();
if (dataSource != null)
dataSource.setDbUser(dbUserTextField.getText().trim());
handleFieldChanged();
}
});
}
Aggregations