Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to get enums per emf reflections?
How to get enums per emf reflections? [message #1831803] Sun, 30 August 2020 08:12 Go to next message
Dimg Cim is currently offline Dimg CimFriend
Messages: 56
Registered: December 2015
Member
Hello all,

I am on imlementing a formular renderer based on a Emf class attributes. Currently the formular can find out all EAttributes and EReferences. My issue is eObject.eClass().getEAllAttributes() don't list me the enum attibutes. How can I access the enums?

EList<EAttribute> attributes = eObject.eClass().getEAllAttributes();
EList<EReference> eAllReferences = eObject.eClass().getEReferences();

for (EAttribute eAttribute : attributes) {
  // Render attributes
}

for (EReference eReference : eAllReferences) {
  // Render references
}


Are there something like eObject.eClass().getEEnums(); ?

Best regards
cim

--> Please close this thread the EAllAttributes() displayed all attributes of a class. I misunderstood that. Thanks.

[Updated on: Sun, 30 August 2020 08:22]

Report message to a moderator

Re: How to get enums per emf reflections? [message #1831804 is a reply to message #1831803] Sun, 30 August 2020 08:49 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31843
Registered: July 2009
Senior Member
Yes eObject.eClass().getEAllAttributes() returns all EAttributes including those whose getEAttributeType() is an instanceof EEnum from which you can call getELiterals() to get all the literals.

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Load an ecore file programmatically
Next Topic:Textual to graphical or vice versa tools
Goto Forum:
  


Current Time: Wed Apr 21 12:30:09 GMT 2021

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

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

Back to the top