aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndres Alvarez Mattos2012-04-03 04:17:44 (EDT)
committerMickael Istria2012-04-03 04:17:44 (EDT)
commit8aa88810eb643d8154ebdcd880291cccb9ed4c06 (patch)
tree4d8424b799f133151239756a4abbd1e843bb417b
parent7b3926f2a8de3931bf9211c7d76dccab282476ca (diff)
downloadorg.eclipse.gmf-tooling-8aa88810eb643d8154ebdcd880291cccb9ed4c06.zip
org.eclipse.gmf-tooling-8aa88810eb643d8154ebdcd880291cccb9ed4c06.tar.gz
org.eclipse.gmf-tooling-8aa88810eb643d8154ebdcd880291cccb9ed4c06.tar.bz2
Bug 317241
Tentative patch
-rw-r--r--plugins/org.eclipse.gmf.codegen/plugin.xml13
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates.nativestubs/gmf/GenPackageUtils.qvto17
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates.qvtlib/org/eclipse/gmf/internal/codegen/util/GenPackageUtils.java29
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/MetaModel.qvto7
4 files changed, 63 insertions, 3 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/plugin.xml b/plugins/org.eclipse.gmf.codegen/plugin.xml
index 284f066..5ec2784 100644
--- a/plugins/org.eclipse.gmf.codegen/plugin.xml
+++ b/plugins/org.eclipse.gmf.codegen/plugin.xml
@@ -155,5 +155,18 @@
namespace="xpt">
<library class="org.eclipse.gmf.internal.codegen.util.XpandFacadeAccess"/>
</unit>
+ <unit
+ name="GenPackageUtils"
+ namespace="gmf">
+ <library
+ class="org.eclipse.gmf.internal.codegen.util.GenPackageUtils">
+ <metamodel
+ nsURI="http://www.eclipse.org/emf/2002/GenModel">
+ </metamodel>
+ <metamodel
+ nsURI="http://www.eclipse.org/emf/2002/Ecore">
+ </metamodel>
+ </library>
+ </unit>
</extension>
</plugin>
diff --git a/plugins/org.eclipse.gmf.codegen/templates.nativestubs/gmf/GenPackageUtils.qvto b/plugins/org.eclipse.gmf.codegen/templates.nativestubs/gmf/GenPackageUtils.qvto
new file mode 100644
index 0000000..4dfdf33
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates.nativestubs/gmf/GenPackageUtils.qvto
@@ -0,0 +1,17 @@
+
+modeltype genModel uses "http://www.eclipse.org/emf/2002/GenModel";
+modeltype ecore uses "http://www.eclipse.org/emf/2002/Ecore";
+
+library GenPackageUtils;
+
+helper getGenPackageQualifiedPackageInterfaceName(genPackage : genmodel::GenPackage) : String {
+ return null;
+}
+
+helper getGenPackageQualifiedFactoryInterfaceName(genPackage : genmodel::GenPackage) : String {
+ return null;
+}
+
+helper getGenPackageQualifiedInterfaceName(genClass : genmodel::GenClass) : String {
+ return null;
+}
diff --git a/plugins/org.eclipse.gmf.codegen/templates.qvtlib/org/eclipse/gmf/internal/codegen/util/GenPackageUtils.java b/plugins/org.eclipse.gmf.codegen/templates.qvtlib/org/eclipse/gmf/internal/codegen/util/GenPackageUtils.java
new file mode 100644
index 0000000..9c06de8
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates.qvtlib/org/eclipse/gmf/internal/codegen/util/GenPackageUtils.java
@@ -0,0 +1,29 @@
+package org.eclipse.gmf.internal.codegen.util;
+
+import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
+import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
+import org.eclipse.m2m.qvt.oml.blackbox.java.Operation;
+import org.eclipse.m2m.qvt.oml.blackbox.java.Operation.Kind;
+
+public class GenPackageUtils {
+
+ @Operation(contextual = false, kind = Kind.HELPER)
+ public static String getGenPackageQualifiedPackageInterfaceName(GenPackage genPackage)
+ {
+ return genPackage.getQualifiedPackageInterfaceName();
+ }
+
+ @Operation(contextual = false, kind = Kind.HELPER)
+ public String getGenPackageQualifiedFactoryInterfaceName(GenPackage genPackage)
+ {
+ return genPackage.getQualifiedFactoryInterfaceName();
+ }
+
+ @Operation(contextual = false, kind = Kind.HELPER)
+ public static String getGenPackageQualifiedInterfaceName(GenClass genClass)
+ {
+ return genClass.getQualifiedInterfaceName();
+ }
+
+
+}
diff --git a/plugins/org.eclipse.gmf.codegen/templates/MetaModel.qvto b/plugins/org.eclipse.gmf.codegen/templates/MetaModel.qvto
index 001bde0..2a52288 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/MetaModel.qvto
+++ b/plugins/org.eclipse.gmf.codegen/templates/MetaModel.qvto
@@ -12,6 +12,7 @@
import xpt.StringOperations;
import xpt.GenModelUtils;
import gmf.CodeGenerationUtils;
+import gmf.GenPackageUtils;
modeltype genmodel uses "http://www.eclipse.org/emf/2002/GenModel";
modeltype ecore uses "http://www.eclipse.org/emf/2002/Ecore";
@@ -30,14 +31,14 @@ library MetaModel;
-- GenPackageImpl#getQualifiedPackageInterfaceName()
--
helper getQualifiedPackageInterfaceName(gp : genmodel::GenPackage) : String {
- return (if gp.genModel.suppressEMFMetaData then getQualifiedPackageClassName(gp) else getReflectionPackageName(gp) + '.' + getPackageInterfaceName(gp) endif)
+ return getGenPackageQualifiedPackageInterfaceName(gp)
}
--
-- GenPackageImpl#getQualifiedFactoryInterfaceName()
--
helper getQualifiedFactoryInterfaceName(gp : genmodel::GenPackage) : String {
- return getReflectionPackageName(gp) + '.' + getPrefixedName(gp, 'Factory')
+ return getGenPackageQualifiedFactoryInterfaceName(gp)
}
--
@@ -66,7 +67,7 @@ helper getItemProviderAdapterFactoryClassName(gp : genmodel::GenPackage) : Strin
-- GenClass#getQualifiedInterfaceName
--
helper getQualifiedInterfaceName(gc : genmodel::GenClass) : String {
- return (if null <> gc.ecoreClass.instanceClassName then gc.ecoreClass.instanceClassName.xpandReplaceAll('\\$', '\\.') else getInterfacePackageName(gc.genPackage) + '.' + gc.ecoreClass.name endif)
+ return getGenPackageQualifiedInterfaceName(gc)
}
--