diff options
author | sbouchet | 2009-10-01 09:13:15 +0000 |
---|---|---|
committer | sbouchet | 2009-10-01 09:13:15 +0000 |
commit | 0d3821fda665e4f7db3b6db7364fd424b78fa8ce (patch) | |
tree | 3f26ab451b3a2e4ea288eff8f5dc65e3fe80c764 /plugins/org.eclipse.emf.eef.codegen | |
parent | 31e43bb68b3faeb91ba2c97b9d70f323ef477e2f (diff) | |
download | org.eclipse.eef-0d3821fda665e4f7db3b6db7364fd424b78fa8ce.tar.gz org.eclipse.eef-0d3821fda665e4f7db3b6db7364fd424b78fa8ce.tar.xz org.eclipse.eef-0d3821fda665e4f7db3b6db7364fd424b78fa8ce.zip |
updated to acceleo 0.9.0M2
Diffstat (limited to 'plugins/org.eclipse.emf.eef.codegen')
17 files changed, 442 insertions, 51 deletions
diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/components/DynamicPropertiesEditionComponent.java b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/components/DynamicPropertiesEditionComponent.java index 3927f961e..8ed22b714 100644 --- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/components/DynamicPropertiesEditionComponent.java +++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/components/DynamicPropertiesEditionComponent.java @@ -16,6 +16,8 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener; +import org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy; +import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; import java.util.List; import java.util.ArrayList; @@ -274,17 +276,38 @@ public class DynamicPropertiesEditionComponent { if (!targetFolder.exists()) { targetFolder.mkdirs(); } - AcceleoService service = new AcceleoService(); + AcceleoService service = new AcceleoService(getGenerationStrategy()); registerListeners(service); registerProperties(service); for (int i = 0; i < TEMPLATE_NAMES.length; i++) { - service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, false, - monitor); + service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, monitor); } service.dispose(); } /** + * If you need to change the way files are generated, this is your entry point. + * <p> + * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates + * files on the fly. If you only need to preview the results, return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware + * of the running Eclipse and can be used standalone. + * </p> + * <p> + * If you need the file generation to be aware of the workspace (A typical example is when you wanna override + * files that are under clear case or any other VCS that could forbid the overriding), then return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that + * this <b>cannot</b> be used standalone. + * </p> + * <p> + * All three of these default strategies support merging through JMerge. + * </p> + */ + public IAcceleoGenerationStrategy getGenerationStrategy() { + return new DefaultStrategy(); + } + + /** * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}. * <p> * This will return the first root of the loaded model, other roots can be accessed via the resource's diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/components/PropertiesEditionComponent.java b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/components/PropertiesEditionComponent.java index ae6869960..da3b5c5d4 100644 --- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/components/PropertiesEditionComponent.java +++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/components/PropertiesEditionComponent.java @@ -16,6 +16,8 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener; +import org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy; +import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; import java.util.List; import java.util.ArrayList; @@ -276,17 +278,38 @@ public class PropertiesEditionComponent { if (!targetFolder.exists()) { targetFolder.mkdirs(); } - AcceleoService service = new AcceleoService(); + AcceleoService service = new AcceleoService(getGenerationStrategy()); registerListeners(service); registerProperties(service); for (int i = 0; i < TEMPLATE_NAMES.length; i++) { - service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, false, - monitor); + service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, monitor); } service.dispose(); } /** + * If you need to change the way files are generated, this is your entry point. + * <p> + * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates + * files on the fly. If you only need to preview the results, return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware + * of the running Eclipse and can be used standalone. + * </p> + * <p> + * If you need the file generation to be aware of the workspace (A typical example is when you wanna override + * files that are under clear case or any other VCS that could forbid the overriding), then return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that + * this <b>cannot</b> be used standalone. + * </p> + * <p> + * All three of these default strategies support merging through JMerge. + * </p> + */ + public IAcceleoGenerationStrategy getGenerationStrategy() { + return new DefaultStrategy(); + } + + /** * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}. * <p> * This will return the first root of the loaded model, other roots can be accessed via the resource's diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/components/SubPropertiesEditionComponent.java b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/components/SubPropertiesEditionComponent.java index bbb92752a..d9d788024 100644 --- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/components/SubPropertiesEditionComponent.java +++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/components/SubPropertiesEditionComponent.java @@ -16,6 +16,8 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener; +import org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy; +import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; import java.util.List; import java.util.ArrayList; @@ -276,17 +278,38 @@ public class SubPropertiesEditionComponent { if (!targetFolder.exists()) { targetFolder.mkdirs(); } - AcceleoService service = new AcceleoService(); + AcceleoService service = new AcceleoService(getGenerationStrategy()); registerListeners(service); registerProperties(service); for (int i = 0; i < TEMPLATE_NAMES.length; i++) { - service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, false, - monitor); + service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, monitor); } service.dispose(); } /** + * If you need to change the way files are generated, this is your entry point. + * <p> + * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates + * files on the fly. If you only need to preview the results, return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware + * of the running Eclipse and can be used standalone. + * </p> + * <p> + * If you need the file generation to be aware of the workspace (A typical example is when you wanna override + * files that are under clear case or any other VCS that could forbid the overriding), then return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that + * this <b>cannot</b> be used standalone. + * </p> + * <p> + * All three of these default strategies support merging through JMerge. + * </p> + */ + public IAcceleoGenerationStrategy getGenerationStrategy() { + return new DefaultStrategy(); + } + + /** * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}. * <p> * This will return the first root of the loaded model, other roots can be accessed via the resource's diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/parts/FormPropertiesEditionPart.java b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/parts/FormPropertiesEditionPart.java index 02892bc1f..04a425220 100644 --- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/parts/FormPropertiesEditionPart.java +++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/parts/FormPropertiesEditionPart.java @@ -16,6 +16,8 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener; +import org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy; +import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; import java.util.List; import java.util.ArrayList; @@ -276,17 +278,38 @@ public class FormPropertiesEditionPart { if (!targetFolder.exists()) { targetFolder.mkdirs(); } - AcceleoService service = new AcceleoService(); + AcceleoService service = new AcceleoService(getGenerationStrategy()); registerListeners(service); registerProperties(service); for (int i = 0; i < TEMPLATE_NAMES.length; i++) { - service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, false, - monitor); + service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, monitor); } service.dispose(); } /** + * If you need to change the way files are generated, this is your entry point. + * <p> + * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates + * files on the fly. If you only need to preview the results, return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware + * of the running Eclipse and can be used standalone. + * </p> + * <p> + * If you need the file generation to be aware of the workspace (A typical example is when you wanna override + * files that are under clear case or any other VCS that could forbid the overriding), then return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that + * this <b>cannot</b> be used standalone. + * </p> + * <p> + * All three of these default strategies support merging through JMerge. + * </p> + */ + public IAcceleoGenerationStrategy getGenerationStrategy() { + return new DefaultStrategy(); + } + + /** * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}. * <p> * This will return the first root of the loaded model, other roots can be accessed via the resource's diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/parts/IPropertiesEditionPart.java b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/parts/IPropertiesEditionPart.java index 7b8b0f70a..8dd1dad1f 100644 --- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/parts/IPropertiesEditionPart.java +++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/parts/IPropertiesEditionPart.java @@ -16,6 +16,8 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener; +import org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy; +import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; import java.util.List; import java.util.ArrayList; @@ -274,17 +276,38 @@ public class IPropertiesEditionPart { if (!targetFolder.exists()) { targetFolder.mkdirs(); } - AcceleoService service = new AcceleoService(); + AcceleoService service = new AcceleoService(getGenerationStrategy()); registerListeners(service); registerProperties(service); for (int i = 0; i < TEMPLATE_NAMES.length; i++) { - service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, false, - monitor); + service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, monitor); } service.dispose(); } /** + * If you need to change the way files are generated, this is your entry point. + * <p> + * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates + * files on the fly. If you only need to preview the results, return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware + * of the running Eclipse and can be used standalone. + * </p> + * <p> + * If you need the file generation to be aware of the workspace (A typical example is when you wanna override + * files that are under clear case or any other VCS that could forbid the overriding), then return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that + * this <b>cannot</b> be used standalone. + * </p> + * <p> + * All three of these default strategies support merging through JMerge. + * </p> + */ + public IAcceleoGenerationStrategy getGenerationStrategy() { + return new DefaultStrategy(); + } + + /** * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}. * <p> * This will return the first root of the loaded model, other roots can be accessed via the resource's diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/parts/PropertiesEditionPart.java b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/parts/PropertiesEditionPart.java index 455c9ebca..24f3f7c51 100644 --- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/parts/PropertiesEditionPart.java +++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/parts/PropertiesEditionPart.java @@ -16,6 +16,8 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener; +import org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy; +import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; import java.util.List; import java.util.ArrayList; @@ -276,17 +278,38 @@ public class PropertiesEditionPart { if (!targetFolder.exists()) { targetFolder.mkdirs(); } - AcceleoService service = new AcceleoService(); + AcceleoService service = new AcceleoService(getGenerationStrategy()); registerListeners(service); registerProperties(service); for (int i = 0; i < TEMPLATE_NAMES.length; i++) { - service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, false, - monitor); + service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, monitor); } service.dispose(); } /** + * If you need to change the way files are generated, this is your entry point. + * <p> + * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates + * files on the fly. If you only need to preview the results, return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware + * of the running Eclipse and can be used standalone. + * </p> + * <p> + * If you need the file generation to be aware of the workspace (A typical example is when you wanna override + * files that are under clear case or any other VCS that could forbid the overriding), then return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that + * this <b>cannot</b> be used standalone. + * </p> + * <p> + * All three of these default strategies support merging through JMerge. + * </p> + */ + public IAcceleoGenerationStrategy getGenerationStrategy() { + return new DefaultStrategy(); + } + + /** * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}. * <p> * This will return the first root of the loaded model, other roots can be accessed via the resource's diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/parts/ViewsRepository.java b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/parts/ViewsRepository.java index 29529f883..606f123fe 100644 --- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/parts/ViewsRepository.java +++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/parts/ViewsRepository.java @@ -16,6 +16,8 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener; +import org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy; +import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; import java.util.List; import java.util.ArrayList; @@ -274,17 +276,38 @@ public class ViewsRepository { if (!targetFolder.exists()) { targetFolder.mkdirs(); } - AcceleoService service = new AcceleoService(); + AcceleoService service = new AcceleoService(getGenerationStrategy()); registerListeners(service); registerProperties(service); for (int i = 0; i < TEMPLATE_NAMES.length; i++) { - service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, false, - monitor); + service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, monitor); } service.dispose(); } /** + * If you need to change the way files are generated, this is your entry point. + * <p> + * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates + * files on the fly. If you only need to preview the results, return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware + * of the running Eclipse and can be used standalone. + * </p> + * <p> + * If you need the file generation to be aware of the workspace (A typical example is when you wanna override + * files that are under clear case or any other VCS that could forbid the overriding), then return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that + * this <b>cannot</b> be used standalone. + * </p> + * <p> + * All three of these default strategies support merging through JMerge. + * </p> + */ + public IAcceleoGenerationStrategy getGenerationStrategy() { + return new DefaultStrategy(); + } + + /** * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}. * <p> * This will return the first root of the loaded model, other roots can be accessed via the resource's diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/plugin/GMF_Plugin_xml.java b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/plugin/GMF_Plugin_xml.java index 26bea1de6..2e3599daf 100644 --- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/plugin/GMF_Plugin_xml.java +++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/plugin/GMF_Plugin_xml.java @@ -16,6 +16,8 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener; +import org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy; +import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; import java.util.List; import java.util.ArrayList; @@ -272,17 +274,38 @@ public class GMF_Plugin_xml { if (!targetFolder.exists()) { targetFolder.mkdirs(); } - AcceleoService service = new AcceleoService(); + AcceleoService service = new AcceleoService(getGenerationStrategy()); registerListeners(service); registerProperties(service); for (int i = 0; i < TEMPLATE_NAMES.length; i++) { - service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, false, - monitor); + service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, monitor); } service.dispose(); } /** + * If you need to change the way files are generated, this is your entry point. + * <p> + * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates + * files on the fly. If you only need to preview the results, return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware + * of the running Eclipse and can be used standalone. + * </p> + * <p> + * If you need the file generation to be aware of the workspace (A typical example is when you wanna override + * files that are under clear case or any other VCS that could forbid the overriding), then return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that + * this <b>cannot</b> be used standalone. + * </p> + * <p> + * All three of these default strategies support merging through JMerge. + * </p> + */ + public IAcceleoGenerationStrategy getGenerationStrategy() { + return new DefaultStrategy(); + } + + /** * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}. * <p> * This will return the first root of the loaded model, other roots can be accessed via the resource's diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/plugin/Plugin_xml.java b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/plugin/Plugin_xml.java index f83f32f30..46e5424a5 100644 --- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/plugin/Plugin_xml.java +++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/plugin/Plugin_xml.java @@ -16,6 +16,8 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener; +import org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy; +import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; import java.util.List; import java.util.ArrayList; @@ -272,17 +274,38 @@ public class Plugin_xml { if (!targetFolder.exists()) { targetFolder.mkdirs(); } - AcceleoService service = new AcceleoService(); + AcceleoService service = new AcceleoService(getGenerationStrategy()); registerListeners(service); registerProperties(service); for (int i = 0; i < TEMPLATE_NAMES.length; i++) { - service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, false, - monitor); + service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, monitor); } service.dispose(); } /** + * If you need to change the way files are generated, this is your entry point. + * <p> + * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates + * files on the fly. If you only need to preview the results, return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware + * of the running Eclipse and can be used standalone. + * </p> + * <p> + * If you need the file generation to be aware of the workspace (A typical example is when you wanna override + * files that are under clear case or any other VCS that could forbid the overriding), then return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that + * this <b>cannot</b> be used standalone. + * </p> + * <p> + * All three of these default strategies support merging through JMerge. + * </p> + */ + public IAcceleoGenerationStrategy getGenerationStrategy() { + return new DefaultStrategy(); + } + + /** * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}. * <p> * This will return the first root of the loaded model, other roots can be accessed via the resource's diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/properties/PropertySection.java b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/properties/PropertySection.java index 5846ef221..c4f195ff5 100644 --- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/properties/PropertySection.java +++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/properties/PropertySection.java @@ -16,6 +16,8 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener; +import org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy; +import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; import java.util.List; import java.util.ArrayList; @@ -274,17 +276,38 @@ public class PropertySection { if (!targetFolder.exists()) { targetFolder.mkdirs(); } - AcceleoService service = new AcceleoService(); + AcceleoService service = new AcceleoService(getGenerationStrategy()); registerListeners(service); registerProperties(service); for (int i = 0; i < TEMPLATE_NAMES.length; i++) { - service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, false, - monitor); + service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, monitor); } service.dispose(); } /** + * If you need to change the way files are generated, this is your entry point. + * <p> + * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates + * files on the fly. If you only need to preview the results, return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware + * of the running Eclipse and can be used standalone. + * </p> + * <p> + * If you need the file generation to be aware of the workspace (A typical example is when you wanna override + * files that are under clear case or any other VCS that could forbid the overriding), then return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that + * this <b>cannot</b> be used standalone. + * </p> + * <p> + * All three of these default strategies support merging through JMerge. + * </p> + */ + public IAcceleoGenerationStrategy getGenerationStrategy() { + return new DefaultStrategy(); + } + + /** * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}. * <p> * This will return the first root of the loaded model, other roots can be accessed via the resource's diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/ContextMessages.java b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/ContextMessages.java index 57eeae3f6..997059160 100644 --- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/ContextMessages.java +++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/ContextMessages.java @@ -16,6 +16,8 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener; +import org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy; +import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; import java.util.List; import java.util.ArrayList; @@ -274,17 +276,38 @@ public class ContextMessages { if (!targetFolder.exists()) { targetFolder.mkdirs(); } - AcceleoService service = new AcceleoService(); + AcceleoService service = new AcceleoService(getGenerationStrategy()); registerListeners(service); registerProperties(service); for (int i = 0; i < TEMPLATE_NAMES.length; i++) { - service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, false, - monitor); + service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, monitor); } service.dispose(); } /** + * If you need to change the way files are generated, this is your entry point. + * <p> + * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates + * files on the fly. If you only need to preview the results, return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware + * of the running Eclipse and can be used standalone. + * </p> + * <p> + * If you need the file generation to be aware of the workspace (A typical example is when you wanna override + * files that are under clear case or any other VCS that could forbid the overriding), then return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that + * this <b>cannot</b> be used standalone. + * </p> + * <p> + * All three of these default strategies support merging through JMerge. + * </p> + */ + public IAcceleoGenerationStrategy getGenerationStrategy() { + return new DefaultStrategy(); + } + + /** * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}. * <p> * This will return the first root of the loaded model, other roots can be accessed via the resource's diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/ContextMessagesProperties.java b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/ContextMessagesProperties.java index 162559f89..18ced4a20 100644 --- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/ContextMessagesProperties.java +++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/ContextMessagesProperties.java @@ -16,6 +16,8 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener; +import org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy; +import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; import java.util.List; import java.util.ArrayList; @@ -273,17 +275,38 @@ public class ContextMessagesProperties { if (!targetFolder.exists()) { targetFolder.mkdirs(); } - AcceleoService service = new AcceleoService(); + AcceleoService service = new AcceleoService(getGenerationStrategy()); registerListeners(service); registerProperties(service); for (int i = 0; i < TEMPLATE_NAMES.length; i++) { - service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, false, - monitor); + service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, monitor); } service.dispose(); } /** + * If you need to change the way files are generated, this is your entry point. + * <p> + * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates + * files on the fly. If you only need to preview the results, return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware + * of the running Eclipse and can be used standalone. + * </p> + * <p> + * If you need the file generation to be aware of the workspace (A typical example is when you wanna override + * files that are under clear case or any other VCS that could forbid the overriding), then return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that + * this <b>cannot</b> be used standalone. + * </p> + * <p> + * All three of these default strategies support merging through JMerge. + * </p> + */ + public IAcceleoGenerationStrategy getGenerationStrategy() { + return new DefaultStrategy(); + } + + /** * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}. * <p> * This will return the first root of the loaded model, other roots can be accessed via the resource's diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/ContextMessagesPropertiesFR.java b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/ContextMessagesPropertiesFR.java index f6c047460..f5baf038d 100644 --- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/ContextMessagesPropertiesFR.java +++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/ContextMessagesPropertiesFR.java @@ -16,6 +16,8 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener; +import org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy; +import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; import java.util.List; import java.util.ArrayList; @@ -273,17 +275,38 @@ public class ContextMessagesPropertiesFR { if (!targetFolder.exists()) { targetFolder.mkdirs(); } - AcceleoService service = new AcceleoService(); + AcceleoService service = new AcceleoService(getGenerationStrategy()); registerListeners(service); registerProperties(service); for (int i = 0; i < TEMPLATE_NAMES.length; i++) { - service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, false, - monitor); + service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, monitor); } service.dispose(); } /** + * If you need to change the way files are generated, this is your entry point. + * <p> + * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates + * files on the fly. If you only need to preview the results, return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware + * of the running Eclipse and can be used standalone. + * </p> + * <p> + * If you need the file generation to be aware of the workspace (A typical example is when you wanna override + * files that are under clear case or any other VCS that could forbid the overriding), then return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that + * this <b>cannot</b> be used standalone. + * </p> + * <p> + * All three of these default strategies support merging through JMerge. + * </p> + */ + public IAcceleoGenerationStrategy getGenerationStrategy() { + return new DefaultStrategy(); + } + + /** * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}. * <p> * This will return the first root of the loaded model, other roots can be accessed via the resource's diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/PackagePropertiesEditionPartProvider.java b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/PackagePropertiesEditionPartProvider.java index 0c2a1261b..4e2c21293 100644 --- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/PackagePropertiesEditionPartProvider.java +++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/PackagePropertiesEditionPartProvider.java @@ -16,6 +16,8 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener; +import org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy; +import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; import java.util.List; import java.util.ArrayList; @@ -273,17 +275,38 @@ public class PackagePropertiesEditionPartProvider { if (!targetFolder.exists()) { targetFolder.mkdirs(); } - AcceleoService service = new AcceleoService(); + AcceleoService service = new AcceleoService(getGenerationStrategy()); registerListeners(service); registerProperties(service); for (int i = 0; i < TEMPLATE_NAMES.length; i++) { - service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, false, - monitor); + service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, monitor); } service.dispose(); } /** + * If you need to change the way files are generated, this is your entry point. + * <p> + * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates + * files on the fly. If you only need to preview the results, return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware + * of the running Eclipse and can be used standalone. + * </p> + * <p> + * If you need the file generation to be aware of the workspace (A typical example is when you wanna override + * files that are under clear case or any other VCS that could forbid the overriding), then return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that + * this <b>cannot</b> be used standalone. + * </p> + * <p> + * All three of these default strategies support merging through JMerge. + * </p> + */ + public IAcceleoGenerationStrategy getGenerationStrategy() { + return new DefaultStrategy(); + } + + /** * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}. * <p> * This will return the first root of the loaded model, other roots can be accessed via the resource's diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/PackagePropertiesEditionPolicyProvider.java b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/PackagePropertiesEditionPolicyProvider.java index ba90849ed..3d1e4aab6 100644 --- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/PackagePropertiesEditionPolicyProvider.java +++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/PackagePropertiesEditionPolicyProvider.java @@ -16,6 +16,8 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener; +import org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy; +import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; import java.util.List; import java.util.ArrayList; @@ -271,17 +273,38 @@ public class PackagePropertiesEditionPolicyProvider { if (!targetFolder.exists()) { targetFolder.mkdirs(); } - AcceleoService service = new AcceleoService(); + AcceleoService service = new AcceleoService(getGenerationStrategy()); registerListeners(service); registerProperties(service); for (int i = 0; i < TEMPLATE_NAMES.length; i++) { - service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, false, - monitor); + service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, monitor); } service.dispose(); } /** + * If you need to change the way files are generated, this is your entry point. + * <p> + * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates + * files on the fly. If you only need to preview the results, return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware + * of the running Eclipse and can be used standalone. + * </p> + * <p> + * If you need the file generation to be aware of the workspace (A typical example is when you wanna override + * files that are under clear case or any other VCS that could forbid the overriding), then return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that + * this <b>cannot</b> be used standalone. + * </p> + * <p> + * All three of these default strategies support merging through JMerge. + * </p> + */ + public IAcceleoGenerationStrategy getGenerationStrategy() { + return new DefaultStrategy(); + } + + /** * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}. * <p> * This will return the first root of the loaded model, other roots can be accessed via the resource's diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/PackagePropertiesEditionProvider.java b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/PackagePropertiesEditionProvider.java index aad2214bc..a33713e30 100644 --- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/PackagePropertiesEditionProvider.java +++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/PackagePropertiesEditionProvider.java @@ -16,6 +16,8 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener; +import org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy; +import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; import java.util.List; import java.util.ArrayList; @@ -271,17 +273,38 @@ public class PackagePropertiesEditionProvider { if (!targetFolder.exists()) { targetFolder.mkdirs(); } - AcceleoService service = new AcceleoService(); + AcceleoService service = new AcceleoService(getGenerationStrategy()); registerListeners(service); registerProperties(service); for (int i = 0; i < TEMPLATE_NAMES.length; i++) { - service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, false, - monitor); + service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, monitor); } service.dispose(); } /** + * If you need to change the way files are generated, this is your entry point. + * <p> + * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates + * files on the fly. If you only need to preview the results, return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware + * of the running Eclipse and can be used standalone. + * </p> + * <p> + * If you need the file generation to be aware of the workspace (A typical example is when you wanna override + * files that are under clear case or any other VCS that could forbid the overriding), then return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that + * this <b>cannot</b> be used standalone. + * </p> + * <p> + * All three of these default strategies support merging through JMerge. + * </p> + */ + public IAcceleoGenerationStrategy getGenerationStrategy() { + return new DefaultStrategy(); + } + + /** * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}. * <p> * This will return the first root of the loaded model, other roots can be accessed via the resource's diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/PropertiesEditionProvider.java b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/PropertiesEditionProvider.java index 1aaa3ab53..6d37a8aea 100644 --- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/PropertiesEditionProvider.java +++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/providers/PropertiesEditionProvider.java @@ -16,6 +16,8 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import org.eclipse.acceleo.engine.event.IAcceleoTextGenerationListener; +import org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy; +import org.eclipse.acceleo.engine.generation.strategy.IAcceleoGenerationStrategy; import java.util.List; import java.util.ArrayList; @@ -273,17 +275,38 @@ public class PropertiesEditionProvider { if (!targetFolder.exists()) { targetFolder.mkdirs(); } - AcceleoService service = new AcceleoService(); + AcceleoService service = new AcceleoService(getGenerationStrategy()); registerListeners(service); registerProperties(service); for (int i = 0; i < TEMPLATE_NAMES.length; i++) { - service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, false, - monitor); + service.doGenerate(module, TEMPLATE_NAMES[i], model, arguments, targetFolder, monitor); } service.dispose(); } /** + * If you need to change the way files are generated, this is your entry point. + * <p> + * The default is {@link org.eclipse.acceleo.engine.generation.strategy.DefaultStrategy}; it generates + * files on the fly. If you only need to preview the results, return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy}. Both of these aren't aware + * of the running Eclipse and can be used standalone. + * </p> + * <p> + * If you need the file generation to be aware of the workspace (A typical example is when you wanna override + * files that are under clear case or any other VCS that could forbid the overriding), then return a new + * {@link org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy}. <b>Note</b>, however, that + * this <b>cannot</b> be used standalone. + * </p> + * <p> + * All three of these default strategies support merging through JMerge. + * </p> + */ + public IAcceleoGenerationStrategy getGenerationStrategy() { + return new DefaultStrategy(); + } + + /** * Loads a model from an {@link org.eclipse.emf.common.util.URI URI} in a given {@link ResourceSet}. * <p> * This will return the first root of the loaded model, other roots can be accessed via the resource's |