Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EUGENIA] EAttribute like EType
[EUGENIA] EAttribute like EType [message #509603] Sat, 23 January 2010 14:19 Go to next message
Eclipse UserFriend
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
Re: [EUGENIA] EAttribute like EType [message #509629 is a reply to message #509603] Sat, 23 January 2010 18:58 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Nicolas,

Nicolas Rempulski wrote:
> 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.

Thanks you very much! Getting some positive feedback in a forum that's
mostly about problems and bugs is always encouraging and much appreciated!

>
> 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 ^^
>

Perhaps you could create an enumeration with all the supported Java
types and set it as the type of Variable.type. e.g.

enum JavaType {
String;
Integer;
Float;
...
}

and

class Variable {
...
attr JavaType type;
}

> Thanks !
>
> Nicolas
>

Cheers,
Dimitris
Re: [EUGENIA] EAttribute like EType [message #584876 is a reply to message #509603] Sat, 23 January 2010 18:58 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Nicolas,

Nicolas Rempulski wrote:
> 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.

Thanks you very much! Getting some positive feedback in a forum that's
mostly about problems and bugs is always encouraging and much appreciated!

>
> 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 ^^
>

Perhaps you could create an enumeration with all the supported Java
types and set it as the type of Variable.type. e.g.

enum JavaType {
String;
Integer;
Float;
...
}

and

class Variable {
...
attr JavaType type;
}

> Thanks !
>
> Nicolas
>

Cheers,
Dimitris
Previous Topic:problems with generating gmf graph, gmf tool and gmf map models
Next Topic:ETL, ::= and equivalent()
Goto Forum:
  


Current Time: Thu Apr 25 09:57:32 GMT 2024

Powered by FUDForum. Page generated in 0.03093 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top