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 18:33 Go to next message
Kimon Polychroniadis is currently offline Kimon Polychroniadis
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 02:50 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
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 02:50 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
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: Thu Jul 24 21:34:26 EDT 2014

Powered by FUDForum. Page generated in 0.01688 seconds