Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Customize EMF Enums
Customize EMF Enums [message #1059785] Tue, 21 May 2013 15:19 Go to next message
Dennis Melzer is currently offline Dennis MelzerFriend
Messages: 244
Registered: July 2009
Senior Member
Hello,

how can i customize a EMF Enum. I want to use another object in the value textfield (properties view), but the textfield only accepted int values.

Generated Code
public enum EnumTest implements Enumerator
{
	TEST(0, "Test", "Test"), //$NON-NLS-1$ //$NON-NLS-2$


But i want to generate such code:
public enum EnumTest implements Enumerator
{
	TEST(AnotherClass.INTEGER_VALUE, "Test", "Test"), //$NON-NLS-1$ //$NON-NLS-2$


Is there a possiblity in EMF?

Thanks
Re: Customize EMF Enums [message #1059865 is a reply to message #1059785] Wed, 22 May 2013 03:10 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
That's not possible other than by hand modifying the generated code.


On 21/05/2013 5:19 PM, Sir Wayne wrote:
> Hello,
>
> how can i customize a EMF Enum. I want to use another object in the
> value textfield (properties view), but the textfield only accepted int
> values.
> Generated Code
>
> public enum EnumTest implements Enumerator
> {
> TEST(0, "Test", "Test"), //$NON-NLS-1$ //$NON-NLS-2$
>
>
> But i want to generate such code:
>
> public enum EnumTest implements Enumerator
> {
> TEST(AnotherClass.INTEGER_VALUE, "Test", "Test"), //$NON-NLS-1$
> //$NON-NLS-2$
>
>
> Is there a possiblity in EMF?
>
> Thanks


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Customize EMF Enums [message #1059967 is a reply to message #1059865] Wed, 22 May 2013 11:49 Go to previous messageGo to next message
Dennis Melzer is currently offline Dennis MelzerFriend
Messages: 244
Registered: July 2009
Senior Member
Thank you for your quick reply.

Should i create a improvement ticket?
Re: Customize EMF Enums [message #1059974 is a reply to message #1059967] Wed, 22 May 2013 12:07 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
No, the Ecore model doesn't support that; it needs the actual value to
support dynamic models and to provide those values reflectively.


On 22/05/2013 1:49 PM, Sir Wayne wrote:
> Thank you for your quick reply.
>
> Should i create a improvement ticket?


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[Edapt] Factory problems ...
Next Topic:[CDO] Clearing a CDOResource content which has a Proxy object
Goto Forum:
  


Current Time: Thu Apr 25 23:04:46 GMT 2024

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

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

Back to the top