Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Setting eReference from Code
Setting eReference from Code [message #421889] Sat, 16 August 2008 17:13 Go to next message
Maurice O'Connor is currently offline Maurice O'ConnorFriend
Messages: 86
Registered: July 2009
Member
Hi there!

I've got a piece of code, creating a SetCommand that looks like this:

Command setCommand = SetCommand.create(editingDomain, foo,
foo.eClass().getEReferences().get(0), bar);

Obviously this is incredibly ugly! Is there any type of reference Id I can
use to clean this up? Much as you use a feature Id in the generated
package.

Thanks!

Maurice
Re: Setting eReference from Code [message #421891 is a reply to message #421889] Sat, 16 August 2008 21:16 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Maurice,

Comments below.

Maurice O'Connor wrote:
> Hi there!
>
> I've got a piece of code, creating a SetCommand that looks like this:
>
> Command setCommand = SetCommand.create(editingDomain, foo,
> foo.eClass().getEReferences().get(0), bar);
Probably you want to use XyzPackage.Literals.ABC__DEF, where ABC is the
name of the class holding the feature and DEF is the name of the feature.
>
>
> Obviously this is incredibly ugly! Is there any type of reference Id I
> can use to clean this up? Much as you use a feature Id in the
> generated package.
>
> Thanks!
>
> Maurice
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:EMF 2.4 and Eclipse 3.3
Next Topic:Properties view and Load Resource - elements with the same name
Goto Forum:
  


Current Time: Fri Apr 19 21:34:56 GMT 2024

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

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

Back to the top