Bug 255162 - Need an event notifcation when refreshLocal is triggered
Summary: Need an event notifcation when refreshLocal is triggered
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.5 M5   Edit
Assignee: Szymon Brandys CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-13 06:48 EST by Dani Megert CLA
Modified: 2009-02-26 04:28 EST (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 Dani Megert CLA 2008-11-13 06:48:56 EST
I20081111-0800.

When refreshing a resource some other models need to do more work, e.g. the Java model needs to refresh the stuff on the build path of a project. Currently F5/Refresh only works in the Package Explorer because it does this additional work. If F5/Refresh is done in the Navigator or Project Explorer (or any core code calling project.refreshLocal(...)) then the Java model isn't updated.

I suggest that we send out a resourceChanged event when a refresh is done. Models could then do the additional work when they get such an event.
Comment 1 Szymon Brandys CLA 2008-11-13 07:43:27 EST
There is already IResourceChangeEvent#PRE_REFRESH. We can add POST_REFRESH to indicate the end of project refreshing.
Comment 2 Dani Megert CLA 2008-11-13 08:26:28 EST
Yes, post event would be better because then, the model can rely on the resources already being updated.

Also, PRE_REFRESH is pretty limiting because it is only fired for projects i.e. if I refresh the whole workspace no event is fired. Same if refresh a folder or file.
Comment 3 Dani Megert CLA 2008-11-14 04:33:08 EST
>if I refresh the whole workspace no event is fired
Filed bug 255325 to track this.
Comment 4 Szymon Brandys CLA 2009-02-13 10:22:46 EST
(In reply to comment #0)
> 
> I suggest that we send out a resourceChanged event when a refresh is done.
> Models could then do the additional work when they get such an event.
> 

Another approach would be to schedule a workspace job when PRE_REFRESH is caught. This job would start right after refresh is finished.

Comment 5 Jerome Lanneluc CLA 2009-02-23 08:07:33 EST
Only external jars are refreshed differently by the Java model. If we refreshed external jars in PRE_REFRESH, refreshing in the Navigator would behave exactly as in the Package Explorer. 

There is already a request in JDT/Core (can't find it right now) to handle the refresh of external jars in PRE_REFRESH.
Comment 6 Jerome Lanneluc CLA 2009-02-25 04:42:47 EST
(In reply to comment #5)
> There is already a request in JDT/Core (can't find it right now) to handle the
> refresh of external jars in PRE_REFRESH.
The request is bug 255174

Comment 7 Szymon Brandys CLA 2009-02-25 07:36:48 EST
(In reply to comment #6)
Regarding comment 4 and comment 6, is this request still valid?

Comment 8 Dani Megert CLA 2009-02-25 08:14:28 EST
Given that bug 255325 is fixed and if JDT Core can solve the problem with PRE_REFRESH then this can be closed.
Comment 9 Szymon Brandys CLA 2009-02-26 04:28:36 EST
I has a quick chat with Jerome. We all agree that the bug can be closed.