[Epsilon]EWL finding EClass [message #385318] |
Mon, 01 September 2008 18:33  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.05653 seconds