Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 86493 - Working set decorator does not change when contained resources change
Summary: Working set decorator does not change when contained resources change
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Michael Valenta CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 111200 114755 (view as bug list)
Depends on: 86159
Blocks: 3979
  Show dependency tree
 
Reported: 2005-02-24 11:19 EST by Michael Valenta CLA
Modified: 2006-01-18 16:12 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Valenta CLA 2005-02-24 11:19:08 EST
Working set decorator does not change when contained resources change. We need 
to find a logical place to put the update handling for this. If one can't be 
found, then we can't decorate working sets.
Comment 1 Michael Valenta CLA 2005-02-24 11:21:31 EST
Dirk, do you have ideas for this. The decoration code is not in the build yet 
but it would be nice if working sets that contain shared projects could be 
decorated. The problem is that a label change for the working set would need 
to be fired when any of it's contents changed. Would it be possible for the 
package explorer to do this?
Comment 2 Dirk Baeumer CLA 2005-02-25 08:10:47 EST
Michael, this should be doable. Can we discuss this at EclipseCon since I would
like to understand the implications better. Basically I need a listener on the
working set model which catch label updates and propagates them up to the
working set. To not update too often I somehow should be able to identify these
events.
Comment 3 Michael Valenta CLA 2005-03-29 12:45:08 EST
The ability to decorate ResourceMappings is not going to appear in 3.1. This 
bug does not need to be addressed until it does.
Comment 4 Michael Valenta CLA 2005-08-04 14:48:50 EDT
The code to decorate working sets has been released into 3.2. Working sets 
displayed in the package explorer are decorated but do not update when changes 
occur. I think the easiest fix is for the package explorer to update the 
decorations of a working set whenever the decoration for a direct child 
changes or when a direct child is added or removed. Moving to JDT to consider. 
Let me know if you can't do this for M1 so I can remove the working set 
decoration (i.e. I don't think we want them in for M1 if they do not update).
Comment 5 Michael Valenta CLA 2005-08-04 14:48:56 EDT
*** Bug 105077 has been marked as a duplicate of this bug. ***
Comment 6 Michael Valenta CLA 2005-08-05 12:02:44 EDT
I've had separate discussions with Dirk and Nick and it has become appearent 
that we need a general mechanism to handle this properly so I'm moving this 
back to Team. Dirk, if you can come up with something satisfactory for M1 that 
is not too much work than by all means do so but we'll need to solve this 
problem properly in M2 anyway.

What came out of the discussions is that we need the following:

1) A mechanism to determine which model objects are affected by changes at the 
resource level and the ability to walk the parent chain of these model objects 
(i.e. to be able to fire label change events for all parent objects). This 
could be in the form of an extension point that uses and enablement rule to 
determine whi is interested in changes to particular projects and/or files 
(possibly similar to the refactoring participant extension points).

2) A mechanism to short curcuit the label changes if the state has not changed 
(i.e. redecoration of an entire parent chain may be expensive and should be 
avoided if the state has not changed).
Comment 7 Dirk Baeumer CLA 2005-08-05 12:26:12 EDT
Michael,

I found out what causes the redecorating of the working set on every save. The
root of this is the CVS label decorator which always refreshes the full parent
chain on every save. This basically means that we recompute the error
annotations for all parent elements. Although this might be fine yup to projects
it will definitelly not scale for working sets which can have lots of projects
as well. So I am a little reluctent to release my fix. So I opt for "commenting
out" the label decoration code for working sets for M1.

Regarding item one in comment #6:

We have code that does exactly this. Every label change event that comes into a
Java viewer where the elements are resources gets translated into a label change
event that is Java element based.
Comment 8 Dirk Baeumer CLA 2005-08-05 12:27:17 EDT
Michael, what can we do to avoid sending out this fully parent chain on every save ?
Comment 9 Michael Valenta CLA 2005-08-05 13:14:16 EDT
It has to be done by CVS (or whoever provides the decorator). If CVS could 
walk the parent chain of the affected model objects, it could cache the 
previously calculated dirty state for each model object being decorated. Then 
it would only need to fire a label change and visit parents for objects for 
which the state has changed. We should be able to do this with resources today 
(but obviosuly don't as you have observered). We will need additional API to 
handle model objects that do not have a one-to-one mapping to resources (such 
as working sets).
Comment 10 Dirk Baeumer CLA 2005-08-08 05:11:37 EDT
Michael, as a first step could we optimize the existing code to not send out the
label change events for the whole "resource based" parent chain if not necessary
(e.g cache the state)?
Comment 11 Michael Valenta CLA 2005-08-08 09:38:20 EDT
Yes, that sounds like a gooding starting point.
Comment 12 Dirk Baeumer CLA 2005-08-08 10:56:07 EDT
Please let me know when this is in. I will then revive my patch to marks working
sets as an interim solution until we have the model adapter story.
Comment 13 Michael Valenta CLA 2005-10-04 13:50:06 EDT
*** Bug 111200 has been marked as a duplicate of this bug. ***
Comment 14 Michael Valenta CLA 2006-01-11 16:38:30 EST
I've released some support for this (see bug 121623 and bug 86159). Basically, the way it will work is this:

- the model will determine the dirty state of it's model elements using the API mentioned in bug 86159 and decorate elements accordingly. It will be up to the model to propogate decorations as well.
- the model will indicate to the repository decorator that they are handling the decoration using the API introduced in bug 121623.

I still need a few more API pieces to make this work but I wanted to make you aware of what was happening.
Comment 15 Michael Valenta CLA 2006-01-16 11:07:30 EST
I have released support for this into HEAD. I have logged bug 123978 against JDT/UI that describes how to ensure that working set decorations get updated.
Comment 16 Michael Valenta CLA 2006-01-18 16:12:02 EST
*** Bug 114755 has been marked as a duplicate of this bug. ***