summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Efftinge2011-09-26 11:51:31 (EDT)
committer Ed Merks2011-09-26 11:51:31 (EDT)
commite568d27d39bb04a1116b3e6f5777811a1f244393 (patch)
tree67bd166f824436d50393ddacccac253082afb873
parent58c803fdb9683b2e4d6b44110803a9154a522086 (diff)
downloadorg.eclipse.emf-e568d27d39bb04a1116b3e6f5777811a1f244393.zip
org.eclipse.emf-e568d27d39bb04a1116b3e6f5777811a1f244393.tar.gz
org.eclipse.emf-e568d27d39bb04a1116b3e6f5777811a1f244393.tar.bz2
added indexing of local GenDatatypes
-rw-r--r--org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/scoping/LazyCreationProxyUriConverter.java2
-rw-r--r--org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/scoping/XcoreResourceDescriptionStrategy.java11
2 files changed, 13 insertions, 0 deletions
diff --git a/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/scoping/LazyCreationProxyUriConverter.java b/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/scoping/LazyCreationProxyUriConverter.java
index 84c2935..b88c8be 100644
--- a/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/scoping/LazyCreationProxyUriConverter.java
+++ b/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/scoping/LazyCreationProxyUriConverter.java
@@ -27,9 +27,11 @@ public class LazyCreationProxyUriConverter {
{
EClass eclass = EcorePackage.Literals.ECLASS;
EClass genClass = GenModelPackage.Literals.GEN_CLASS;
+ EClass genDatatype = GenModelPackage.Literals.GEN_DATA_TYPE;
EClass jvmGenericType = TypesPackage.Literals.JVM_GENERIC_TYPE;
types.put(eclass.getName(), eclass);
types.put(genClass.getName(), genClass);
+ types.put(genDatatype.getName(), genDatatype);
types.put(jvmGenericType.getName(), jvmGenericType);
}
diff --git a/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/scoping/XcoreResourceDescriptionStrategy.java b/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/scoping/XcoreResourceDescriptionStrategy.java
index f7abf2d..507fe26 100644
--- a/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/scoping/XcoreResourceDescriptionStrategy.java
+++ b/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/scoping/XcoreResourceDescriptionStrategy.java
@@ -1,12 +1,14 @@
package org.eclipse.emf.ecore.xcore.scoping;
import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
+import org.eclipse.emf.codegen.ecore.genmodel.GenDataType;
import org.eclipse.emf.codegen.ecore.genmodel.GenModelFactory;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EcoreFactory;
import org.eclipse.emf.ecore.xcore.XClass;
+import org.eclipse.emf.ecore.xcore.XDataType;
import org.eclipse.xtext.common.types.JvmGenericType;
import org.eclipse.xtext.common.types.TypesFactory;
import org.eclipse.xtext.naming.IQualifiedNameProvider;
@@ -46,6 +48,15 @@ public class XcoreResourceDescriptionStrategy extends DefaultResourceDescription
}
return false;
}
+ if (eObject instanceof XDataType) {
+ QualifiedName qn = nameProvider.getFullyQualifiedName(eObject);
+ if (qn != null) {
+ GenDataType genDatatype = genFactory.createGenDataType();
+ proxyTool.installProxyURI(eObject.eResource().getURI(), genDatatype, qn);
+ acceptor.accept(EObjectDescription.create(qn, genDatatype));
+ }
+ return false;
+ }
return true;
}