[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmt] Re: [Epsilon]EWL finding EClass

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/org.eclipse.epsilon.book/EpsilonBook.pdf)


Thank you in advance,
Kimon

Cheers, Dimitris