createModelGroup = true;
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());
IFolder modelFolder = parentContainer.getFolder(new Path(modelFolderFile.getName()));
String baseName = model.getName();
if (_createEOGeneratorFile) {
EOGeneratorModel eogenModel = EOGeneratorWizard.createEOGeneratorModel(parentContainer, model, false);
IFile eogenFile = parentContainer.getFile(new Path(baseName + ".eogen"));
if (eogenFile.exists()) {