Object cfg = ((IProjectFacetActionEvent) event).getActionConfig();
if(cfg == null)
return;
IDataModel model = (IDataModel) cfg;
final IVirtualComponent c = ComponentCore.createComponent(project, true);
if (c == null)
return;
try{
if (model != null) {
//The model could not provide us the property we require
if(model.isProperty(IWebFacetInstallDataModelProperties.CONTEXT_ROOT)){
final IWorkspace ws = ResourcesPlugin.getWorkspace();
final IPath pjpath = project.getFullPath();
final IPath contentdir = setContentPropertyIfNeeded(model, pjpath, project);
mkdirs(ws.getRoot().getFolder(contentdir), monitor);
IVirtualFolder contentRootFolder = c.getRootFolder();
WTPProjectsUtil.setDefaultDeploymentDescriptorFolder(contentRootFolder, contentdir, monitor);
String contextRoot = model.getStringProperty(IWebFacetInstallDataModelProperties.CONTEXT_ROOT);
setContextRootPropertyIfNeeded(c, contextRoot);
IDataModelOperation notificationOperation = ((IDataModelOperation) model.getProperty(FacetDataModelProvider.NOTIFICATION_OPERATION));
if (notificationOperation != null) {
notificationOperation.execute(monitor, null);
}
}
}