Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
Roxana Paun is currently offline Roxana PaunFriend
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 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
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 #1720816 is a reply to message #1720804] Thu, 21 January 2016 09:07 Go to previous messageGo to next message
Roxana Paun is currently offline Roxana PaunFriend
Messages: 7
Registered: October 2015
Junior Member
Hi,

The calculation is not the same. Perhaps 'generic way' is a little bit ambiguous. I would like that the solution will allow to make these changes using the .ecore or/and .genmodel files (or any other way that could be used by a non-developer user).

Regards,
Roxana
Re: [ECP] Changing tree node labels - generic approach [message #1720957 is a reply to message #1720816] Fri, 22 January 2016 08:27 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

I think in this way, you will need to extend the code generation. If you
do not want to do it yourself, we do provide professional service to
assist you with these kind of adaptions, please let me know, if you are
interested in that: jhelming@xxxxxxxx

Best regards

Jonas


Am 21.01.2016 um 10:07 schrieb Roxana Paun:
> Hi,
>
> The calculation is not the same. Perhaps 'generic way' is a little bit
> ambiguous. I would like that the solution will allow to make these
> changes using the .ecore or/and .genmodel files (or any other way that
> could be used by a non-developer user).
>
> Regards,
> Roxana


--
--

Jonas Helming

Get professional Eclipse developer support:

http://eclipsesource.com/en/services/developer-support/
Re: [ECP] Changing tree node labels - generic approach [message #1721022 is a reply to message #1720957] Fri, 22 January 2016 16:13 Go to previous messageGo to next message
Roxana Paun is currently offline Roxana PaunFriend
Messages: 7
Registered: October 2015
Junior Member
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
Re: [ECP] Changing tree node labels - generic approach [message #1721150 is a reply to message #1721022] Mon, 25 January 2016 09:17 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
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/
Previous Topic:[solved][Teneo] Persistence mapping builder looking for everything
Next Topic:[Edapt] Can I use Edapt to migrate view models?
Goto Forum:
  


Current Time: Fri Apr 19 03:15:14 GMT 2024

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

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

Back to the top