Bug 260574 - [CommonNavigator] ResourceExtensionContentProvider and WorkbenchContentProvider do not support IResourceDelta.CONTENT changes to indivdual files.
Summary: [CommonNavigator] ResourceExtensionContentProvider and WorkbenchContentProvid...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Francis Upton IV CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-09 13:53 EST by Paul Slauenwhite CLA
Modified: 2019-09-06 16:06 EDT (History)
4 users (show)

See Also:


Attachments
Patch for WorkbenchContentProvider.java. (1.32 KB, patch)
2009-01-09 13:54 EST, Paul Slauenwhite CLA
no flags Details | Diff
Patch for ResourceExtensionContentProvider.java. (1.59 KB, patch)
2009-01-09 13:55 EST, Paul Slauenwhite CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Slauenwhite CLA 2009-01-09 13:53:38 EST
ResourceExtensionContentProvider and WorkbenchContentProvider do not support IResourceDelta.CONTENT changes to indivdual files.

We are implementing a navigator built on the Common Navigator Framework (CNF) that overrides the 'org.eclipse.ui.navigator.resourceContent' navigator content extension (/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/ResourceExtensionContentProvider.java content provider).  When a the content of a targeted file is updated in the local workspace, the /org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/workbench/ResourceExtensionContentProvider.java does refresh the individual file (instead refreshing the directory containing the file), which is required by implementation of a IPipelinedTreeContentProvider content provider.

Note, the same fix would apply to the /org.eclipse.ui.ide/extensions/org/eclipse/ui/model/WorkbenchContentProvider.java content provider.
Comment 1 Paul Slauenwhite CLA 2009-01-09 13:54:55 EST
Created attachment 122145 [details]
Patch for WorkbenchContentProvider.java.
Comment 2 Paul Slauenwhite CLA 2009-01-09 13:55:32 EST
Created attachment 122146 [details]
Patch for ResourceExtensionContentProvider.java.
Comment 3 Paul Webster CLA 2009-01-12 09:45:26 EST
Wouldn't refreshing the directory on every change be expensive?

PW
Comment 4 Paul Slauenwhite CLA 2009-01-12 09:56:40 EST
(In reply to comment #3)
> Wouldn't refreshing the directory on every change be expensive?
> 
> PW
> 

The proposal is to refresh every file.  The code currently refreshes the parent directory, which could be optimized once this patch is applied.
Comment 5 John Arthorne CLA 2009-01-12 11:05:43 EST
It's certainly a big potential new cost. Think of operations like big workspace builds, that currently make no structural changes and thus have very little overhead for WorkbenchContentProvider. Once you also consider content changes you are introducing a very large number of new refreshes, which many clients of WorkbenchContentProvider don't care about. Minimally this should be optional behavior controlled by some flag, so that only trees that are affected by content changes get the refreshes (such as your custom navigator). WorkbenchContentProvider is API with a large number of existing clients, who should *not* be getting extra refreshes unless they opt into it.
Comment 6 Paul Slauenwhite CLA 2009-01-12 11:20:50 EST
(In reply to comment #5)
> It's certainly a big potential new cost. Think of operations like big workspace
> builds, that currently make no structural changes and thus have very little
> overhead for WorkbenchContentProvider. Once you also consider content changes
> you are introducing a very large number of new refreshes, which many clients of
> WorkbenchContentProvider don't care about. Minimally this should be optional
> behavior controlled by some flag, so that only trees that are affected by
> content changes get the refreshes (such as your custom navigator).
> WorkbenchContentProvider is API with a large number of existing clients, who
> should *not* be getting extra refreshes unless they opt into it.
> 

I would agree.  A flag would be the best route.
Comment 7 Francis Upton IV CLA 2009-01-12 12:11:42 EST
Paul, would you mind revising your patches to include some kind of flag?
Comment 8 Paul Slauenwhite CLA 2009-01-12 12:33:52 EST
(In reply to comment #7)
> Paul, would you mind revising your patches to include some kind of flag?
> 

Sure when I return to the office (out this week at a customer site) on 01/19 (earliest).  
Comment 9 Michael D. Elder CLA 2009-01-12 14:44:52 EST
The code currently refreshes the parent based on marker changes; so the actual changes that occur for content on a large build would be the same for most Java workspaces that have their warnings/compilation flags updated during the build. 

Alternatively to adding code strictly for IFiles, you could rely on the code that supplies a refreshable for the parent; again for most files the save would potentially update markers and content; it happens that Paul's example doesn't update the markers. 

The Resource Extension that handles notifying trees is already optimized to queue a batch of refresh actions as a result of processing a delta, so they occur with minimal impact on the UI.
Comment 10 John Arthorne CLA 2009-01-12 17:09:40 EST
Michael, I don't see where it is responding to marker changes in either WorkbenchContentProvider or ResourceExtensionContentProvider... where does this happen?
Comment 11 Paul Slauenwhite CLA 2009-07-06 15:59:23 EDT
(In reply to comment #8)
> (In reply to comment #7)
> > Paul, would you mind revising your patches to include some kind of flag?
> > 
> 
> Sure when I return to the office (out this week at a customer site) on 01/19
> (earliest).  
> 

Francis, unfortunately, I will not be able to contribute any resources to revising the attached patch. 
Comment 12 Eclipse Webmaster CLA 2019-09-06 16:06:26 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.