Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Performance issue related to forcing decorator updates in the Model Explorer
Performance issue related to forcing decorator updates in the Model Explorer [message #1405370] Thu, 07 August 2014 07:48 Go to next message
Thomas Wiman is currently offline Thomas WimanFriend
Messages: 83
Registered: June 2012
Location: Stockholm , Sweden
Member

I have a plugin that decorates the UML-elements in the Papyrus Model Explorer.

In some situations I need to to force the update of the decorators by creating LabelProviderChangeEvents.

To be able to do so I need to get hold of the Model Explorer´s EObjectTreeElement related to the UML element, as it will be the parameter to the LabelProviderChangeEvent´s constructor.

This is currently achieved by using the content provider related to the Model Exporer and call its getChildren() method recursivly until finding the corresponding UML element. However, I find the ContentProvider.getChildren() method quite slow, especially on large models.

Is there any fast (utility) method available for getting hold of the EObjectTreeElement related to the UML element, as there is in RSA for example? Or is there any other fast way that I can force a decorator update for a specific UML element, alternativly some ideas on how to refresh all decorators programatically.
Re: Performance issue related to forcing decorator updates in the Model Explorer [message #1412551 is a reply to message #1405370] Tue, 26 August 2014 12:35 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, Thomas,

The Model Explorer's reliance on (a fork of) EMF Facet for
customization does tend to introduce a lot of work into the calculation
of the tree structure. I'm currently looking into ways to improve
performance, here (see, for example, bug 441857 [1]).

Conceptually, looking up some model element in the tree isn't
straight-forward, because customizations could present the same element
in any number of ways (even multiple times). Maintaining mappings for
quick access can be assumed to have its own performance challenges.
I'm afraid I don't have any answers for you at the moment, but I
certainly am open to ideas ...

Cheers,

Christian


[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=441857


On 2014-08-07 14:15:47 +0000, Thomas Wiman said:

> I have a plugin that decorates the UML-elements in the Papyrus Model Explorer.
>
> In some situations I need to to force the update of the decorators by
> creating LabelProviderChangeEvents.
>
> To be able to do so I need to get hold of the Model Explorer´s
> EObjectTreeElement related to the UML element, as it will be the
> parameter to the LabelProviderChangeEvent´s constructor.
>
> This is currently achieved by using the content provider related to the
> Model Exporer and call its getChildren() method recursivly until
> finding the corresponding UML element. However, I find the
> ContentProvider.getChildren() method quite slow, especially on large
> models.
> Is there any fast (utility) method available for getting hold of the
> EObjectTreeElement related to the UML element, as there is in RSA for
> example? Or is there any other fast way that I can force a decorator
> update for a specific UML element, alternativly some ideas on how to
> refresh all decorators programatically.
Re: Performance issue related to forcing decorator updates in the Model Explorer [message #1412858 is a reply to message #1412551] Wed, 27 August 2014 08:41 Go to previous message
Thomas Wiman is currently offline Thomas WimanFriend
Messages: 83
Registered: June 2012
Location: Stockholm , Sweden
Member

Hi Christian,

Thanks for the information.

Currently I invoke the refresh() method on the Viewer object when I want to force the update of the decorations, instead of trying to find the right EObjectTreeElement(s) in the model explorer.

That works fine for my needs and I have not, so far, identified any drawbacks.

/Thomas


Thomas Wiman
MetaModelAgent Product Manager
Previous Topic:Create graphic elements programmatically
Next Topic:Custom Model Validation
Goto Forum:
  


Current Time: Thu Apr 25 07:09:51 GMT 2024

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

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

Back to the top