Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMT (Generative Modeling Technologies) » [Epsilon]EWL finding EClass
[Epsilon]EWL finding EClass [message #385318] Mon, 01 September 2008 22:33 Go to next message
Kimon Polychroniadis is currently offline Kimon PolychroniadisFriend
Messages: 30
Registered: July 2009
Member
Hello,

I am trying to find the type of a model element in one of my wizards.
For example, I want the wizard to find the type of an element "A" and
print it. Could you please inform me on (EOL,I suppose) the function used?

Moreover, could you please tell me how I can find whether a reference of
a model element is null. For example, how I can find whether
A.relationToB returns null (supposing that B is not assigned to the
'relationToB' reference defined in the model)?

I was quite happy to get my hands on the EpsilonBook but I didn't find
anything related to that. I apologize for the size of the message.

Thank you in advance,
Kimon
Re: [Epsilon]EWL finding EClass [message #385319 is a reply to message #385318] Tue, 02 September 2008 06:50 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Kimon,

See comments inline

Kimon Polychroniadis wrote:
> Hello,
>
> I am trying to find the type of a model element in one of my wizards.
> For example, I want the wizard to find the type of an element "A" and
> print it. Could you please inform me on (EOL,I suppose) the function used?
>

you can use the EMF .eClass() method which returns the respective ECore
EClass.

> Moreover, could you please tell me how I can find whether a reference of
> a model element is null. For example, how I can find whether
> A.relationToB returns null (supposing that B is not assigned to the
> 'relationToB' reference defined in the model)?

You can check for null using the isDefined() operation. i.e.
A.relationToB.isDefined()
>
> I was quite happy to get my hands on the EpsilonBook but I didn't find
> anything related to that. I apologize for the size of the message.
>

The book is accessible through the documentation page
(www.eclipse.org/gmt/epsilon/doc). (direct link
http://epsilonlabs.svn.sourceforge.net/svnroot/epsilonlabs/o rg.eclipse.epsilon.book/EpsilonBook.pdf)

> Thank you in advance,
> Kimon

Cheers,
Dimitris
Re: [Epsilon]EWL finding EClass [message #621749 is a reply to message #385318] Tue, 02 September 2008 06:50 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Kimon,

See comments inline

Kimon Polychroniadis wrote:
> Hello,
>
> I am trying to find the type of a model element in one of my wizards.
> For example, I want the wizard to find the type of an element "A" and
> print it. Could you please inform me on (EOL,I suppose) the function used?
>

you can use the EMF .eClass() method which returns the respective ECore
EClass.

> Moreover, could you please tell me how I can find whether a reference of
> a model element is null. For example, how I can find whether
> A.relationToB returns null (supposing that B is not assigned to the
> 'relationToB' reference defined in the model)?

You can check for null using the isDefined() operation. i.e.
A.relationToB.isDefined()
>
> I was quite happy to get my hands on the EpsilonBook but I didn't find
> anything related to that. I apologize for the size of the message.
>

The book is accessible through the documentation page
(www.eclipse.org/gmt/epsilon/doc). (direct link
http://epsilonlabs.svn.sourceforge.net/svnroot/epsilonlabs/o rg.eclipse.epsilon.book/EpsilonBook.pdf)

> Thank you in advance,
> Kimon

Cheers,
Dimitris
Previous Topic:[Epsilon]EWL finding EClass
Next Topic:[AM3] AM3 Zoos
Goto Forum:
  


Current Time: Sun Nov 23 11:18:59 GMT 2014

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

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