Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 108128 - WorkbenchContentProvider does not update for properties changes
Summary: WorkbenchContentProvider does not update for properties changes
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-26 11:10 EDT by Tod Creasey CLA
Modified: 2005-09-08 11:42 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tod Creasey CLA 2005-08-26 11:10:53 EDT
M1

Consider the following decorator markup

 <extension
         point="org.eclipse.ui.decorators">
      <decorator
            adaptable="true"
            icon="icons/binary_co.gif"
            id="ContentTypeTest.decorator2"
            label="ContentTypeTest.decorator2"
            location="TOP_LEFT">
          <enablement>
            <and>
               <objectClass name="org.eclipse.core.resources.IProject"/>
               <pluginState 
                 id="org.eclipse.jdt.debug.ui"
                 value="activated"/>
            </and>
         </enablement>
      </decorator>
   </extension>

This will not update in the ResourceNavigator because the resourceChanged events
are not being fired when this property changes.

See Bug 106395 for more background
Comment 1 Michael Valenta CLA 2005-08-26 11:39:00 EDT
I don't think bug 106395 was the bug you wanted to reference.
Comment 2 Dirk Baeumer CLA 2005-08-26 12:44:51 EDT
I think handling the label decorator triggering in the workbench content
provider is the wrong think to do since only a handfull views in Eclipse are
using this provider. Doing so will force all other views to do the same which
will never happen (for example CVS and package explorer will not profit from
this). I think the problem should be solved in the following way:

The declarative label decorator manager should trigger the label updates. It
knows about the enablement sections of the delcared label decorators. For
example if now plug-in state decorator is registered there is no need to listen
to bundle changes. I know that such an implementation isn't easy but it is IMO
the only way to solve this issue in a general way.
Comment 3 Michael Valenta CLA 2005-08-26 13:09:31 EDT
The declarative decorator case is interesting. For the CVS decorator, we 
assume that it is our reponsibility to issue label changes when state that 
affects the decorator changes. If you apply this same logic to a declaritive 
decorator, it definitly would indicate that the declarative decorator (or the 
decorator manager) is reponsible for issuing the label changes. The problem is 
that the decorator is enabled/disabled using an enablement rule that has no 
knowledge that it is being used to determine a decorator state. It seems like 
the enablement rules themselves need a state change notification mechanism so 
that the declarative decorator will know when it needs to fire label changes.
Comment 4 Tod Creasey CLA 2005-08-26 13:11:54 EDT
The issue is two fold with doing that

1) redundant events. Anyone who listens to resources for any reasons and sends
an update will now get two updates

2) Label providers do not start the process - they are objects that get requests
from other objects to get images and text. Hooking up the label provider to
listen to workbench events is inconsistent.

If we were to add this sort of listening anywhere outside of a content provider
it would be the decorator manager - the issue there is performance however. I am
concerned about the amount of redundant events that would generate if the views
are taken out of the equation.

As to your point about declarative decorators I think this is a general issue
for all decorators as they have this enablement issue too - I think it is too
much work for a decorator implementor to hook this up as well.
Comment 5 Tod Creasey CLA 2005-08-26 13:17:36 EDT
Should be Bug 106305
Comment 6 Tod Creasey CLA 2005-09-08 11:42:16 EDT
I agree with Dirk - we are going for a more general solution to this issue.