version = ui.run();
}
else {
logger.debug("running helper to create version");
IVersionHelper helper = (IVersionHelper)ServiceUtils.getService(bundleContext, IVersionHelper.class.getName());
logger.debug("helper: " + helper);
version = helper.createVersion();
}
logger.debug("version: " + version);
// save version
if(version != null) {
VersionDao versionDao = (VersionDao)ServiceUtils.getService(bundleContext, VersionDao.class.getName());
logger.trace("versionDao: " + versionDao);
versionDao.saveVersion(version);
}
}
catch(Exception e) {
MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.getString("campaign.error.create_version.title"), Messages.getString("campaign.error.create_version.message") + "\n\n" + e.getLocalizedMessage());
}
break;
case ACTION_TYPE_LIBRARY:
try {
Library library;
// find a library creation helper
if(runWizard) {
logger.debug("running wizard to create library");
ILibraryUI ui = (ILibraryUI)ServiceUtils.getService(bundleContext, ILibraryUI.class.getName());
logger.debug("ui: " + ui);
logger.debug("setting up");
ui.setup(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
logger.debug("running UI helper");
library = ui.run();
}
else {
logger.debug("running helper to create library");
ILibraryHelper helper = (ILibraryHelper)ServiceUtils.getService(bundleContext, ILibraryHelper.class.getName());
logger.debug("helper: " + helper);
library = helper.createLibrary();
}
logger.debug("library: " + library);
// save library
if(library != null) {