Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 12315

Summary: fireListeners called a huge number of times on startup by CVS decorator
Product: [Eclipse Project] Platform Reporter: Tod Creasey <Tod_Creasey>
Component: TeamAssignee: Kevin McGuire <Kevin_McGuire>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: James_Moody, Kevin_Haaland, Kevin_McGuire
Version: 2.0   
Target Milestone: 2.0 M6   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Bug Depends on:    
Bug Blocks: 10903    

Description Tod Creasey CLA 2002-03-26 15:58:35 EST
Referring to the image Darin S gave us for Bug 10903 when I started it up I 
discovered that fireListeners was called 677 times when the image was invoked. 

Turning on the decorator resulted in the same number of calls to fireListeners.

I tested the same thing with other decorators and fireListeners is not called 
at all so this is not generated by the framework.
Comment 1 Kevin McGuire CLA 2002-03-27 12:58:38 EST
Problem is that because we compute the decorators in a background thread we 
must fire the listeners to get desktop to pick up the new decorators we've just 
computed.

Discussed with Tod the issues surrounding it:

- we need a way of later giving the decorator to the desktop without firing the 
update event, especially since this causes all other decorators to recompute 
themselves needlessly.

- not being asked to decorate items which are not visible would help reduce 
work spent

We can do no better with the current API: computing of decorators is expensive 
and must be done in a background thread, but the current API is not ameanable 
to this threading.

Thus moving the PR to UI.
Comment 2 Tod Creasey CLA 2002-03-28 09:00:22 EST
Supported added for multi element label updates and decoration of text and 
images.

The IBatchLabelDecorator (which extends ILabelDecorator) has been added that 
allows for Decoration of an Image and a Text in the same method invocation 
using the decorateTextAndImage method.

The LabelProviderChangedEvent can now accept an Array of Objects as its 
elements. The default handleLabelProviderChanged method in StructuredViewer now 
calls update(Object[],String[]) rather than update(Object,String[]). The 
previous getElement() API remains and now returns the first element in the list 
of elements if there is one (otherwise null as before).

Moving the PR back to VCM so that it can be closed when the new support is 
integrated.
Comment 3 Kevin McGuire CLA 2002-04-10 16:36:57 EDT
Will move to new API in M6
Comment 4 Kevin McGuire CLA 2002-05-03 16:57:09 EDT
Now use array of elements for event