Skip to main content


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: 33113
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 :)


Ed Merks
Professional Support: https://www.macromodeling.com/
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 messageGo to next 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
Re: Other/Custom names for Objects in EMF-Plugin [message #1863905 is a reply to message #1052718] Tue, 05 March 2024 09:35 Go to previous message
Sachin Goyal is currently offline Sachin GoyalFriend
Messages: 12
Registered: February 2024
Junior Member
Hey, i get this solution in 2024 fortunately.
And it's something that is currently in my use but some editing needed.

I want to rename one object label at the runtime as it's parameter name. But i also want to change the name of the other objects to the parameter name of this object that currently contains this object.

Let's say I have A and B class.
and every object of B class contains one object of Class A associated with it.
Now, If you provide the name to the object of A, then the label of A's object if getting changed that's good but i also want to change the name of the object of B who is associated with this A's object in any way.

Can i do that because it will automate my whole thing and UI will look more nicer and i will not have to do the linking with A's object.

Any help would be appreciated.

Thanks in advance.
Previous Topic:How to change name of multiple objects by changing the name of only one
Next Topic:Instance level permissions
Goto Forum:
  


Current Time: Fri Mar 29 10:54:37 GMT 2024

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

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

Back to the top