Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Le Menez2018-01-09 05:09:46 -0500
committerQuentin Le Menez2018-01-09 08:18:15 -0500
commitd98116b5b376f18b6cf626ba4158a35fe9a4a64e (patch)
tree4458c9c5ada0a216b385813a56ea9a9b8c7b6509 /plugins/developer/org.eclipse.papyrus.dev.types/src/org/eclipse/papyrus/dev/types/generator/ElementTypeRegistryGenerator.xtend
parent453e99bc2dcbd5fabad100f9d0d5f682013c3b19 (diff)
downloadorg.eclipse.papyrus-d98116b5b376f18b6cf626ba4158a35fe9a4a64e.tar.gz
org.eclipse.papyrus-d98116b5b376f18b6cf626ba4158a35fe9a4a64e.tar.xz
org.eclipse.papyrus-d98116b5b376f18b6cf626ba4158a35fe9a4a64e.zip
Bug 515367 - [releng] Uniformization of the end of lines to Unix standard
- Format the EOL of all the files matched by: grep -rIUs . | xargs -Ifile dos2unix -k 'file' Change-Id: I5c41d540a9a67b50de9b912ab35e16cc9a912961 Signed-off-by: Quentin Le Menez <quentin.lemenez@cea.fr>
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.dev.types/src/org/eclipse/papyrus/dev/types/generator/ElementTypeRegistryGenerator.xtend')
-rw-r--r--plugins/developer/org.eclipse.papyrus.dev.types/src/org/eclipse/papyrus/dev/types/generator/ElementTypeRegistryGenerator.xtend122
1 files changed, 61 insertions, 61 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.dev.types/src/org/eclipse/papyrus/dev/types/generator/ElementTypeRegistryGenerator.xtend b/plugins/developer/org.eclipse.papyrus.dev.types/src/org/eclipse/papyrus/dev/types/generator/ElementTypeRegistryGenerator.xtend
index cc1eaa69f61..260c3d727b7 100644
--- a/plugins/developer/org.eclipse.papyrus.dev.types/src/org/eclipse/papyrus/dev/types/generator/ElementTypeRegistryGenerator.xtend
+++ b/plugins/developer/org.eclipse.papyrus.dev.types/src/org/eclipse/papyrus/dev/types/generator/ElementTypeRegistryGenerator.xtend
@@ -1,61 +1,61 @@
-package org.eclipse.papyrus.dev.types.generator
-
-import org.eclipse.emf.ecore.resource.Resource
-import org.eclipse.emf.common.util.TreeIterator
-import org.eclipse.emf.ecore.EObject
-import org.eclipse.papyrus.infra.types.ElementTypeConfiguration
-
-class ElementTypeRegistryGenerator {
-
- static def Iterable<EObject> allContentsIterable(Resource resource) {
- var TreeIterator<EObject> _allContents = resource.getAllContents();
- return IteratorExtensions.<EObject>toIterable(_allContents);
- }
-
- static def String camelToUnderScore(String in) {
- var String regex = "([a-z])([A-Z])";
- var String replacement = "$1_$2";
- return in.replaceAll(regex, replacement);
- }
-
- static def String safeName(String in) {
- var result = camelToUnderScore(in)
- result = result.replaceAll("[^A-Za-z0-9]", "_")
- result = result.replaceAll("_{2,}", "_")
- result = result.toUpperCase;
- result = result.replaceAll("UML_","");
- return result;
- }
-
-
-
-
- static def generateRegistry(Resource it,String outputType) '''
- /*****************************************************************************
- * Copyright (c) 2014 CEA LIST.
- *
- * 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
- import org.eclipse.gmf.runtime.emf.type.core.AbstractElementTypeEnumerator;
- import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-
- public class «outputType» extends AbstractElementTypeEnumerator {
-
- /** Constant for UML nature */
- public static final String UML_NATURE = "UML_Nature";
-
- «FOR elementTypeConfiguration : allContentsIterable(it).filter(typeof(ElementTypeConfiguration))»
- public static final IHintedType «safeName(elementTypeConfiguration.name).toUpperCase» = (IHintedType)getElementType("«elementTypeConfiguration.identifier»"); //$NON-NLS-1$
-
- «ENDFOR»
-
- }
- '''
-}
+package org.eclipse.papyrus.dev.types.generator
+
+import org.eclipse.emf.ecore.resource.Resource
+import org.eclipse.emf.common.util.TreeIterator
+import org.eclipse.emf.ecore.EObject
+import org.eclipse.papyrus.infra.types.ElementTypeConfiguration
+
+class ElementTypeRegistryGenerator {
+
+ static def Iterable<EObject> allContentsIterable(Resource resource) {
+ var TreeIterator<EObject> _allContents = resource.getAllContents();
+ return IteratorExtensions.<EObject>toIterable(_allContents);
+ }
+
+ static def String camelToUnderScore(String in) {
+ var String regex = "([a-z])([A-Z])";
+ var String replacement = "$1_$2";
+ return in.replaceAll(regex, replacement);
+ }
+
+ static def String safeName(String in) {
+ var result = camelToUnderScore(in)
+ result = result.replaceAll("[^A-Za-z0-9]", "_")
+ result = result.replaceAll("_{2,}", "_")
+ result = result.toUpperCase;
+ result = result.replaceAll("UML_","");
+ return result;
+ }
+
+
+
+
+ static def generateRegistry(Resource it,String outputType) '''
+ /*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ * 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:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+ import org.eclipse.gmf.runtime.emf.type.core.AbstractElementTypeEnumerator;
+ import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+
+ public class «outputType» extends AbstractElementTypeEnumerator {
+
+ /** Constant for UML nature */
+ public static final String UML_NATURE = "UML_Nature";
+
+ «FOR elementTypeConfiguration : allContentsIterable(it).filter(typeof(ElementTypeConfiguration))»
+ public static final IHintedType «safeName(elementTypeConfiguration.name).toUpperCase» = (IHintedType)getElementType("«elementTypeConfiguration.identifier»"); //$NON-NLS-1$
+
+ «ENDFOR»
+
+ }
+ '''
+}

Back to the top