Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/Generate_rtmaps.java')
-rw-r--r--extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/Generate_rtmaps.java141
1 files changed, 68 insertions, 73 deletions
diff --git a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/Generate_rtmaps.java b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/Generate_rtmaps.java
index 677a4b3198d..855a7d7a5ac 100644
--- a/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/Generate_rtmaps.java
+++ b/extraplugins/robotml/generators/rtmaps/org.eclipse.papyrus.robotml.generators.intempora.rtmaps/src/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/Generate_rtmaps.java
@@ -4,7 +4,7 @@
* 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:
* Obeo - initial API and implementation
*******************************************************************************/
@@ -29,28 +29,28 @@ import org.eclipse.uml2.uml.resource.UMLResource;
/**
* Entry point of the 'Generate_rtmaps' generation module.
- *
+ *
* @generated
*/
public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* The name of the module.
- *
+ *
* @generated
*/
public static final String MODULE_FILE_NAME = "/org/eclipse/papyrus/robotml/generators/intempora/rtmaps/generate_rtmaps";
/**
* The name of the templates that are to be generated.
- *
+ *
* @generated
*/
public static final String[] TEMPLATE_NAMES = { "generateRTMapsDiagram" };
/**
* The list of properties files from the launch parameters (Launch configuration).
- *
+ *
* @generated
*/
private List<String> propertiesFiles = new ArrayList<String>();
@@ -60,10 +60,9 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
* this way cannot be used to launch generations before one of {@link #initialize(EObject, File, List)} or {@link #initialize(URI, File, List)} is
* called.
* <p>
- * The main reason for this constructor is to allow clients of this generation to call it from another Java file, as it allows for the retrieval
- * of {@link #getProperties()} and {@link #getGenerationListeners()}.
+ * The main reason for this constructor is to allow clients of this generation to call it from another Java file, as it allows for the retrieval of {@link #getProperties()} and {@link #getGenerationListeners()}.
* </p>
- *
+ *
* @generated
*/
public Generate_rtmaps() {
@@ -72,18 +71,18 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* This allows clients to instantiates a generator with all required information.
- *
+ *
* @param modelURI
- * URI where the model on which this generator will be used is located.
+ * URI where the model on which this generator will be used is located.
* @param targetFolder
- * This will be used as the output folder for this generation : it will be the base path
- * against which all file block URLs will be resolved.
+ * This will be used as the output folder for this generation : it will be the base path
+ * against which all file block URLs will be resolved.
* @param arguments
- * If the template which will be called requires more than one argument taken from the model,
- * pass them here.
+ * If the template which will be called requires more than one argument taken from the model,
+ * pass them here.
* @throws IOException
- * This can be thrown in three scenarios : the module cannot be found, it cannot be loaded, or
- * the model cannot be loaded.
+ * This can be thrown in three scenarios : the module cannot be found, it cannot be loaded, or
+ * the model cannot be loaded.
* @generated
*/
public Generate_rtmaps(URI modelURI, File targetFolder, List<? extends Object> arguments) throws IOException {
@@ -92,18 +91,18 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* This allows clients to instantiates a generator with all required information.
- *
+ *
* @param model
- * We'll iterate over the content of this element to find Objects matching the first parameter
- * of the template we need to call.
+ * We'll iterate over the content of this element to find Objects matching the first parameter
+ * of the template we need to call.
* @param targetFolder
- * This will be used as the output folder for this generation : it will be the base path
- * against which all file block URLs will be resolved.
+ * This will be used as the output folder for this generation : it will be the base path
+ * against which all file block URLs will be resolved.
* @param arguments
- * If the template which will be called requires more than one argument taken from the model,
- * pass them here.
+ * If the template which will be called requires more than one argument taken from the model,
+ * pass them here.
* @throws IOException
- * This can be thrown in two scenarios : the module cannot be found, or it cannot be loaded.
+ * This can be thrown in two scenarios : the module cannot be found, or it cannot be loaded.
* @generated
*/
public Generate_rtmaps(EObject model, File targetFolder, List<? extends Object> arguments) throws IOException {
@@ -112,14 +111,14 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* This can be used to launch the generation from a standalone application.
- *
+ *
* @param args
- * Arguments of the generation.
+ * Arguments of the generation.
* @generated
*/
public static void main(String[] args) {
try {
- if(args.length < 2) {
+ if (args.length < 2) {
System.out.println("Arguments not valid : {model, folder}.");
} else {
URI modelURI = URI.createFileURI(args[0]);
@@ -152,7 +151,7 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
* (Help -> Help Contents).
*/
- for(int i = 2; i < args.length; i++) {
+ for (int i = 2; i < args.length; i++) {
generator.addPropertiesFile(args[i]);
}
@@ -165,11 +164,11 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* Launches the generation described by this instance.
- *
+ *
* @param monitor
- * This will be used to display progress information to the user.
+ * This will be used to display progress information to the user.
* @throws IOException
- * This will be thrown if any of the output files cannot be saved to disk.
+ * This will be thrown if any of the output files cannot be saved to disk.
* @generated
*/
@Override
@@ -184,26 +183,26 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
* note that those instructions may have a significant impact on the performances.
*/
- //org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(model);
+ // org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(model);
/*
* If you want to check for potential errors in your models before the launch of the generation, you
* use the code below.
*/
- //if (model != null && model.eResource() != null) {
- // List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> errors = model.eResource().getErrors();
- // for (org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic : errors) {
- // System.err.println(diagnostic.toString());
- // }
- //}
+ // if (model != null && model.eResource() != null) {
+ // List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> errors = model.eResource().getErrors();
+ // for (org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic : errors) {
+ // System.err.println(diagnostic.toString());
+ // }
+ // }
super.doGenerate(monitor);
}
/**
* If this generator needs to listen to text generation events, listeners can be returned from here.
- *
+ *
* @return List of listeners that are to be notified when text is generated through this launch.
* @generated
*/
@@ -222,20 +221,17 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* 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.
+ * 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.
+ * 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>
- *
+ *
* @return The generation strategy that is to be used for generations launched through this launcher.
* @generated
*/
@@ -247,7 +243,7 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* This will be called in order to find and load the module that will be launched through this launcher.
* We expect this name not to contain file extension, and the module to be located beside the launcher.
- *
+ *
* @return The name of the module that is to be launched.
* @generated
*/
@@ -261,11 +257,10 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
* here.Take note that the first added properties files will take precedence over subsequent ones if they
* contain conflicting keys.
* <p>
- * Properties need to be in source folders, the path that we expect to get as a result of this call are of the form &lt;package>.&lt;properties
- * file name without extension>. For example, if you have a file named "messages.properties" in package "org.eclipse.acceleo.sample", the path
- * that needs be returned by a call to {@link #getProperties()} is "org.eclipse.acceleo.sample.messages".
+ * Properties need to be in source folders, the path that we expect to get as a result of this call are of the form &lt;package>.&lt;properties file name without extension>. For example, if you have a file named "messages.properties" in package
+ * "org.eclipse.acceleo.sample", the path that needs be returned by a call to {@link #getProperties()} is "org.eclipse.acceleo.sample.messages".
* </p>
- *
+ *
* @return The list of properties file we need to add to the generation context.
* @see java.util.ResourceBundle#getBundle(String)
* @generated
@@ -311,9 +306,9 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* Adds a properties file in the list of properties files.
- *
+ *
* @param propertiesFile
- * The properties file to add.
+ * The properties file to add.
* @generated
* @since 3.1
*/
@@ -324,7 +319,7 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* This will be used to get the list of templates that are to be launched by this launcher.
- *
+ *
* @return The list of templates to call on the module {@link #getModuleName()}.
* @generated
*/
@@ -335,9 +330,9 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
/**
* This can be used to update the resource set's package registry with all needed EPackages.
- *
+ *
* @param resourceSet
- * The resource set which registry has to be updated.
+ * The resource set which registry has to be updated.
* @generated NOT
*/
@Override
@@ -348,14 +343,14 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
//
EPackage.Registry packageRegistry = resourceSet.getPackageRegistry();
Resource.Factory.Registry factoryRegistry = resourceSet.getResourceFactoryRegistry();
- //Map<URI, URI> uriMap = resourceSet.getURIConverter().getURIMap();
+ // Map<URI, URI> uriMap = resourceSet.getURIConverter().getURIMap();
//
- if(!isInWorkspace(org.eclipse.uml2.uml.UMLPackage.class)) {
+ if (!isInWorkspace(org.eclipse.uml2.uml.UMLPackage.class)) {
resourceSet.getPackageRegistry().put(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getNsURI(), org.eclipse.uml2.uml.UMLPackage.eINSTANCE);
factoryRegistry.getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
}
- if(!isInWorkspace(org.eclipse.papyrus.RobotML.RobotMLPackage.class)) {
+ if (!isInWorkspace(org.eclipse.papyrus.RobotML.RobotMLPackage.class)) {
resourceSet.getPackageRegistry().put(org.eclipse.papyrus.RobotML.RobotMLPackage.eINSTANCE.getNsURI(), org.eclipse.papyrus.RobotML.RobotMLPackage.eINSTANCE);
}
@@ -380,24 +375,24 @@ public class Generate_rtmaps extends AbstractAcceleoGenerator {
//
- // try {
- // URI uri = URI.createPlatformPluginURI("org.eclipse.papyrus.robotml/model/ProteusProfile.profile.uml", true);
- //
- // Resource res = resourceSet.getResource(uri, true);
- // Profile profile = (Profile)res.getContents().get(0);
- // EPackage epackage = profile.getDefinition();
- // packageRegistry.put(epackage.getNsURI(), epackage);
- // } catch (Exception e) {
- // System.out.println("---- error loading profile: " + e);
- // e.printStackTrace();
- // }
+ // try {
+ // URI uri = URI.createPlatformPluginURI("org.eclipse.papyrus.robotml/model/ProteusProfile.profile.uml", true);
+ //
+ // Resource res = resourceSet.getResource(uri, true);
+ // Profile profile = (Profile)res.getContents().get(0);
+ // EPackage epackage = profile.getDefinition();
+ // packageRegistry.put(epackage.getNsURI(), epackage);
+ // } catch (Exception e) {
+ // System.out.println("---- error loading profile: " + e);
+ // e.printStackTrace();
+ // }
}
/**
* This can be used to update the resource set's resource factory registry with all needed factories.
- *
+ *
* @param resourceSet
- * The resource set which registry has to be updated.
+ * The resource set which registry has to be updated.
* @generated
*/
@Override

Back to the top