Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2006-11-02 17:34:35 +0000
committeratikhomirov2006-11-02 17:34:35 +0000
commitc528ee568808998e7e00829e83ab3295559ba44c (patch)
tree23fe58decdd3bd45e8a3da0d88aafd1a59aac0d3
parentd3426e8b332b89623084e28a8836afb93c39f484 (diff)
downloadorg.eclipse.gmf-tooling-c528ee568808998e7e00829e83ab3295559ba44c.tar.gz
org.eclipse.gmf-tooling-c528ee568808998e7e00829e83ab3295559ba44c.tar.xz
org.eclipse.gmf-tooling-c528ee568808998e7e00829e83ab3295559ba44c.zip
detect nested type for collections
-rw-r--r--plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/BuiltinMetaModel.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/BuiltinMetaModel.java b/plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/BuiltinMetaModel.java
index 7f752d2e8..90181f18c 100644
--- a/plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/BuiltinMetaModel.java
+++ b/plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/BuiltinMetaModel.java
@@ -209,15 +209,19 @@ public class BuiltinMetaModel {
if (obj instanceof EObject) {
return ((EObject) obj).eClass();
}
- // FIXME reuse
if (obj instanceof Collection) {
+ EClassifier type = null;
+ if (!((Collection) obj).isEmpty()) {
+ // FIXME respect all! elements in the collection, not only the first one
+ type = getType(((Collection) obj).iterator().next());
+ }
if (obj instanceof Set) {
- return CollectionTypesSupport.SET_OF_OBJECT;
+ return collectionTypes.getSetType(type);
}
if (obj instanceof List) {
- return CollectionTypesSupport.LIST_OF_OBJECT;
+ return collectionTypes.getListType(type);
}
- return CollectionTypesSupport.COLLECTION_OF_OBJECT;
+ return collectionTypes.getCollectionType(type);
}
if (obj instanceof Boolean) {
return EcorePackage.eINSTANCE.getEBoolean();

Back to the top