Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/generation-classes-helper-src/org/eclipse/papyrus/sysml/sysmloveruml/codegen/generationUtils/SysMLOverUMLHelper.java')
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/generation-classes-helper-src/org/eclipse/papyrus/sysml/sysmloveruml/codegen/generationUtils/SysMLOverUMLHelper.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/generation-classes-helper-src/org/eclipse/papyrus/sysml/sysmloveruml/codegen/generationUtils/SysMLOverUMLHelper.java b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/generation-classes-helper-src/org/eclipse/papyrus/sysml/sysmloveruml/codegen/generationUtils/SysMLOverUMLHelper.java
index 60d99a51c35..69df1772784 100644
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/generation-classes-helper-src/org/eclipse/papyrus/sysml/sysmloveruml/codegen/generationUtils/SysMLOverUMLHelper.java
+++ b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/generation-classes-helper-src/org/eclipse/papyrus/sysml/sysmloveruml/codegen/generationUtils/SysMLOverUMLHelper.java
@@ -356,6 +356,17 @@ public class SysMLOverUMLHelper {
return builder.toString().toUpperCase();
}
+ public static String getElementTypeCorrectLabel(String classifier) {
+ StringBuilder builder = new StringBuilder();
+ for(int i = 0; i < classifier.length(); i++) {
+ if(Character.isUpperCase(classifier.charAt(i)) && i > 0) {
+ builder.append(' ');
+ }
+ builder.append(classifier.charAt(i));
+ }
+ return builder.toString();
+ }
+
/**
* Get the correct label name of an {@link EClass} as it is written in UMLPackage.litterals
* Example:
@@ -370,6 +381,19 @@ public class SysMLOverUMLHelper {
}
/**
+ * Get the correct label name of an {@link EClass} as it is written in plugins.properties to externalize strings
+ * Example:
+ *
+ * EClass ActivityEdge -> return Activity Edge
+ *
+ * @param eClass
+ * @return
+ */
+ public static String getElementTypeCorrectLabel(EClass eClass) {
+ return getElementTypeCorrectLabel(eClass.getName());
+ }
+
+ /**
* Get the package name with an adding string.
*
* @param genPackage

Back to the top