Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » [ECP] Changing tree node labels - generic approach
[ECP] Changing tree node labels - generic approach [message #1720703] |
Wed, 20 January 2016 11:07 |
Roxana Paun Messages: 7 Registered: October 2015 |
Junior Member |
|
|
Hello everyone,
I need some help with the tree node labels in ECP. I want to change these labels in a more generic way. By changing I mean that instead of the <model element name + name/type/other attribute> label, I want to have the <model element name + a computation of different values> label (for example, a computation could be the name of an attribute + the value of another attribute).
I've found one approach in the Adapt Label section from the eclipsesource.com, How To Customize the EMF Client Platform (sorry, cannot add an external link yet), but it is not what I am looking for. I do not want to modify the getText() method, since there are many elements with different kind of computations. I'm searching for a generic solution, that can be later used by another user/developer for many other elements, without any code changes. Is there any way to provide this behavior?
Any suggestions will be appreciated,
Roxana
|
|
|
Re: [ECP] Changing tree node labels - generic approach [message #1720804 is a reply to message #1720703] |
Thu, 21 January 2016 07:44 |
Jonas Helming Messages: 699 Registered: July 2009 |
Senior Member |
|
|
Hi,
can the behavior be implemented in a generic way, meaning is the
calculation the same for all elements?
Best regards
Jonas
Am 20.01.2016 um 12:07 schrieb Roxana Paun:
> Hello everyone,
>
> I need some help with the tree node labels in ECP. I want to change
> these labels in a more generic way. By changing I mean that instead of
> the <model element name + name/type/other attribute> label, I want to
> have the <model element name + a computation of different values> label
> (for example, a computation could be the name of an attribute + the
> value of another attribute).
>
> I've found one approach in the Adapt Label section from the
> eclipsesource.com, How To Customize the EMF Client Platform (sorry,
> cannot add an external link yet), but it is not what I am looking for. I
> do not want to modify the getText() method, since there are many
> elements with different kind of computations. I'm searching for a
> generic solution, that can be later used by another user/developer for
> many other elements, without any code changes. Is there any way to
> provide this behavior?
>
> Any suggestions will be appreciated,
> Roxana
--
--
Jonas Helming
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
| | | |
Re: [ECP] Changing tree node labels - generic approach [message #1721150 is a reply to message #1721022] |
Mon, 25 January 2016 09:17 |
Jonas Helming Messages: 699 Registered: July 2009 |
Senior Member |
|
|
Hi,
ECP uses the default label provider, so any solution, which works with
them in general should work with ECP, too.
Best regards
Jonas
Am 22.01.2016 um 17:13 schrieb Roxana Paun:
> Hi, Jonas,
>
> Thank you for your input. We have to decide what will be the approach.
> Perhaps we will go with replacing the getText() methods.
>
> I've tried also an approach with OCL, with derivations. I've created an
> attribute, not editable, which has the required computation set as a
> derivation. This attribute should be used as Label Feature. I think it
> could be a good solution, if I would be able to make the derivation work
> inside ECP. But at this moment it doesn't.
>
> Best regards,
> Roxana
--
--
Jonas Helming
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
Goto Forum:
Current Time: Fri Sep 20 23:07:49 GMT 2024
Powered by FUDForum. Page generated in 0.03923 seconds
|