[EUGENIA] EAttribute like EType [message #584850] |
Sat, 23 January 2010 14:19 |
Eclipse User |
|
|
|
Originally posted by: nicolas.rempulski.univ-lr.fr
Hi everybody,
First "bravo" for Eugenia, it's a very usefull tool. I remember playing
with EMF/GMF few years ago and building graph/tool/map files was a real
pain for me.
I try to create an editor to define Entities with Variables. My first
version worked well and Eugenia generated the editor as i meant it to be :
----------
@namespace(uri="entite",prefix="entite")
package entite;
@gmf.node(label = "name")
class EntityClass{
attr String name;
@gmf.link(target.decoration="arrow", style="dash")
ref EntityClass[*] superClass;
@gmf.compartment(foo="bar")
val Variable[*] varsEtat;
}
@gmf.node(label = "name,type", pattern="{0} : {1}")
class Variable{
attr String name;
attr String type;
}
@gmf.diagram(model.extension="entite", diagram.extension="entite_diagram")
class EntityDeclarationDiagram{
val EntityClass[*] classe;
}
----------
"Variable.type" is here encoded in String.
But now I would like to specify the attribute "Variable.type" as a
javaType (Bool, Int, ...) in order to obtain something like EType of
EAttribute in eCore (ComboBox with all EType mapped to Java types).
My first guess was to set the attribute "type" as an java.lang.Object(or
EJavaObject). But as said there
http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg3 5228.html
It's quite difficult to create an Object with string as input ;)
Now I've no clue how I can obtain my EAttribute "type" to propose a list
of java Type. I played with EClass and EDataType but it seems to be
beyond my understanding. So I'm sending out an SoS to find clues ^^
Thanks !
Nicolas
|
|
|
Powered by
FUDForum. Page generated in 0.02883 seconds