Thanks for your help!
After some additional analyses of the code I found the problem. We have a ResourceChangeListener that fires a LabelProviderChangedEvent containing the elements to be updated. After importing a project, all resources are treated as ADDED and this results in a decoration of all resources. When removing the elements array from the LabelProviderChangedEvent constructor and firing a generic event, this problem is solved, i.e. only visible elements are decorated.
Cheers,
Philipp
From: platform-ui-dev-bounces@xxxxxxxxxxx [mailto:platform-ui-dev-bounces@xxxxxxxxxxx] On Behalf Of Oleg Besedin
Sent: Mittwoch, 26. Januar 2011 16:25
To: Eclipse Platform UI component developers list.
Subject: Re: [platform-ui-dev] Initial decoration
> The one thing that still bothers me is that Eclipse seems to trigger a complete decoration of all resources when a new Eclipse workspace is created and a (Git) project is freshly imported.
That does not sound right. If you create a simple plugin with a decorator, for instance, using a new project wizard -> custom -> Icon Decorator, and play with it you'll notice that it is only called for visible elements. Or you can add a text decorator to the template and override
public String decorateText(String text, Object element) {
System.out.println(element);
return "[deco]"+text;
}
to double-check it.
The catch is that decorations are typically triggered by views. It is up to a view to say which elements it wants decorated. For instance, for Java perspective, it starts with TreeViewers from Package Explorer or Project Explorer (AbstractTreeViewer#updateItem()).
If you have a Git-specific view that triggers update on all items, not just visible items, that would trigger all decorators.
So, the most likely suspects are:
- the way decorators are calculated in your project makes them depend on decorators of contained elements (I *think* this is the case for CVS, and CVS supplies an option to turn it off to improve performance), or
- there is a view that triggers updates on all items, including not visible items.
If that is not the case, please open a bug with code that allows us to reproduce this problem.
Sincerely,
Oleg Besedin
From: | "Thun, Philipp" <philipp.thun@xxxxxxx> |
To: | "platform-ui-dev@xxxxxxxxxxx" <platform-ui-dev@xxxxxxxxxxx> |
Date: | 01/26/2011 07:09 AM |
Subject: | [platform-ui-dev] Initial decoration |
Sent by: | platform-ui-dev-bounces@xxxxxxxxxxx |
Hello Eclipse UI developers!
I have been struggling now for a while with a custom decorator in Eclipse and could not find a solution to my problem by searching the web. Thus I am posting my question to this mailing list…
I have been working now for some days on improving the performance of decorators for the EGit plug-in. The one thing that still bothers me is that Eclipse seems to trigger a complete decoration of all resources when a new Eclipse workspace is created and a (Git) project is freshly imported. This means that for a huge repository/project with 15.000 files, all 15.000 resources are decorated although most of them are not visible at that time.
Is it possible to exclude a specific decorator from this initial run triggered by Eclipse or to somehow abort this initial decoration?
Thanks,
Philipp
_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-ui-dev