addPage(_page);
}
public boolean performFinish() {
WGARuntime runtime = _page.getRuntime();
if(runtime != null){
try {
IFolder folder = runtime.getDesignRoot().getFolder(new Path(_page.getDesignName()));
if (!folder.exists()) {
folder.create(false, true, new NullProgressMonitor());
DesignTemplate template = _page.getTemplate();
WGADesignFactory.createDesign(folder, folder.getName(), template);
if (!_page.isCreateContentStore()) {
_page.getRuntime().register(folder, false, null, null, null, template.getProperties());
} else {
_page.getRuntime().register(folder, true, _page.getDatabaseKey(), _page.getDatabaseTitle(), _page.getDomain(), template.getProperties());
}
WGADesignStructureHelper helper = new WGADesignStructureHelper(folder);
try {
// select new created design in packages explorer, resource navigator & project explorer
if(template.getName().equals("empty")){
String wgaDistributionName = runtime.getConfiguration().getWgaDistribution();
WGADeployment wgaDeployment = WGADesignerPlugin.getDefault().getWGADeploymentManager().getDeployment(wgaDistributionName);
WGADesignConfigurationModel configModel = helper.createModel();
VersionCompliance vc = WGADesignStructureHelper.wgaVersionToVersionCompliance(wgaDeployment.getWGAVersion());
if(vc!=null){
configModel.setVersionCompliance(vc);
configModel.saveChanges();
}
}
WorkbenchUtils.setNavigationViewSelection(new SingleStructuredSelection(helper.getSyncInfo()));
WorkbenchUtils.setNavigationViewSelection(new SingleStructuredSelection(folder));
} catch (Exception e) {
}
return true;
} else {
WorkbenchUtils.showErrorDialog(getShell(), "Design creation failed", "A design with name '" + _page.getDesignName() + "' already exists in the runtime '" + runtime.getName() + "'.");
return false;
}
} catch (CoreException e) {
WorkbenchUtils.showErrorDialog(WGADesignerPlugin.getDefault(), getShell(), "Design creation failed", "Unable to create new design in runtime '" + runtime.getName() + "'.", e);
return false;
}
} else {
WorkbenchUtils.showErrorDialog(getShell(), "Design creation failed", "No runtime selected for new design.");
return false;