Browse Source

XPand Generator Project generation fully based on Xtend

holger.willebrandt@gmail.com 13 years ago
parent
commit
52b01b2b51

+ 4 - 5
plugins/org.yakindu.sct.generator.genmodel.ui/.settings/org.eclipse.core.resources.prefs

@@ -1,5 +1,4 @@
-#Thu Nov 24 14:46:00 CET 2011
-eclipse.preferences.version=1
-encoding//src/org/yakindu/sct/generator/genmodel/ui/wizard/DefaultTemplate.xpt=ISO-8859-1
-encoding//src/org/yakindu/sct/generator/genmodel/ui/wizard/ProjectTemplate.xtend=UTF-8
-encoding//xtend-gen/org/yakindu/sct/generator/genmodel/ui/wizard/ProjectTemplate.java=UTF-8
+#Thu Nov 24 22:12:08 CET 2011
+eclipse.preferences.version=1
+encoding//src/org/yakindu/sct/generator/genmodel/ui/wizard/XpandDefaultTemplate.xpt=ISO-8859-1
+encoding//src/org/yakindu/sct/generator/genmodel/ui/wizard/XpandProjectTemplate.xtend=UTF-8

+ 1 - 2
plugins/org.yakindu.sct.generator.genmodel.ui/META-INF/MANIFEST.MF

@@ -24,9 +24,8 @@ Require-Bundle: org.yakindu.sct.generator.genmodel;visibility:=reexport,
  org.eclipse.xtext.xtend2;bundle-version="2.0.0",
  org.eclipse.xtext.xtend2.lib;bundle-version="2.0.0",
  org.yakindu.sct.ui.editor;bundle-version="1.0.0",
- org.eclipse.xtend.shared.ui;bundle-version="1.0.1",
  org.eclipse.xtext.xbase.ui,
- org.apache.commons.lang;bundle-version="2.4.0"
+ org.apache.commons.lang
 Import-Package: org.apache.log4j,
  org.apache.commons.logging
 Bundle-RequiredExecutionEnvironment: J2SE-1.5

+ 0 - 7
plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/ProjectData.java

@@ -10,14 +10,11 @@
  */
 package org.yakindu.sct.generator.genmodel.ui.wizard;
 
-import org.eclipse.core.resources.IProject;
-
 /**
  * 
  * @author holger willebrandt - Initial contribution and API
  */
 public class ProjectData {
-	IProject project;
 	boolean pluginExport;
 	boolean typeLibrary;
 	String projectName;
@@ -50,10 +47,6 @@ public class ProjectData {
 		return generatorName;
 	}
 
-	public IProject getProject() {
-		return project;
-	}
-
 	public String getGeneratorClass() {
 		return generatorClass;
 	}

+ 0 - 210
plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/ProjectTemplate.xtend

@@ -1,210 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.generator.genmodel.ui.wizard
-
-import org.eclipse.xtext.generator.IGenerator
-import org.eclipse.emf.ecore.resource.Resource
-import org.eclipse.xtext.generator.IFileSystemAccess
-import org.eclipse.core.runtime.IProgressMonitor
-import org.eclipse.core.resources.IContainer
-import org.eclipse.core.runtime.Path
-import org.eclipse.core.resources.IFolder
-import org.eclipse.core.resources.IResource
-import org.eclipse.xtend.shared.ui.wizards.EclipseHelper
-import org.eclipse.core.resources.ResourcesPlugin
-import org.apache.commons.lang.StringEscapeUtils
-/**
- * 
- * @author holger willebrandt - Initial contribution and API
- */
-class ProjectTemplate {
-	
-	def doGenerate(ProjectData data, IProgressMonitor monitor) {
-		var folderPath = 'src/'+data.targetPackage.asFolder
-		createFolder(folderPath,data.project, monitor)
-		var generatorFolder = data.project.getFolder(new Path(folderPath))
-		
-		EclipseHelper::createFile('.settings/org.eclipse.core.resources.prefs',data.project,
-			data.projectSettings(ResourcesPlugin::encoding).toString,monitor)
-		
-		EclipseHelper::createFile('.settings/org.eclipse.xtend.shared.ui.prefs',data.project,
-			data.xpandSettings.toString,monitor)
-		
-		EclipseHelper::createFile(data.templateName+'.xpt',generatorFolder,
-			resource('DefaultTemplate.xpt','iso-8859-1'),monitor)
-		
-		if (data.pluginExport) {
-			EclipseHelper::createFile('plugin.xml',data.project,data.plugin.toString,monitor)
-			EclipseHelper::createFile('src/'+data.generatorClass.javaFilename,data.project,data.generator.toString,monitor)
-			if (data.typeLibrary) {
-				createFolder('library', data.project, monitor)
-				//TODO create FeatureTypeLibrary.xmi							
-			}
-			EclipseHelper::createFile('build.properties',data.project,data.buildProperties.toString,monitor)
-		}
-	}
-	
-	
-	def templateName(ProjectData data) {
-		if (data.pluginExport)
-			data.generatorClass.simpleName
-		else
-			'Main'
-	}
-	
-	def resource(String name, String encoding) {
-		XpandGeneratorProjectWizard::getResourceContents(name,encoding)
-	}
-	
-	def targetPackage(ProjectData data) {
-		if (data.pluginExport)
-			data.generatorClass.packageName
-		else
-			'org.yakindu.sct.generator.xpand'
-	}
-	
-	def asFolder(String s) {
-		s.replaceAll('\\.','/')
-	}
-	
-	def javaPathToXpand(String s) {
-		s.replaceAll('\\.','::')
-	}
-	
-	def simpleName(String s) {
-		s.substring(s.lastIndexOf('.')+1)
-	}
-	
-	def packageName(String s) {
-		s.substring(0, s.lastIndexOf('.'))	
-	}
-	
-	def providerClass(ProjectData data){
-		data.generatorClass+'DefaultValueProvider'
-	}
-	
-	def javaFilename(String s) {
-		s.replaceAll('\\.','/')+'.java'
-	}
-	
-	def createFolder(String folderPath, IContainer container,
-			IProgressMonitor monitor) {
-		createFolderHierarchy(container.getFolder(new Path(folderPath)), monitor);
-	}
-
-	 def createFolderHierarchy(IFolder folder, IProgressMonitor monitor) {
-		if (!folder.exists) {
-			if (!folder.parent.exists
-					&& folder.parent.type == IResource::FOLDER) {
-				createFolderHierarchy(folder.parent as IFolder, monitor);
-			}
-			folder.create(true, true, monitor);
-		}
-	}
-	
-	def escapeForXml(String s) {
-		StringEscapeUtils::escapeXml(s)
-	}
-	
-	
-	def plugin(ProjectData data) '''
-		<?xml version="1.0" encoding="UTF-8"?>
-		<?eclipse version="3.4"?>
-		<plugin>
-		   <extension
-		         point="org.yakindu.sct.generator.core.generator">
-		      <SCTGenerator class="«data.generatorClass»"
-		            description="«data.generatorDescription.escapeForXml»"
-		            id="«data.generatorId»"
-		            name="«data.generatorName.escapeForXml»">
-		      </SCTGenerator>
-		   </extension>
-		«IF data.typeLibrary»
-		   <extension
-		         point="org.yakindu.sct.generator.core.featuretypes">
-		      <FeatureLibrary generatorId="«data.generatorId»" 
-		      defaultProvider="«data.providerClass»"
-		            uri="platform:/plugin/«data.project.name»/library/FeatureTypeLibrary.xmi">
-		      </FeatureLibrary>
-		   </extension>
-		«ENDIF»   
-		</plugin>
-	'''
-	
-	def generator(ProjectData data) '''
-		package «data.generatorClass.packageName»;
-		
-		import org.yakindu.sct.generator.core.impl.AbstractXpandBasedCodeGenerator;
-		
-		/**
-		 * Generator using Xpand template "«data.generatorClass.javaPathToXpand»::main"
-		 */
-		public class «data.generatorClass.simpleName» extends AbstractXpandBasedCodeGenerator {
-		
-			@Override
-			public String getTemplatePath() {
-				return "«data.generatorClass.javaPathToXpand»::main";
-			}
-		}
-	'''
-	
-	def defaultProvider(ProjectData data) '''
-		package «data.providerClass.packageName»;
-		
-		import org.yakindu.sct.generator.core.features.AbstractDefaultFeatureValueProvider;
-		
-		/**
-		 * Default value proivder for «data.generatorName» feature library
-		 */
-		public class «data.providerClass.simpleName» extends AbstractDefaultFeatureValueProvider {
-		
-			private static final String LIBRARY_NAME = "«data.generatorName»";
-			
-			@Override
-			protected void setDefaultValue(FeatureParameterValue parameterValue,
-					Statechart statechart) {
-				String parameterName = parameterValue.getParameter().getName();
-				//TODO: set the default values
-			}
-		
-			public boolean isProviderFor(FeatureTypeLibrary library) {
-				return library.getName().equals(LIBRARY_NAME);
-			}
-		
-			public IStatus validateParameterValue(FeatureParameterValue value) {
-				String name = value.getParameter().getName();
-				//TODO implement validation
-				return Status.OK_STATUS;
-			}
-		}
-	'''
-	
-	def projectSettings(ProjectData data, String encoding) '''
-	eclipse.preferences.version=1
-	encoding/<project>=«encoding»
-	
-	'''
-
-	def xpandSettings(ProjectData data) '''
-	eclipse.preferences.version=1
-	project.specific.metamodel=true
-	metamodelContributor=org.eclipse.xtend.typesystem.emf.ui.EmfMetamodelContributor
-	
-	'''
-	
-	def buildProperties(ProjectData data) '''
-		source.. = src/,\
-		           src-gen
-		bin.includes = META-INF/,\
-		               .,\
-		               plugin.xml
-	'''
- }

plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/DefaultTemplate.xpt → plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/XpandDefaultTemplate.xpt


+ 6 - 91
plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/XpandGeneratorProjectWizard.java

@@ -10,28 +10,15 @@
  */
 package org.yakindu.sct.generator.genmodel.ui.wizard;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
 import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
 
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchWizard;
-import org.eclipse.xtend.shared.ui.wizards.EclipseHelper;
 
 /**
  * 
@@ -41,7 +28,6 @@ public class XpandGeneratorProjectWizard extends Wizard implements
 		IWorkbenchWizard {
 
 	private XpandGeneratorWizardPage1 projectPage;
-	private final ProjectTemplate template = new ProjectTemplate();
 
 	public void init(IWorkbench workbench, IStructuredSelection selection) {
 		setWindowTitle("New YAKINDU Xpand Generator Project");
@@ -65,9 +51,11 @@ public class XpandGeneratorProjectWizard extends Wizard implements
 			public void run(final IProgressMonitor monitor)
 					throws InvocationTargetException {
 				try {
-					doCreateProject(projectData, monitor);
-				} catch (CoreException e) {
-					e.printStackTrace();
+					XpandProjectTemplate template = new XpandProjectTemplate();
+					template.setMonitor(monitor);
+					template.generate(projectData);
+				} catch (Exception e) {
+					throw new InvocationTargetException(e);
 				} finally {
 					monitor.done();
 				}
@@ -79,6 +67,7 @@ public class XpandGeneratorProjectWizard extends Wizard implements
 			return false;
 		} catch (final InvocationTargetException e) {
 			final Throwable realException = e.getTargetException();
+			realException.printStackTrace();
 			MessageDialog.openError(getShell(), "Failed to create project",
 					realException.getMessage());
 			return false;
@@ -86,78 +75,4 @@ public class XpandGeneratorProjectWizard extends Wizard implements
 		return true;
 	}
 
-	protected void doCreateProject(ProjectData projectData,
-			IProgressMonitor monitor) throws CoreException {
-		int ticks = projectData.pluginExport ? 10 : 7;
-		monitor.beginTask("Create YAKINDU Xpand Generator Project", ticks);
-
-		final IProject project = initProject(projectData.projectName,
-				projectData.pluginExport, monitor);
-
-		if (project == null) {
-			return;
-		}
-
-		projectData.project = project;
-
-		template.doGenerate(projectData, monitor);
-
-		project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
-	}
-
-	protected IProject initProject(String projectName, boolean pluginExport,
-			IProgressMonitor monitor) {
-		List<IProject> referencedProjects = Collections.emptyList();
-		List<String> exportedPackages = Collections.emptyList();
-		final List<String> srcFolders = new ArrayList<String>();
-		srcFolders.add("src"); //$NON-NLS-1$
-		srcFolders.add("src-gen"); //$NON-NLS-1$
-		final Set<String> requiredBundles = new HashSet<String>();
-		requiredBundles.add("org.eclipse.jdt.core;bundle-version=\"3.5.0\"");//$NON-NLS-1$
-		requiredBundles.add("org.apache.commons.logging");//$NON-NLS-1$
-		requiredBundles.add("org.apache.log4j;resolution:=optional");//$NON-NLS-1$
-		requiredBundles.add("org.eclipse.xtend.profiler;resolution:=optional");//$NON-NLS-1$
-		requiredBundles
-				.add("org.yakindu.sct.model.sexec;bundle-version=\"1.0.0\"");//$NON-NLS-1$
-		requiredBundles
-				.add("org.yakindu.sct.model.sgen;bundle-version=\"1.0.0\"");//$NON-NLS-1$
-		requiredBundles
-				.add("org.yakindu.sct.model.sgraph;bundle-version=\"1.0.0\"");//$NON-NLS-1$
-		requiredBundles
-				.add("org.yakindu.sct.model.stext;bundle-version=\"1.0.0\"");//$NON-NLS-1$
-		if (pluginExport) {
-			requiredBundles
-					.add("org.yakindu.sct.generator.core;bundle-version=\"1.0.0\"");//$NON-NLS-1$
-		}
-
-		IProject project = EclipseHelper.createExtXptProject(projectName,
-				srcFolders, referencedProjects, requiredBundles,
-				exportedPackages, new SubProgressMonitor(monitor, 3),
-				getShell());
-		return project;
-	}
-
-	public static String getResourceContents(final String resource,
-			String encoding) {
-		try {
-			final InputStream inputStream = XpandGeneratorProjectWizard.class
-					.getResourceAsStream(resource);
-			final byte[] buffer = new byte[4096];
-			final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-			while (true) {
-				int read;
-				read = inputStream.read(buffer);
-				if (read == -1) {
-					break;
-				}
-				outputStream.write(buffer, 0, read);
-			}
-			outputStream.close();
-			inputStream.close();
-			return outputStream.toString(encoding);
-		} catch (final IOException e) {
-			e.printStackTrace();
-			return "";
-		}
-	}
 }

+ 3 - 0
plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/XpandGeneratorWizardPage1.java

@@ -113,6 +113,7 @@ public class XpandGeneratorWizardPage1 extends WizardPage {
 		GridDataFactory.fillDefaults().grab(true, false)
 				.applyTo(txtGeneratorDesc);
 
+		// TODO : implement Feature Type Library generation
 		Label lblLibraryCheckBox = new Label(generatorGroup, SWT.WRAP);
 		lblLibraryCheckBox.setText("Create Fetaure Library");
 		lblLibraryCheckBox.setVisible(false);
@@ -183,6 +184,7 @@ public class XpandGeneratorWizardPage1 extends WizardPage {
 		txtGeneratorId.setEnabled(enabled);
 		txtGeneratorName.setEnabled(enabled);
 		txtGeneratorDesc.setEnabled(enabled);
+		txtGeneratorClass.setEnabled(enabled);
 		cbLibrary.setEnabled(enabled);
 	}
 
@@ -197,6 +199,7 @@ public class XpandGeneratorWizardPage1 extends WizardPage {
 		data.typeLibrary = cbLibrary.getSelection();
 		return data;
 	}
+
 	static abstract class SelectionListenerAdapter implements SelectionListener {
 
 		public void widgetDefaultSelected(SelectionEvent e) {

+ 349 - 0
plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/XpandProjectTemplate.xtend

@@ -0,0 +1,349 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.generator.genmodel.ui.wizard
+
+import org.eclipse.xtext.generator.IGenerator
+import org.eclipse.emf.ecore.resource.Resource
+import org.eclipse.xtext.generator.IFileSystemAccess
+import org.eclipse.core.runtime.IProgressMonitor
+import org.eclipse.core.resources.IContainer
+import org.eclipse.core.runtime.Path
+import org.eclipse.core.resources.IFolder
+import org.eclipse.core.resources.IResource
+import org.eclipse.xtend.shared.ui.wizards.EclipseHelper
+import org.eclipse.core.resources.ResourcesPlugin
+import org.apache.commons.lang.StringEscapeUtils
+import org.eclipse.jdt.core.JavaCore
+import org.eclipse.jdt.core.IJavaProject
+import org.eclipse.xtend.shared.ui.core.builder.XtendXpandNature
+import org.eclipse.core.resources.IProjectDescription
+import org.eclipse.xtend.shared.ui.core.builder.XtendXpandBuilder
+import org.eclipse.core.resources.IFile
+import org.eclipse.xtext.xtend2.lib.StringConcatenation
+import java.io.ByteArrayInputStream
+import org.eclipse.core.resources.IProject
+import org.eclipse.core.runtime.SubProgressMonitor
+import java.io.ByteArrayOutputStream
+import java.io.BufferedInputStream
+
+
+/**
+ * 
+ * @author holger willebrandt - Initial contribution and API
+ */
+class XpandProjectTemplate {
+	
+	IProgressMonitor monitor
+	
+	def setMonitor(IProgressMonitor monitor) {
+		this.monitor = monitor
+	}
+
+	def generate(ProjectData data) {
+		monitor.beginTask("Create YAKINDU Xpand Generator Project", 12);
+		val project = ResourcesPlugin::workspace.root.getProject(data.projectName);
+		project.create(monitor.sub)
+		project.open(monitor.sub)
+		monitor.worked(1)
+		project.createFolder('src')
+		project.getFile('.settings/org.eclipse.core.resources.prefs')
+			.write(data.projectSettings(ResourcesPlugin::encoding))
+		project.getFile('.settings/org.eclipse.xtend.shared.ui.prefs').write(data.xpandSettings)
+		project.getFile('build.properties').write(data.buildProperties)
+		project.getFile('META-INF/MANIFEST.MF').write(data.manifest)
+		project.getFile('src/'+data.targetPackage.asFolder+'/'+data.templateName+'.xpt').
+			write(resource('XpandDefaultTemplate.xpt'.fromMyFolder,'iso-8859-1'))
+		if (data.pluginExport) {
+			project.getFile('plugin.xml').write(data.plugin)
+			project.getFile('src/'+data.generatorClass.javaFilename).write(data.generator)
+			if (data.typeLibrary) {
+				project.createFolder('library')
+				//TODO create FeatureTypeLibrary.xmi
+			}	
+		}
+		project.getFile('.classpath').write(data.classpath);
+		project.getFile('.project').write(data.projectFile);
+	}
+	
+	def fromMyFolder(String s) {
+		'org/yakindu/sct/generator/genmodel/ui/wizard/'+s
+	}
+	
+	def sub(IProgressMonitor mon) {
+		new SubProgressMonitor(mon,1)
+	}
+	
+	def templateName(ProjectData data) {
+		if (data.pluginExport)
+			data.generatorClass.simpleName
+		else
+			'Main'
+	}
+	
+	def targetPackage(ProjectData data) {
+		if (data.pluginExport)
+			data.generatorClass.packageName
+		else
+			'org.yakindu.sct.generator.xpand'
+	}
+	
+	def asFolder(String s) {
+		s.replaceAll('\\.','/')
+	}
+	
+	def javaPathToXpand(String s) {
+		s.replaceAll('\\.','::')
+	}
+	
+	def simpleName(String s) {
+		s.substring(s.lastIndexOf('.')+1)
+	}
+	
+	def packageName(String s) {
+		s.substring(0, s.lastIndexOf('.'))	
+	}
+	
+	def providerClass(ProjectData data){
+		data.generatorClass+'DefaultValueProvider'
+	}
+	
+	def javaFilename(String s) {
+		s.replaceAll('\\.','/')+'.java'
+	}
+	
+	def write(IFile file, StringConcatenation content) {
+		file.write(content.toString)
+	}
+
+	def write(IFile file, String content) {
+		if (!file.parent.exists) {
+			createFolderHierarchy(file.parent as IFolder,monitor.sub)
+		}
+		val stream = new ByteArrayInputStream(content.getBytes(file.charset))
+		try {
+			if (file.exists) {
+				file.setContents(stream, true, true, monitor.sub)
+			} else {
+				val submonitor = monitor.sub
+				file.create(stream, true, submonitor)
+				file.setCharset(ResourcesPlugin::encoding, submonitor)
+			}
+		} catch (Exception e) {
+			e.printStackTrace
+		} finally{
+			stream.close();
+		}
+		monitor.worked(1)
+	}
+	
+	def createFolder(IContainer container, String folderPath) {
+		createFolderHierarchy(container.getFolder(new Path(folderPath)),monitor.sub);
+		monitor.worked(1)
+	}
+
+	 def createFolderHierarchy(IFolder folder, IProgressMonitor submonitor) {
+		if (!folder.exists) {
+			if (!folder.parent.exists
+					&& folder.parent.type == IResource::FOLDER) {
+				createFolderHierarchy(folder.parent as IFolder,submonitor);
+			}
+			folder.create(true, true, monitor);
+		}
+	}
+	
+	def escapeForXml(String s) {
+		StringEscapeUtils::escapeXml(s)
+	}
+	
+	def resource(String path, String encoding) {
+		val inStream = Thread::currentThread.contextClassLoader.getResourceAsStream(path)
+		val outStream = new ByteArrayOutputStream()
+		try {
+			val buffer = new BufferedInputStream(inStream)
+			var result=0;
+			while ((result=buffer.read) != -1 ) {
+				outStream.write(result as byte)
+			}
+			outStream.toString(encoding)
+		} finally {
+			inStream.close
+		}
+	}
+	
+	def projectFile(ProjectData data) '''
+		<?xml version="1.0" encoding="UTF-8"?>
+		<projectDescription>
+			<name>«data.projectName»</name>
+			<comment></comment>
+			<projects>
+			</projects>
+			<buildSpec>
+				<buildCommand>
+					<name>org.eclipse.xtend.shared.ui.xtendBuilder</name>
+					<arguments>
+					</arguments>
+				</buildCommand>
+				<buildCommand>
+					<name>org.eclipse.pde.ManifestBuilder</name>
+					<arguments>
+					</arguments>
+				</buildCommand>
+				<buildCommand>
+					<name>org.eclipse.pde.SchemaBuilder</name>
+					<arguments>
+					</arguments>
+				</buildCommand>
+				<buildCommand>
+					<name>org.eclipse.jdt.core.javabuilder</name>
+					<arguments>
+					</arguments>
+				</buildCommand>
+			</buildSpec>
+			<natures>
+				<nature>org.eclipse.jdt.core.javanature</nature>
+				<nature>org.eclipse.pde.PluginNature</nature>
+				<nature>org.eclipse.xtend.shared.ui.xtendXPandNature</nature>
+			</natures>
+		</projectDescription>
+	'''
+	
+	def classpath(ProjectData data) '''
+		<?xml version="1.0" encoding="UTF-8"?>
+		<classpath>
+			<classpathentry kind="src" path="src"/>
+			<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+			<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+			<classpathentry kind="output" path="bin"/>
+		</classpath>
+	'''
+	
+	def manifest(ProjectData data)'''
+		Manifest-Version: 1.0
+		Bundle-ManifestVersion: 2
+		Bundle-Name: «data.projectName»
+		Bundle-SymbolicName: «data.projectName»; singleton:=true
+		Bundle-Version: 1.0.0
+		Require-Bundle: org.eclipse.jdt.core;bundle-version="3.5.0",
+		 org.eclipse.xtend.profiler;resolution:=optional,
+		 org.apache.commons.logging,
+		 org.apache.log4j;resolution:=optional,
+		 com.ibm.icu;bundle-version="4.0.1",
+		 org.antlr.runtime;bundle-version="3.0.0",
+		 org.eclipse.core.runtime;bundle-version="3.5.0",
+		 org.eclipse.emf.mwe.utils;bundle-version="0.7.0",
+		 org.eclipse.emf.ecore.xmi;bundle-version="2.5.0",
+		 org.eclipse.jface.text;bundle-version="3.5.0",
+		 org.eclipse.xpand;bundle-version="0.7.0",
+		 org.eclipse.xtend;bundle-version="0.7.0",
+		 org.eclipse.xtend.typesystem.emf;bundle-version="0.7.0",
+		«IF data.pluginExport»
+			«' '»org.yakindu.sct.generator.core;bundle-version="1.0.0",
+		«ENDIF»
+		 org.yakindu.sct.model.sgen;bundle-version="1.0.0",
+		 org.yakindu.sct.model.sexec;bundle-version="1.0.0",
+		 org.yakindu.sct.model.stext;bundle-version="1.0.0",
+		 org.yakindu.sct.model.sgraph;bundle-version="1.0.0"
+		Bundle-RequiredExecutionEnvironment: J2SE-1.5
+	'''
+	
+	def plugin(ProjectData data) '''
+		<?xml version="1.0" encoding="UTF-8"?>
+		<?eclipse version="3.4"?>
+		<plugin>
+		   <extension
+		         point="org.yakindu.sct.generator.core.generator">
+		      <SCTGenerator class="«data.generatorClass»"
+		            description="«data.generatorDescription.escapeForXml»"
+		            id="«data.generatorId»"
+		            name="«data.generatorName.escapeForXml»">
+		      </SCTGenerator>
+		   </extension>
+		«IF data.typeLibrary»
+		   <extension
+		         point="org.yakindu.sct.generator.core.featuretypes">
+		      <FeatureLibrary generatorId="«data.generatorId»" 
+		      defaultProvider="«data.providerClass»"
+		            uri="platform:/plugin/«data.projectName»/library/FeatureTypeLibrary.xmi">
+		      </FeatureLibrary>
+		   </extension>
+		«ENDIF»   
+		</plugin>
+	'''
+	
+	def generator(ProjectData data) '''
+		package «data.generatorClass.packageName»;
+		
+		import org.yakindu.sct.generator.core.impl.AbstractXpandBasedCodeGenerator;
+		
+		/**
+		 * Generator using Xpand template "«data.generatorClass.javaPathToXpand»::main"
+		 */
+		public class «data.generatorClass.simpleName» extends AbstractXpandBasedCodeGenerator {
+		
+			@Override
+			public String getTemplatePath() {
+				return "«data.generatorClass.javaPathToXpand»::main";
+			}
+		}
+	'''
+	
+	def defaultProvider(ProjectData data) '''
+		package «data.providerClass.packageName»;
+		
+		import org.yakindu.sct.generator.core.features.AbstractDefaultFeatureValueProvider;
+		
+		/**
+		 * Default value proivder for «data.generatorName» feature library
+		 */
+		public class «data.providerClass.simpleName» extends AbstractDefaultFeatureValueProvider {
+		
+			private static final String LIBRARY_NAME = "«data.generatorName»";
+			
+			@Override
+			protected void setDefaultValue(FeatureParameterValue parameterValue,
+					Statechart statechart) {
+				String parameterName = parameterValue.getParameter().getName();
+				//TODO: set the default values
+			}
+		
+			public boolean isProviderFor(FeatureTypeLibrary library) {
+				return library.getName().equals(LIBRARY_NAME);
+			}
+		
+			public IStatus validateParameterValue(FeatureParameterValue value) {
+				String name = value.getParameter().getName();
+				//TODO implement validation
+				return Status.OK_STATUS;
+			}
+		}
+	'''
+	
+	def projectSettings(ProjectData data, String encoding) '''
+		eclipse.preferences.version=1
+		encoding/<project>=«encoding»
+	'''
+
+	def xpandSettings(ProjectData data) '''
+		eclipse.preferences.version=1
+		project.specific.metamodel=true
+		metamodelContributor=org.eclipse.xtend.typesystem.emf.ui.EmfMetamodelContributor
+	'''
+	
+	def buildProperties(ProjectData data) '''
+		source.. = src
+		«IF data.pluginExport»
+			bin.includes = META-INF/,.,plugin.xml
+		«ELSE»
+			bin.includes = META-INF/,.
+		«ENDIF»
+	'''
+	
+ }

+ 0 - 455
plugins/org.yakindu.sct.generator.genmodel.ui/xtend-gen/org/yakindu/sct/generator/genmodel/ui/wizard/ProjectTemplate.java

@@ -1,455 +0,0 @@
-package org.yakindu.sct.generator.genmodel.ui.wizard;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.xtend.shared.ui.wizards.EclipseHelper;
-import org.eclipse.xtext.xbase.lib.BooleanExtensions;
-import org.eclipse.xtext.xbase.lib.IntegerExtensions;
-import org.eclipse.xtext.xbase.lib.ObjectExtensions;
-import org.eclipse.xtext.xbase.lib.StringExtensions;
-import org.eclipse.xtext.xtend2.lib.StringConcatenation;
-import org.yakindu.sct.generator.genmodel.ui.wizard.ProjectData;
-import org.yakindu.sct.generator.genmodel.ui.wizard.XpandGeneratorProjectWizard;
-
-@SuppressWarnings("all")
-public class ProjectTemplate {
-  
-  public IFile doGenerate(final ProjectData data, final IProgressMonitor monitor) throws CoreException {
-    IFile _xblockexpression = null;
-    {
-      String _targetPackage = this.targetPackage(data);
-      String _asFolder = this.asFolder(_targetPackage);
-      String _operator_plus = StringExtensions.operator_plus("src/", _asFolder);
-      String folderPath = _operator_plus;
-      IProject _project = data.getProject();
-      this.createFolder(folderPath, _project, monitor);
-      IProject _project_1 = data.getProject();
-      Path _path = new Path(folderPath);
-      IFolder _folder = _project_1.getFolder(_path);
-      IFolder generatorFolder = _folder;
-      IProject _project_2 = data.getProject();
-      String _encoding = ResourcesPlugin.getEncoding();
-      StringConcatenation _projectSettings = this.projectSettings(data, _encoding);
-      String _string = _projectSettings.toString();
-      EclipseHelper.createFile(".settings/org.eclipse.core.resources.prefs", _project_2, _string, monitor);
-      IProject _project_3 = data.getProject();
-      StringConcatenation _xpandSettings = this.xpandSettings(data);
-      String _string_1 = _xpandSettings.toString();
-      EclipseHelper.createFile(".settings/org.eclipse.xtend.shared.ui.prefs", _project_3, _string_1, monitor);
-      String _templateName = this.templateName(data);
-      String _operator_plus_1 = StringExtensions.operator_plus(_templateName, ".xpt");
-      String _resource = this.resource("DefaultTemplate.xpt", "iso-8859-1");
-      EclipseHelper.createFile(_operator_plus_1, generatorFolder, _resource, monitor);
-      IFile _xifexpression = null;
-      boolean _isPluginExport = data.isPluginExport();
-      if (_isPluginExport) {
-        IFile _xblockexpression_1 = null;
-        {
-          IProject _project_4 = data.getProject();
-          StringConcatenation _plugin = this.plugin(data);
-          String _string_2 = _plugin.toString();
-          EclipseHelper.createFile("plugin.xml", _project_4, _string_2, monitor);
-          String _generatorClass = data.getGeneratorClass();
-          String _javaFilename = this.javaFilename(_generatorClass);
-          String _operator_plus_2 = StringExtensions.operator_plus("src/", _javaFilename);
-          IProject _project_5 = data.getProject();
-          StringConcatenation _generator = this.generator(data);
-          String _string_3 = _generator.toString();
-          EclipseHelper.createFile(_operator_plus_2, _project_5, _string_3, monitor);
-          boolean _isTypeLibrary = data.isTypeLibrary();
-          if (_isTypeLibrary) {
-            IProject _project_6 = data.getProject();
-            this.createFolder("library", _project_6, monitor);
-          }
-          IProject _project_7 = data.getProject();
-          StringConcatenation _buildProperties = this.buildProperties(data);
-          String _string_4 = _buildProperties.toString();
-          IFile _createFile = EclipseHelper.createFile("build.properties", _project_7, _string_4, monitor);
-          _xblockexpression_1 = (_createFile);
-        }
-        _xifexpression = _xblockexpression_1;
-      }
-      _xblockexpression = (_xifexpression);
-    }
-    return _xblockexpression;
-  }
-  
-  public String templateName(final ProjectData data) {
-    String _xifexpression = null;
-    boolean _isPluginExport = data.isPluginExport();
-    if (_isPluginExport) {
-      String _generatorClass = data.getGeneratorClass();
-      String _simpleName = this.simpleName(_generatorClass);
-      _xifexpression = _simpleName;
-    } else {
-      _xifexpression = "Main";
-    }
-    return _xifexpression;
-  }
-  
-  public String resource(final String name, final String encoding) {
-    String _resourceContents = XpandGeneratorProjectWizard.getResourceContents(name, encoding);
-    return _resourceContents;
-  }
-  
-  public String targetPackage(final ProjectData data) {
-    String _xifexpression = null;
-    boolean _isPluginExport = data.isPluginExport();
-    if (_isPluginExport) {
-      String _generatorClass = data.getGeneratorClass();
-      String _packageName = this.packageName(_generatorClass);
-      _xifexpression = _packageName;
-    } else {
-      _xifexpression = "org.yakindu.sct.generator.xpand";
-    }
-    return _xifexpression;
-  }
-  
-  public String asFolder(final String s) {
-    String _replaceAll = s.replaceAll("\\.", "/");
-    return _replaceAll;
-  }
-  
-  public String javaPathToXpand(final String s) {
-    String _replaceAll = s.replaceAll("\\.", "::");
-    return _replaceAll;
-  }
-  
-  public String simpleName(final String s) {
-    int _lastIndexOf = s.lastIndexOf(".");
-    int _operator_plus = IntegerExtensions.operator_plus(((Integer)_lastIndexOf), ((Integer)1));
-    String _substring = s.substring(_operator_plus);
-    return _substring;
-  }
-  
-  public String packageName(final String s) {
-    int _lastIndexOf = s.lastIndexOf(".");
-    String _substring = s.substring(0, _lastIndexOf);
-    return _substring;
-  }
-  
-  public String providerClass(final ProjectData data) {
-    String _generatorClass = data.getGeneratorClass();
-    String _operator_plus = StringExtensions.operator_plus(_generatorClass, "DefaultValueProvider");
-    return _operator_plus;
-  }
-  
-  public String javaFilename(final String s) {
-    String _replaceAll = s.replaceAll("\\.", "/");
-    String _operator_plus = StringExtensions.operator_plus(_replaceAll, ".java");
-    return _operator_plus;
-  }
-  
-  public Object createFolder(final String folderPath, final IContainer container, final IProgressMonitor monitor) throws CoreException {
-    Path _path = new Path(folderPath);
-    IFolder _folder = container.getFolder(_path);
-    Object _createFolderHierarchy = this.createFolderHierarchy(_folder, monitor);
-    return _createFolderHierarchy;
-  }
-  
-  public Object createFolderHierarchy(final IFolder folder, final IProgressMonitor monitor) throws CoreException {
-    Object _xifexpression = null;
-    boolean _exists = folder.exists();
-    boolean _operator_not = BooleanExtensions.operator_not(_exists);
-    if (_operator_not) {
-      {
-        boolean _operator_and = false;
-        IContainer _parent = folder.getParent();
-        boolean _exists_1 = _parent.exists();
-        boolean _operator_not_1 = BooleanExtensions.operator_not(_exists_1);
-        if (!_operator_not_1) {
-          _operator_and = false;
-        } else {
-          IContainer _parent_1 = folder.getParent();
-          int _type = _parent_1.getType();
-          boolean _operator_equals = ObjectExtensions.operator_equals(((Integer)_type), ((Integer)IResource.FOLDER));
-          _operator_and = BooleanExtensions.operator_and(_operator_not_1, _operator_equals);
-        }
-        if (_operator_and) {
-          IContainer _parent_2 = folder.getParent();
-          this.createFolderHierarchy(((IFolder) _parent_2), monitor);
-        }
-        folder.create(true, true, monitor);
-      }
-    }
-    return _xifexpression;
-  }
-  
-  public String escapeForXml(final String s) {
-    String _escapeXml = StringEscapeUtils.escapeXml(s);
-    return _escapeXml;
-  }
-  
-  public StringConcatenation plugin(final ProjectData data) {
-    StringConcatenation _builder = new StringConcatenation();
-    _builder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
-    _builder.newLine();
-    _builder.append("<?eclipse version=\"3.4\"?>");
-    _builder.newLine();
-    _builder.append("<plugin>");
-    _builder.newLine();
-    _builder.append("   ");
-    _builder.append("<extension");
-    _builder.newLine();
-    _builder.append("         ");
-    _builder.append("point=\"org.yakindu.sct.generator.core.generator\">");
-    _builder.newLine();
-    _builder.append("      ");
-    _builder.append("<SCTGenerator class=\"");
-    String _generatorClass = data.getGeneratorClass();
-    _builder.append(_generatorClass, "      ");
-    _builder.append("\"");
-    _builder.newLineIfNotEmpty();
-    _builder.append("            ");
-    _builder.append("description=\"");
-    String _generatorDescription = data.getGeneratorDescription();
-    String _escapeForXml = this.escapeForXml(_generatorDescription);
-    _builder.append(_escapeForXml, "            ");
-    _builder.append("\"");
-    _builder.newLineIfNotEmpty();
-    _builder.append("            ");
-    _builder.append("id=\"");
-    String _generatorId = data.getGeneratorId();
-    _builder.append(_generatorId, "            ");
-    _builder.append("\"");
-    _builder.newLineIfNotEmpty();
-    _builder.append("            ");
-    _builder.append("name=\"");
-    String _generatorName = data.getGeneratorName();
-    String _escapeForXml_1 = this.escapeForXml(_generatorName);
-    _builder.append(_escapeForXml_1, "            ");
-    _builder.append("\">");
-    _builder.newLineIfNotEmpty();
-    _builder.append("      ");
-    _builder.append("</SCTGenerator>");
-    _builder.newLine();
-    _builder.append("   ");
-    _builder.append("</extension>");
-    _builder.newLine();
-    {
-      boolean _isTypeLibrary = data.isTypeLibrary();
-      if (_isTypeLibrary) {
-        _builder.append("<extension");
-        _builder.newLine();
-        _builder.append("      ");
-        _builder.append("point=\"org.yakindu.sct.generator.core.featuretypes\">");
-        _builder.newLine();
-        _builder.append("   ");
-        _builder.append("<FeatureLibrary generatorId=\"");
-        String _generatorId_1 = data.getGeneratorId();
-        _builder.append(_generatorId_1, "   ");
-        _builder.append("\" ");
-        _builder.newLineIfNotEmpty();
-        _builder.append("   ");
-        _builder.append("defaultProvider=\"");
-        String _providerClass = this.providerClass(data);
-        _builder.append(_providerClass, "   ");
-        _builder.append("\"");
-        _builder.newLineIfNotEmpty();
-        _builder.append("         ");
-        _builder.append("uri=\"platform:/plugin/");
-        IProject _project = data.getProject();
-        String _name = _project.getName();
-        _builder.append(_name, "         ");
-        _builder.append("/library/FeatureTypeLibrary.xmi\">");
-        _builder.newLineIfNotEmpty();
-        _builder.append("   ");
-        _builder.append("</FeatureLibrary>");
-        _builder.newLine();
-        _builder.append("</extension>");
-        _builder.newLine();
-      }
-    }
-    _builder.append("</plugin>");
-    _builder.newLine();
-    return _builder;
-  }
-  
-  public StringConcatenation generator(final ProjectData data) {
-    StringConcatenation _builder = new StringConcatenation();
-    _builder.append("package ");
-    String _generatorClass = data.getGeneratorClass();
-    String _packageName = this.packageName(_generatorClass);
-    _builder.append(_packageName, "");
-    _builder.append(";");
-    _builder.newLineIfNotEmpty();
-    _builder.newLine();
-    _builder.append("import org.yakindu.sct.generator.core.impl.AbstractXpandBasedCodeGenerator;");
-    _builder.newLine();
-    _builder.newLine();
-    _builder.append("/**");
-    _builder.newLine();
-    _builder.append(" ");
-    _builder.append("* Generator using Xpand template \"");
-    String _generatorClass_1 = data.getGeneratorClass();
-    String _javaPathToXpand = this.javaPathToXpand(_generatorClass_1);
-    _builder.append(_javaPathToXpand, " ");
-    _builder.append("::main\"");
-    _builder.newLineIfNotEmpty();
-    _builder.append(" ");
-    _builder.append("*/");
-    _builder.newLine();
-    _builder.append("public class ");
-    String _generatorClass_2 = data.getGeneratorClass();
-    String _simpleName = this.simpleName(_generatorClass_2);
-    _builder.append(_simpleName, "");
-    _builder.append(" extends AbstractXpandBasedCodeGenerator {");
-    _builder.newLineIfNotEmpty();
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("@Override");
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("public String getTemplatePath() {");
-    _builder.newLine();
-    _builder.append("\t\t");
-    _builder.append("return \"");
-    String _generatorClass_3 = data.getGeneratorClass();
-    String _javaPathToXpand_1 = this.javaPathToXpand(_generatorClass_3);
-    _builder.append(_javaPathToXpand_1, "		");
-    _builder.append("::main\";");
-    _builder.newLineIfNotEmpty();
-    _builder.append("\t");
-    _builder.append("}");
-    _builder.newLine();
-    _builder.append("}");
-    _builder.newLine();
-    return _builder;
-  }
-  
-  public StringConcatenation defaultProvider(final ProjectData data) {
-    StringConcatenation _builder = new StringConcatenation();
-    _builder.append("package ");
-    String _providerClass = this.providerClass(data);
-    String _packageName = this.packageName(_providerClass);
-    _builder.append(_packageName, "");
-    _builder.append(";");
-    _builder.newLineIfNotEmpty();
-    _builder.newLine();
-    _builder.append("import org.yakindu.sct.generator.core.features.AbstractDefaultFeatureValueProvider;");
-    _builder.newLine();
-    _builder.newLine();
-    _builder.append("/**");
-    _builder.newLine();
-    _builder.append(" ");
-    _builder.append("* Default value proivder for ");
-    String _generatorName = data.getGeneratorName();
-    _builder.append(_generatorName, " ");
-    _builder.append(" feature library");
-    _builder.newLineIfNotEmpty();
-    _builder.append(" ");
-    _builder.append("*/");
-    _builder.newLine();
-    _builder.append("public class ");
-    String _providerClass_1 = this.providerClass(data);
-    String _simpleName = this.simpleName(_providerClass_1);
-    _builder.append(_simpleName, "");
-    _builder.append(" extends AbstractDefaultFeatureValueProvider {");
-    _builder.newLineIfNotEmpty();
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("private static final String LIBRARY_NAME = \"");
-    String _generatorName_1 = data.getGeneratorName();
-    _builder.append(_generatorName_1, "	");
-    _builder.append("\";");
-    _builder.newLineIfNotEmpty();
-    _builder.append("\t");
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("@Override");
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("protected void setDefaultValue(FeatureParameterValue parameterValue,");
-    _builder.newLine();
-    _builder.append("\t\t\t");
-    _builder.append("Statechart statechart) {");
-    _builder.newLine();
-    _builder.append("\t\t");
-    _builder.append("String parameterName = parameterValue.getParameter().getName();");
-    _builder.newLine();
-    _builder.append("\t\t");
-    _builder.append("//TODO: set the default values");
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("}");
-    _builder.newLine();
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("public boolean isProviderFor(FeatureTypeLibrary library) {");
-    _builder.newLine();
-    _builder.append("\t\t");
-    _builder.append("return library.getName().equals(LIBRARY_NAME);");
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("}");
-    _builder.newLine();
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("public IStatus validateParameterValue(FeatureParameterValue value) {");
-    _builder.newLine();
-    _builder.append("\t\t");
-    _builder.append("String name = value.getParameter().getName();");
-    _builder.newLine();
-    _builder.append("\t\t");
-    _builder.append("//TODO implement validation");
-    _builder.newLine();
-    _builder.append("\t\t");
-    _builder.append("return Status.OK_STATUS;");
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("}");
-    _builder.newLine();
-    _builder.append("}");
-    _builder.newLine();
-    return _builder;
-  }
-  
-  public StringConcatenation projectSettings(final ProjectData data, final String encoding) {
-    StringConcatenation _builder = new StringConcatenation();
-    _builder.append("eclipse.preferences.version=1");
-    _builder.newLine();
-    _builder.append("encoding/<project>=");
-    _builder.append(encoding, "");
-    _builder.newLineIfNotEmpty();
-    _builder.newLine();
-    return _builder;
-  }
-  
-  public StringConcatenation xpandSettings(final ProjectData data) {
-    StringConcatenation _builder = new StringConcatenation();
-    _builder.append("eclipse.preferences.version=1");
-    _builder.newLine();
-    _builder.append("project.specific.metamodel=true");
-    _builder.newLine();
-    _builder.append("metamodelContributor=org.eclipse.xtend.typesystem.emf.ui.EmfMetamodelContributor");
-    _builder.newLine();
-    _builder.newLine();
-    return _builder;
-  }
-  
-  public StringConcatenation buildProperties(final ProjectData data) {
-    StringConcatenation _builder = new StringConcatenation();
-    _builder.append("source.. = src/,\\");
-    _builder.newLine();
-    _builder.append("           ");
-    _builder.append("src-gen");
-    _builder.newLine();
-    _builder.append("bin.includes = META-INF/,\\");
-    _builder.newLine();
-    _builder.append("               ");
-    _builder.append(".,\\");
-    _builder.newLine();
-    _builder.append("               ");
-    _builder.append("plugin.xml");
-    _builder.newLine();
-    return _builder;
-  }
-}

+ 770 - 0
plugins/org.yakindu.sct.generator.genmodel.ui/xtend-gen/org/yakindu/sct/generator/genmodel/ui/wizard/XpandProjectTemplate.java

@@ -0,0 +1,770 @@
+package org.yakindu.sct.generator.genmodel.ui.wizard;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.xtext.xbase.lib.BooleanExtensions;
+import org.eclipse.xtext.xbase.lib.IntegerExtensions;
+import org.eclipse.xtext.xbase.lib.ObjectExtensions;
+import org.eclipse.xtext.xbase.lib.StringExtensions;
+import org.eclipse.xtext.xtend2.lib.StringConcatenation;
+import org.yakindu.sct.generator.genmodel.ui.wizard.ProjectData;
+
+@SuppressWarnings("all")
+public class XpandProjectTemplate {
+  
+  private IProgressMonitor monitor;
+  
+  public IProgressMonitor setMonitor(final IProgressMonitor monitor) {
+    IProgressMonitor _monitor = this.monitor = monitor;
+    return _monitor;
+  }
+  
+  public void generate(final ProjectData data) throws IOException, UnsupportedEncodingException, CoreException {
+    {
+      this.monitor.beginTask("Create YAKINDU Xpand Generator Project", 12);
+      IWorkspace _workspace = ResourcesPlugin.getWorkspace();
+      IWorkspaceRoot _root = _workspace.getRoot();
+      String _projectName = data.getProjectName();
+      IProject _project = _root.getProject(_projectName);
+      final IProject project = _project;
+      SubProgressMonitor _sub = this.sub(this.monitor);
+      project.create(_sub);
+      SubProgressMonitor _sub_1 = this.sub(this.monitor);
+      project.open(_sub_1);
+      this.monitor.worked(1);
+      this.createFolder(project, "src");
+      IFile _file = project.getFile(".settings/org.eclipse.core.resources.prefs");
+      String _encoding = ResourcesPlugin.getEncoding();
+      StringConcatenation _projectSettings = this.projectSettings(data, _encoding);
+      this.write(_file, _projectSettings);
+      IFile _file_1 = project.getFile(".settings/org.eclipse.xtend.shared.ui.prefs");
+      StringConcatenation _xpandSettings = this.xpandSettings(data);
+      this.write(_file_1, _xpandSettings);
+      IFile _file_2 = project.getFile("build.properties");
+      StringConcatenation _buildProperties = this.buildProperties(data);
+      this.write(_file_2, _buildProperties);
+      IFile _file_3 = project.getFile("META-INF/MANIFEST.MF");
+      StringConcatenation _manifest = this.manifest(data);
+      this.write(_file_3, _manifest);
+      String _targetPackage = this.targetPackage(data);
+      String _asFolder = this.asFolder(_targetPackage);
+      String _operator_plus = StringExtensions.operator_plus("src/", _asFolder);
+      String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, "/");
+      String _templateName = this.templateName(data);
+      String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, _templateName);
+      String _operator_plus_3 = StringExtensions.operator_plus(_operator_plus_2, ".xpt");
+      IFile _file_4 = project.getFile(_operator_plus_3);
+      String _fromMyFolder = this.fromMyFolder("XpandDefaultTemplate.xpt");
+      String _resource = this.resource(_fromMyFolder, "iso-8859-1");
+      this.write(_file_4, _resource);
+      boolean _isPluginExport = data.isPluginExport();
+      if (_isPluginExport) {
+        {
+          IFile _file_5 = project.getFile("plugin.xml");
+          StringConcatenation _plugin = this.plugin(data);
+          this.write(_file_5, _plugin);
+          String _generatorClass = data.getGeneratorClass();
+          String _javaFilename = this.javaFilename(_generatorClass);
+          String _operator_plus_4 = StringExtensions.operator_plus("src/", _javaFilename);
+          IFile _file_6 = project.getFile(_operator_plus_4);
+          StringConcatenation _generator = this.generator(data);
+          this.write(_file_6, _generator);
+          boolean _isTypeLibrary = data.isTypeLibrary();
+          if (_isTypeLibrary) {
+            this.createFolder(project, "library");
+          }
+        }
+      }
+      IFile _file_7 = project.getFile(".classpath");
+      StringConcatenation _classpath = this.classpath(data);
+      this.write(_file_7, _classpath);
+      IFile _file_8 = project.getFile(".project");
+      StringConcatenation _projectFile = this.projectFile(data);
+      this.write(_file_8, _projectFile);
+    }
+  }
+  
+  public String fromMyFolder(final String s) {
+    String _operator_plus = StringExtensions.operator_plus("org/yakindu/sct/generator/genmodel/ui/wizard/", s);
+    return _operator_plus;
+  }
+  
+  public SubProgressMonitor sub(final IProgressMonitor mon) {
+    SubProgressMonitor _subProgressMonitor = new SubProgressMonitor(mon, 1);
+    return _subProgressMonitor;
+  }
+  
+  public String templateName(final ProjectData data) {
+    String _xifexpression = null;
+    boolean _isPluginExport = data.isPluginExport();
+    if (_isPluginExport) {
+      String _generatorClass = data.getGeneratorClass();
+      String _simpleName = this.simpleName(_generatorClass);
+      _xifexpression = _simpleName;
+    } else {
+      _xifexpression = "Main";
+    }
+    return _xifexpression;
+  }
+  
+  public String targetPackage(final ProjectData data) {
+    String _xifexpression = null;
+    boolean _isPluginExport = data.isPluginExport();
+    if (_isPluginExport) {
+      String _generatorClass = data.getGeneratorClass();
+      String _packageName = this.packageName(_generatorClass);
+      _xifexpression = _packageName;
+    } else {
+      _xifexpression = "org.yakindu.sct.generator.xpand";
+    }
+    return _xifexpression;
+  }
+  
+  public String asFolder(final String s) {
+    String _replaceAll = s.replaceAll("\\.", "/");
+    return _replaceAll;
+  }
+  
+  public String javaPathToXpand(final String s) {
+    String _replaceAll = s.replaceAll("\\.", "::");
+    return _replaceAll;
+  }
+  
+  public String simpleName(final String s) {
+    int _lastIndexOf = s.lastIndexOf(".");
+    int _operator_plus = IntegerExtensions.operator_plus(((Integer)_lastIndexOf), ((Integer)1));
+    String _substring = s.substring(_operator_plus);
+    return _substring;
+  }
+  
+  public String packageName(final String s) {
+    int _lastIndexOf = s.lastIndexOf(".");
+    String _substring = s.substring(0, _lastIndexOf);
+    return _substring;
+  }
+  
+  public String providerClass(final ProjectData data) {
+    String _generatorClass = data.getGeneratorClass();
+    String _operator_plus = StringExtensions.operator_plus(_generatorClass, "DefaultValueProvider");
+    return _operator_plus;
+  }
+  
+  public String javaFilename(final String s) {
+    String _replaceAll = s.replaceAll("\\.", "/");
+    String _operator_plus = StringExtensions.operator_plus(_replaceAll, ".java");
+    return _operator_plus;
+  }
+  
+  public void write(final IFile file, final StringConcatenation content) throws IOException, UnsupportedEncodingException, CoreException {
+    String _string = content.toString();
+    this.write(file, _string);
+  }
+  
+  public void write(final IFile file, final String content) throws IOException, UnsupportedEncodingException, CoreException {
+    {
+      IContainer _parent = file.getParent();
+      boolean _exists = _parent.exists();
+      boolean _operator_not = BooleanExtensions.operator_not(_exists);
+      if (_operator_not) {
+        IContainer _parent_1 = file.getParent();
+        SubProgressMonitor _sub = this.sub(this.monitor);
+        this.createFolderHierarchy(((IFolder) _parent_1), _sub);
+      }
+      String _charset = file.getCharset();
+      byte[] _bytes = content.getBytes(_charset);
+      ByteArrayInputStream _byteArrayInputStream = new ByteArrayInputStream(_bytes);
+      final ByteArrayInputStream stream = _byteArrayInputStream;
+      try {
+        boolean _exists_1 = file.exists();
+        if (_exists_1) {
+          SubProgressMonitor _sub_1 = this.sub(this.monitor);
+          file.setContents(stream, true, true, _sub_1);
+        } else {
+          {
+            SubProgressMonitor _sub_2 = this.sub(this.monitor);
+            final SubProgressMonitor submonitor = _sub_2;
+            file.create(stream, true, submonitor);
+            String _encoding = ResourcesPlugin.getEncoding();
+            file.setCharset(_encoding, submonitor);
+          }
+        }
+      } catch (final Exception e) { 
+        e.printStackTrace();
+      } finally {
+        stream.close();
+      }
+      this.monitor.worked(1);
+    }
+  }
+  
+  public void createFolder(final IContainer container, final String folderPath) throws CoreException {
+    {
+      Path _path = new Path(folderPath);
+      IFolder _folder = container.getFolder(_path);
+      SubProgressMonitor _sub = this.sub(this.monitor);
+      this.createFolderHierarchy(_folder, _sub);
+      this.monitor.worked(1);
+    }
+  }
+  
+  public Object createFolderHierarchy(final IFolder folder, final IProgressMonitor submonitor) throws CoreException {
+    Object _xifexpression = null;
+    boolean _exists = folder.exists();
+    boolean _operator_not = BooleanExtensions.operator_not(_exists);
+    if (_operator_not) {
+      {
+        boolean _operator_and = false;
+        IContainer _parent = folder.getParent();
+        boolean _exists_1 = _parent.exists();
+        boolean _operator_not_1 = BooleanExtensions.operator_not(_exists_1);
+        if (!_operator_not_1) {
+          _operator_and = false;
+        } else {
+          IContainer _parent_1 = folder.getParent();
+          int _type = _parent_1.getType();
+          boolean _operator_equals = ObjectExtensions.operator_equals(((Integer)_type), ((Integer)IResource.FOLDER));
+          _operator_and = BooleanExtensions.operator_and(_operator_not_1, _operator_equals);
+        }
+        if (_operator_and) {
+          IContainer _parent_2 = folder.getParent();
+          this.createFolderHierarchy(((IFolder) _parent_2), submonitor);
+        }
+        folder.create(true, true, this.monitor);
+      }
+    }
+    return _xifexpression;
+  }
+  
+  public String escapeForXml(final String s) {
+    String _escapeXml = StringEscapeUtils.escapeXml(s);
+    return _escapeXml;
+  }
+  
+  public String resource(final String path, final String encoding) throws IOException, UnsupportedEncodingException {
+    String _xblockexpression = null;
+    {
+      Thread _currentThread = Thread.currentThread();
+      ClassLoader _contextClassLoader = _currentThread.getContextClassLoader();
+      InputStream _resourceAsStream = _contextClassLoader.getResourceAsStream(path);
+      final InputStream inStream = _resourceAsStream;
+      ByteArrayOutputStream _byteArrayOutputStream = new ByteArrayOutputStream();
+      final ByteArrayOutputStream outStream = _byteArrayOutputStream;
+      String _xtrycatchfinallyexpression = null;
+      try {
+        String _xblockexpression_1 = null;
+        {
+          BufferedInputStream _bufferedInputStream = new BufferedInputStream(inStream);
+          final BufferedInputStream buffer = _bufferedInputStream;
+          int result = 0;
+          int _read = buffer.read();
+          int _result = result = _read;
+          int _operator_minus = IntegerExtensions.operator_minus(1);
+          boolean _operator_notEquals = ObjectExtensions.operator_notEquals(((Integer)_result), ((Integer)_operator_minus));
+          Boolean _xwhileexpression = _operator_notEquals;
+          while (_xwhileexpression) {
+            outStream.write(((byte) result));
+            int _read_1 = buffer.read();
+            int _result_1 = result = _read_1;
+            int _operator_minus_1 = IntegerExtensions.operator_minus(1);
+            boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(((Integer)_result_1), ((Integer)_operator_minus_1));
+            _xwhileexpression = _operator_notEquals_1;
+          }
+          String _string = outStream.toString(encoding);
+          _xblockexpression_1 = (_string);
+        }
+        _xtrycatchfinallyexpression = _xblockexpression_1;
+      } finally {
+        inStream.close();
+      }
+      _xblockexpression = (_xtrycatchfinallyexpression);
+    }
+    return _xblockexpression;
+  }
+  
+  public StringConcatenation projectFile(final ProjectData data) {
+    StringConcatenation _builder = new StringConcatenation();
+    _builder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+    _builder.newLine();
+    _builder.append("<projectDescription>");
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("<name>");
+    String _projectName = data.getProjectName();
+    _builder.append(_projectName, "	");
+    _builder.append("</name>");
+    _builder.newLineIfNotEmpty();
+    _builder.append("\t");
+    _builder.append("<comment></comment>");
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("<projects>");
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("</projects>");
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("<buildSpec>");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("<buildCommand>");
+    _builder.newLine();
+    _builder.append("\t\t\t");
+    _builder.append("<name>org.eclipse.xtend.shared.ui.xtendBuilder</name>");
+    _builder.newLine();
+    _builder.append("\t\t\t");
+    _builder.append("<arguments>");
+    _builder.newLine();
+    _builder.append("\t\t\t");
+    _builder.append("</arguments>");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("</buildCommand>");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("<buildCommand>");
+    _builder.newLine();
+    _builder.append("\t\t\t");
+    _builder.append("<name>org.eclipse.pde.ManifestBuilder</name>");
+    _builder.newLine();
+    _builder.append("\t\t\t");
+    _builder.append("<arguments>");
+    _builder.newLine();
+    _builder.append("\t\t\t");
+    _builder.append("</arguments>");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("</buildCommand>");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("<buildCommand>");
+    _builder.newLine();
+    _builder.append("\t\t\t");
+    _builder.append("<name>org.eclipse.pde.SchemaBuilder</name>");
+    _builder.newLine();
+    _builder.append("\t\t\t");
+    _builder.append("<arguments>");
+    _builder.newLine();
+    _builder.append("\t\t\t");
+    _builder.append("</arguments>");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("</buildCommand>");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("<buildCommand>");
+    _builder.newLine();
+    _builder.append("\t\t\t");
+    _builder.append("<name>org.eclipse.jdt.core.javabuilder</name>");
+    _builder.newLine();
+    _builder.append("\t\t\t");
+    _builder.append("<arguments>");
+    _builder.newLine();
+    _builder.append("\t\t\t");
+    _builder.append("</arguments>");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("</buildCommand>");
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("</buildSpec>");
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("<natures>");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("<nature>org.eclipse.jdt.core.javanature</nature>");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("<nature>org.eclipse.pde.PluginNature</nature>");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("<nature>org.eclipse.xtend.shared.ui.xtendXPandNature</nature>");
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("</natures>");
+    _builder.newLine();
+    _builder.append("</projectDescription>");
+    _builder.newLine();
+    return _builder;
+  }
+  
+  public StringConcatenation classpath(final ProjectData data) {
+    StringConcatenation _builder = new StringConcatenation();
+    _builder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+    _builder.newLine();
+    _builder.append("<classpath>");
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("<classpathentry kind=\"src\" path=\"src\"/>");
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("<classpathentry kind=\"con\" path=\"org.eclipse.jdt.launching.JRE_CONTAINER\"/>");
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("<classpathentry kind=\"con\" path=\"org.eclipse.pde.core.requiredPlugins\"/>");
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("<classpathentry kind=\"output\" path=\"bin\"/>");
+    _builder.newLine();
+    _builder.append("</classpath>");
+    _builder.newLine();
+    return _builder;
+  }
+  
+  public StringConcatenation manifest(final ProjectData data) {
+    StringConcatenation _builder = new StringConcatenation();
+    _builder.append("Manifest-Version: 1.0");
+    _builder.newLine();
+    _builder.append("Bundle-ManifestVersion: 2");
+    _builder.newLine();
+    _builder.append("Bundle-Name: ");
+    String _projectName = data.getProjectName();
+    _builder.append(_projectName, "");
+    _builder.newLineIfNotEmpty();
+    _builder.append("Bundle-SymbolicName: ");
+    String _projectName_1 = data.getProjectName();
+    _builder.append(_projectName_1, "");
+    _builder.append("; singleton:=true");
+    _builder.newLineIfNotEmpty();
+    _builder.append("Bundle-Version: 1.0.0");
+    _builder.newLine();
+    _builder.append("Require-Bundle: org.eclipse.jdt.core;bundle-version=\"3.5.0\",");
+    _builder.newLine();
+    _builder.append(" ");
+    _builder.append("org.eclipse.xtend.profiler;resolution:=optional,");
+    _builder.newLine();
+    _builder.append(" ");
+    _builder.append("org.apache.commons.logging,");
+    _builder.newLine();
+    _builder.append(" ");
+    _builder.append("org.apache.log4j;resolution:=optional,");
+    _builder.newLine();
+    _builder.append(" ");
+    _builder.append("com.ibm.icu;bundle-version=\"4.0.1\",");
+    _builder.newLine();
+    _builder.append(" ");
+    _builder.append("org.antlr.runtime;bundle-version=\"3.0.0\",");
+    _builder.newLine();
+    _builder.append(" ");
+    _builder.append("org.eclipse.core.runtime;bundle-version=\"3.5.0\",");
+    _builder.newLine();
+    _builder.append(" ");
+    _builder.append("org.eclipse.emf.mwe.utils;bundle-version=\"0.7.0\",");
+    _builder.newLine();
+    _builder.append(" ");
+    _builder.append("org.eclipse.emf.ecore.xmi;bundle-version=\"2.5.0\",");
+    _builder.newLine();
+    _builder.append(" ");
+    _builder.append("org.eclipse.jface.text;bundle-version=\"3.5.0\",");
+    _builder.newLine();
+    _builder.append(" ");
+    _builder.append("org.eclipse.xpand;bundle-version=\"0.7.0\",");
+    _builder.newLine();
+    _builder.append(" ");
+    _builder.append("org.eclipse.xtend;bundle-version=\"0.7.0\",");
+    _builder.newLine();
+    _builder.append(" ");
+    _builder.append("org.eclipse.xtend.typesystem.emf;bundle-version=\"0.7.0\",");
+    _builder.newLine();
+    {
+      boolean _isPluginExport = data.isPluginExport();
+      if (_isPluginExport) {
+        _builder.append(" ", "");
+        _builder.append("org.yakindu.sct.generator.core;bundle-version=\"1.0.0\",");
+        _builder.newLineIfNotEmpty();
+      }
+    }
+    _builder.append(" ");
+    _builder.append("org.yakindu.sct.model.sgen;bundle-version=\"1.0.0\",");
+    _builder.newLine();
+    _builder.append(" ");
+    _builder.append("org.yakindu.sct.model.sexec;bundle-version=\"1.0.0\",");
+    _builder.newLine();
+    _builder.append(" ");
+    _builder.append("org.yakindu.sct.model.stext;bundle-version=\"1.0.0\",");
+    _builder.newLine();
+    _builder.append(" ");
+    _builder.append("org.yakindu.sct.model.sgraph;bundle-version=\"1.0.0\"");
+    _builder.newLine();
+    _builder.append("Bundle-RequiredExecutionEnvironment: J2SE-1.5");
+    _builder.newLine();
+    return _builder;
+  }
+  
+  public StringConcatenation plugin(final ProjectData data) {
+    StringConcatenation _builder = new StringConcatenation();
+    _builder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+    _builder.newLine();
+    _builder.append("<?eclipse version=\"3.4\"?>");
+    _builder.newLine();
+    _builder.append("<plugin>");
+    _builder.newLine();
+    _builder.append("   ");
+    _builder.append("<extension");
+    _builder.newLine();
+    _builder.append("         ");
+    _builder.append("point=\"org.yakindu.sct.generator.core.generator\">");
+    _builder.newLine();
+    _builder.append("      ");
+    _builder.append("<SCTGenerator class=\"");
+    String _generatorClass = data.getGeneratorClass();
+    _builder.append(_generatorClass, "      ");
+    _builder.append("\"");
+    _builder.newLineIfNotEmpty();
+    _builder.append("            ");
+    _builder.append("description=\"");
+    String _generatorDescription = data.getGeneratorDescription();
+    String _escapeForXml = this.escapeForXml(_generatorDescription);
+    _builder.append(_escapeForXml, "            ");
+    _builder.append("\"");
+    _builder.newLineIfNotEmpty();
+    _builder.append("            ");
+    _builder.append("id=\"");
+    String _generatorId = data.getGeneratorId();
+    _builder.append(_generatorId, "            ");
+    _builder.append("\"");
+    _builder.newLineIfNotEmpty();
+    _builder.append("            ");
+    _builder.append("name=\"");
+    String _generatorName = data.getGeneratorName();
+    String _escapeForXml_1 = this.escapeForXml(_generatorName);
+    _builder.append(_escapeForXml_1, "            ");
+    _builder.append("\">");
+    _builder.newLineIfNotEmpty();
+    _builder.append("      ");
+    _builder.append("</SCTGenerator>");
+    _builder.newLine();
+    _builder.append("   ");
+    _builder.append("</extension>");
+    _builder.newLine();
+    {
+      boolean _isTypeLibrary = data.isTypeLibrary();
+      if (_isTypeLibrary) {
+        _builder.append("<extension");
+        _builder.newLine();
+        _builder.append("      ");
+        _builder.append("point=\"org.yakindu.sct.generator.core.featuretypes\">");
+        _builder.newLine();
+        _builder.append("   ");
+        _builder.append("<FeatureLibrary generatorId=\"");
+        String _generatorId_1 = data.getGeneratorId();
+        _builder.append(_generatorId_1, "   ");
+        _builder.append("\" ");
+        _builder.newLineIfNotEmpty();
+        _builder.append("   ");
+        _builder.append("defaultProvider=\"");
+        String _providerClass = this.providerClass(data);
+        _builder.append(_providerClass, "   ");
+        _builder.append("\"");
+        _builder.newLineIfNotEmpty();
+        _builder.append("         ");
+        _builder.append("uri=\"platform:/plugin/");
+        String _projectName = data.getProjectName();
+        _builder.append(_projectName, "         ");
+        _builder.append("/library/FeatureTypeLibrary.xmi\">");
+        _builder.newLineIfNotEmpty();
+        _builder.append("   ");
+        _builder.append("</FeatureLibrary>");
+        _builder.newLine();
+        _builder.append("</extension>");
+        _builder.newLine();
+      }
+    }
+    _builder.append("</plugin>");
+    _builder.newLine();
+    return _builder;
+  }
+  
+  public StringConcatenation generator(final ProjectData data) {
+    StringConcatenation _builder = new StringConcatenation();
+    _builder.append("package ");
+    String _generatorClass = data.getGeneratorClass();
+    String _packageName = this.packageName(_generatorClass);
+    _builder.append(_packageName, "");
+    _builder.append(";");
+    _builder.newLineIfNotEmpty();
+    _builder.newLine();
+    _builder.append("import org.yakindu.sct.generator.core.impl.AbstractXpandBasedCodeGenerator;");
+    _builder.newLine();
+    _builder.newLine();
+    _builder.append("/**");
+    _builder.newLine();
+    _builder.append(" ");
+    _builder.append("* Generator using Xpand template \"");
+    String _generatorClass_1 = data.getGeneratorClass();
+    String _javaPathToXpand = this.javaPathToXpand(_generatorClass_1);
+    _builder.append(_javaPathToXpand, " ");
+    _builder.append("::main\"");
+    _builder.newLineIfNotEmpty();
+    _builder.append(" ");
+    _builder.append("*/");
+    _builder.newLine();
+    _builder.append("public class ");
+    String _generatorClass_2 = data.getGeneratorClass();
+    String _simpleName = this.simpleName(_generatorClass_2);
+    _builder.append(_simpleName, "");
+    _builder.append(" extends AbstractXpandBasedCodeGenerator {");
+    _builder.newLineIfNotEmpty();
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("@Override");
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("public String getTemplatePath() {");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("return \"");
+    String _generatorClass_3 = data.getGeneratorClass();
+    String _javaPathToXpand_1 = this.javaPathToXpand(_generatorClass_3);
+    _builder.append(_javaPathToXpand_1, "		");
+    _builder.append("::main\";");
+    _builder.newLineIfNotEmpty();
+    _builder.append("\t");
+    _builder.append("}");
+    _builder.newLine();
+    _builder.append("}");
+    _builder.newLine();
+    return _builder;
+  }
+  
+  public StringConcatenation defaultProvider(final ProjectData data) {
+    StringConcatenation _builder = new StringConcatenation();
+    _builder.append("package ");
+    String _providerClass = this.providerClass(data);
+    String _packageName = this.packageName(_providerClass);
+    _builder.append(_packageName, "");
+    _builder.append(";");
+    _builder.newLineIfNotEmpty();
+    _builder.newLine();
+    _builder.append("import org.yakindu.sct.generator.core.features.AbstractDefaultFeatureValueProvider;");
+    _builder.newLine();
+    _builder.newLine();
+    _builder.append("/**");
+    _builder.newLine();
+    _builder.append(" ");
+    _builder.append("* Default value proivder for ");
+    String _generatorName = data.getGeneratorName();
+    _builder.append(_generatorName, " ");
+    _builder.append(" feature library");
+    _builder.newLineIfNotEmpty();
+    _builder.append(" ");
+    _builder.append("*/");
+    _builder.newLine();
+    _builder.append("public class ");
+    String _providerClass_1 = this.providerClass(data);
+    String _simpleName = this.simpleName(_providerClass_1);
+    _builder.append(_simpleName, "");
+    _builder.append(" extends AbstractDefaultFeatureValueProvider {");
+    _builder.newLineIfNotEmpty();
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("private static final String LIBRARY_NAME = \"");
+    String _generatorName_1 = data.getGeneratorName();
+    _builder.append(_generatorName_1, "	");
+    _builder.append("\";");
+    _builder.newLineIfNotEmpty();
+    _builder.append("\t");
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("@Override");
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("protected void setDefaultValue(FeatureParameterValue parameterValue,");
+    _builder.newLine();
+    _builder.append("\t\t\t");
+    _builder.append("Statechart statechart) {");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("String parameterName = parameterValue.getParameter().getName();");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("//TODO: set the default values");
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("}");
+    _builder.newLine();
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("public boolean isProviderFor(FeatureTypeLibrary library) {");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("return library.getName().equals(LIBRARY_NAME);");
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("}");
+    _builder.newLine();
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("public IStatus validateParameterValue(FeatureParameterValue value) {");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("String name = value.getParameter().getName();");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("//TODO implement validation");
+    _builder.newLine();
+    _builder.append("\t\t");
+    _builder.append("return Status.OK_STATUS;");
+    _builder.newLine();
+    _builder.append("\t");
+    _builder.append("}");
+    _builder.newLine();
+    _builder.append("}");
+    _builder.newLine();
+    return _builder;
+  }
+  
+  public StringConcatenation projectSettings(final ProjectData data, final String encoding) {
+    StringConcatenation _builder = new StringConcatenation();
+    _builder.append("eclipse.preferences.version=1");
+    _builder.newLine();
+    _builder.append("encoding/<project>=");
+    _builder.append(encoding, "");
+    _builder.newLineIfNotEmpty();
+    return _builder;
+  }
+  
+  public StringConcatenation xpandSettings(final ProjectData data) {
+    StringConcatenation _builder = new StringConcatenation();
+    _builder.append("eclipse.preferences.version=1");
+    _builder.newLine();
+    _builder.append("project.specific.metamodel=true");
+    _builder.newLine();
+    _builder.append("metamodelContributor=org.eclipse.xtend.typesystem.emf.ui.EmfMetamodelContributor");
+    _builder.newLine();
+    return _builder;
+  }
+  
+  public StringConcatenation buildProperties(final ProjectData data) {
+    StringConcatenation _builder = new StringConcatenation();
+    _builder.append("source.. = src");
+    _builder.newLine();
+    {
+      boolean _isPluginExport = data.isPluginExport();
+      if (_isPluginExport) {
+        _builder.append("bin.includes = META-INF/,.,plugin.xml");
+        _builder.newLine();} else {
+        _builder.append("bin.includes = META-INF/,.");
+        _builder.newLine();
+      }
+    }
+    return _builder;
+  }
+}