public void doGenerate(IProgressMonitor monitor) throws IOException {
if (!targetFolder.getLocation().toFile().exists()) {
targetFolder.getLocation().toFile().mkdirs();
}
monitor.subTask("Loading...");
///////////
PrestoFactory factory = PrestoFactory.eINSTANCE;
Sistema sistema = factory.createSistema();
sistema.setName("xxx");
sistema.setPacote("com.xxx.yyy");
TipoPlataforma tipo = TipoPlataforma.XXX;
sistema.setTipo(tipo);
///////////
xxx.main.Generate gen0 = new xxx.main.Generate(sistema, targetFolder.getLocation().toFile(), arguments);
//xxx.main.Generate gen0 = new xxx.main.Generate(modelURI, targetFolder.getLocation().toFile(), arguments);
monitor.worked(1);
String generationID = org.eclipse.acceleo.engine.utils.AcceleoLaunchingUtil.computeUIProjectID("xxx", "xxx.main.Generate", modelURI.toString(), targetFolder.getFullPath().toString(), new ArrayList<String>());
gen0.setGenerationID(generationID);
gen0.doGenerate(BasicMonitor.toMonitor(monitor));
}
public void registerPackages(ResourceSet resourceSet) {
super.registerPackages(resourceSet);
/*
* TODO If you need additional package registrations, you can register them here. The following line
* (in comment) is an example of the package registration for UML. If you want to change the content
* of this method, do NOT forget to change the "@generated" tag in the Javadoc of this method to
* "@generated NOT". Without this new tag, any compilation of the Acceleo module with the main template
* that has caused the creation of this class will revert your modifications. You can use the method
* "isInWorkspace(Class c)" to check if the package that you are about to register is in the workspace.
* To register a package properly, please follow the following conventions:
*
* if (!isInWorkspace(UMLPackage.class)) {
* // The normal package registration if your metamodel is in a plugin.
* resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
* } else {
* // The package registration that will be used if the metamodel is not deployed in a plugin.
* // This should be used if your metamodel is in your workspace and if you are using binary resource serialization.
* resourceSet.getPackageRegistry().put("/myproject/myfolder/mysubfolder/MyUMLMetamodel.ecore", UMLPackage.eINSTANCE);
* }
*/
}