EOModelErrorDialog errors = new EOModelErrorDialog(Display.getDefault().getActiveShell(), failures);
errors.open();
}
EOModel model = new EOModel(_modelName);
EODatabaseConfig databaseConfig = new EODatabaseConfig("Default");
databaseConfig.setAdaptorName(_adaptorName);
model.addDatabaseConfig(databaseConfig);
modelGroup.addModel(model);
modelGroup.setEditingModelName(_modelName);
ProjectFrameworkAdapter frameworkAdapter = (ProjectFrameworkAdapter)_parentResource.getProject().getAdapter(ProjectFrameworkAdapter.class);
// add adaptor framework
if (!"None".equals(_adaptorName) && !"".equals(_adaptorName)) {
frameworkAdapter.addFrameworks(frameworkAdapter.getAdaptorFrameworks().get(_adaptorName));
}
if (!"None".equals(_pluginName) && !"".equals(_pluginName)) {
IEclipseFramework pluginFramework = frameworkAdapter.getPluginFrameworks().get(_pluginName);
frameworkAdapter.addFrameworks(pluginFramework);
String selectedPrototypeEntityName = "EO" + _adaptorName + _pluginName + "Prototypes";
EOEntity selectedPrototypeEntity = modelGroup.getEntityNamed(selectedPrototypeEntityName);
if (selectedPrototypeEntity != null) {
EODatabaseConfig activeConfig = model.getActiveDatabaseConfig();
if (activeConfig != null) {
activeConfig.setPrototype(selectedPrototypeEntity);
}
}
}
File modelFolderFile = model.saveToFolder(parentContainer.getLocation().toFile());