Skip to main content



      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 08:22 Go to next message
Eclipse UserFriend
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 08:23] by Moderator

Re: Other/Custom names for Objects in EMF-Plugin [message #1052709 is a reply to message #1052698] Tue, 30 April 2013 08:44 Go to previous messageGo to next message
Eclipse UserFriend
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 08:54 Go to previous messageGo to next message
Eclipse UserFriend
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 04:35 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 16:45:37 EDT 2025

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

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

Back to the top