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: 13
Registered: June 2012
Junior 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 W. Damus is currently offline Christian W. DamusFriend
Messages: 930
Registered: July 2009
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: 13
Registered: June 2012
Junior 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
Previous Topic:Create graphic elements programmatically
Next Topic:Custom Model Validation
Goto Forum:
  


Current Time: Sun Apr 26 10:07:30 GMT 2015

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

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