use of org.apache.cayenne.modeler.pref.DataMapDefaults in project cayenne by apache.
the class StandardModeController method createView.
protected GeneratorControllerPanel createView() {
this.view = new StandardModePanel();
Set<Entry<DataMap, DataMapDefaults>> entities = getMapPreferences().entrySet();
for (Entry<DataMap, DataMapDefaults> entry : entities) {
StandardPanelComponent dataMapLine = createDataMapLineBy(entry.getKey(), entry.getValue());
dataMapLine.getDataMapName().setText(dataMapLine.getDataMap().getName());
BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), dataMapLine);
builder.bindToTextField(dataMapLine.getSuperclassPackage(), "preferences.superclassPackage").updateView();
this.view.addDataMapLine(dataMapLine);
}
return view;
}
use of org.apache.cayenne.modeler.pref.DataMapDefaults in project cayenne by apache.
the class DataSourceWizard method getConnectionInfoFromPreferences.
private DBConnectionInfo getConnectionInfoFromPreferences() {
DBConnectionInfo connectionInfo = new DBConnectionInfo();
DataMapDefaults dataMapDefaults = getProjectController().getDataMapPreferences(getProjectController().getCurrentDataMap());
connectionInfo.setDbAdapter(dataMapDefaults.getCurrentPreference().get(DB_ADAPTER_PROPERTY, null));
connectionInfo.setUrl(dataMapDefaults.getCurrentPreference().get(URL_PROPERTY, null));
connectionInfo.setUserName(dataMapDefaults.getCurrentPreference().get(USER_NAME_PROPERTY, null));
connectionInfo.setPassword(dataMapDefaults.getCurrentPreference().get(PASSWORD_PROPERTY, null));
connectionInfo.setJdbcDriver(dataMapDefaults.getCurrentPreference().get(JDBC_DRIVER_PROPERTY, null));
return connectionInfo;
}
use of org.apache.cayenne.modeler.pref.DataMapDefaults in project cayenne by apache.
the class DBConnectionAwareAction method saveConnectionInfo.
protected void saveConnectionInfo(DataSourceWizard connectWizard) {
DataMapDefaults dataMapDefaults = getProjectController().getDataMapPreferences(getProjectController().getCurrentDataMap());
String dbAdapter = connectWizard.getConnectionInfo().getDbAdapter();
if (dbAdapter != null) {
dataMapDefaults.getCurrentPreference().put(DB_ADAPTER_PROPERTY, dbAdapter);
} else {
dataMapDefaults.getCurrentPreference().remove(DB_ADAPTER_PROPERTY);
}
dataMapDefaults.getCurrentPreference().put(URL_PROPERTY, connectWizard.getConnectionInfo().getUrl());
dataMapDefaults.getCurrentPreference().put(USER_NAME_PROPERTY, connectWizard.getConnectionInfo().getUserName());
dataMapDefaults.getCurrentPreference().put(PASSWORD_PROPERTY, connectWizard.getConnectionInfo().getPassword());
dataMapDefaults.getCurrentPreference().put(JDBC_DRIVER_PROPERTY, connectWizard.getConnectionInfo().getJdbcDriver());
}
Aggregations