Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Other/Custom names for objects in EMF-Plugin
Other/Custom names for objects in EMF-Plugin [message #1052698] Tue, 30 April 2013 12:22 Go to next message
Joris Lückenga is currently offline Joris LückengaFriend
Messages: 7
Registered: March 2013
Junior Member
Hey everyone,

I hope this question is trivial to answer - but it´s not easy to findy anything about it :/ . I'm using generated Code from an Ecore-Model that I got from an XML Schema file. Now I already used the generated objects in my own code very frequently. When I created the Ecore Model from the Schema File, the Ecore automatically added a "T" to my class "Object". So the Class is called "TObject" now (and that´s ok, because i don´t like to use "Object" in my code). When I start the Plugin, I can create new "TObjects" in my Editor. But in that case - during the runtime - i want the display-name of my "TObject" in the Editor to be only "Object".

In Addition to that, there is a field "Label Feature" in the Genmodel. When i run the plugin, the parameter specified in "Label Feature" is displayed after the class-name. I would prefer if i could leave this field empty (Without "hacking" it by adding an EAttribute with an empty String an selecting it in the Label Feature").

Are these types of customization possible?
I would really appreciate some help Smile

[Updated on: Tue, 30 April 2013 12:23]

Report message to a moderator

Re: Other/Custom names for Objects in EMF-Plugin [message #1052709 is a reply to message #1052698] Tue, 30 April 2013 12:44 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26283
Registered: July 2009
Senior Member
Joris,

Comments below.

On 30/04/2013 2:22 PM, Joris Lückenga wrote:
>
> Hey everyone,
>
> I hope this question is trivial to answer - but it´s not easy to findy
> anything about it :/ . I'm using generated Code from an Ecore-Model
> that I got from an XML Schema file. Now I already used the generated
> objects in my own code very frequently. When I created the Ecore Model
> from the Schema File, the Ecore automatically added a "T" to my class
> "Object". So the Class is called "TObject" now (and that´s ok, because
> i don´t like to use "Object" in my code). When I start the Plugin, I
> can create new "TObjects" in my Editor. But in that case - during the
> runtime - i want the display-name of my "TObject" in the Editor to be
> only "Object".
The translated/display names for those things are in the
plugin.properties of the generated *.edit project.
>
> In Addition to that, there is a field "Label Feature" in the Genmodel.
> When i run the plugin, the parameter specified in "Label Feature" is
> displayed after the class-name. I would prefer if i could leave this
> field empty (Without "hacking" it by adding an EAttribute with an
> empty String an selecting it in the Label Feature").
Generally you'll need to specialize the generated getText of the item
providers if you don't like how they display the label. Remember to mark
them @generated not if you modify them so you can regenerate without
losing your changes.
> Are these types of customization possible?
> I would really appreciate some help :)
Re: Other/Custom names for Objects in EMF-Plugin [message #1052718 is a reply to message #1052709] Tue, 30 April 2013 12:54 Go to previous message
Joris Lückenga is currently offline Joris LückengaFriend
Messages: 7
Registered: March 2013
Junior Member
Wow, that's solving my problem in a lot easier way than I expected!
Thank you very much Smile
Previous Topic:[CDO] CDOIDUtil.read - Illegal type: OBJECT
Next Topic:Create EMF project using mdl file
Goto Forum:
  


Current Time: Fri Dec 19 21:12:14 GMT 2014

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

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