String projectName = this.parentResource.getProject().getName();
IPath path = componentFolder.getLocation();
IPath projectRelativeJavaPath = componentJavaPath.removeFirstSegments(this.parentResource.getProject().getLocation().segmentCount());
IFolder javaSourceFolder = this.parentResource.getProject().getFolder(projectRelativeJavaPath);
prepareFolder(javaSourceFolder, monitor);
ComponentEngine componentEngine = new ComponentEngine();
try {
componentEngine.init();
} catch (Exception e) {
WizardsPlugin.getDefault().log(e);
throw new InvocationTargetException(e);
}
// TODO: select template in the user interface
// componentEngine.setSelectedTemplateName(componentEngine.names()[0]);
componentEngine.setProjectName(projectName);
componentEngine.setCreateBodyTag(this.createBodyTag);
componentEngine.setComponentName(this.componentName);
componentEngine.setPackageName(this.packageName);
componentEngine.setSuperclassName(this.superclassName);
componentEngine.setComponentPath(path);
componentEngine.setApiPath(apiPath);
componentEngine.setJavaPath(componentJavaPath);
componentEngine.setCreateApiFile(this.createApiFile);
componentEngine.setHTMLBodyType(this.htmlBodyType);
componentEngine.setWOOEncoding(this.wooEncoding);
try {
componentEngine.run(new NullProgressMonitor());
this.parentResource.getProject().refreshLocal(IResource.DEPTH_INFINITE, monitor);
IResource[] resources = new IResource[] {componentFolderToReveal.findMember(this.componentName + ".java"), componentFolder.findMember(this.componentName + ".wod")};
page.setResourcesToReveal(resources);
} catch (Exception e) {
WizardsPlugin.getDefault().log(e);