Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Multiple IResourceChangeEvents sent on refresh
Multiple IResourceChangeEvents sent on refresh [message #494039] Wed, 28 October 2009 21:30 Go to next message
Jacob Weber is currently offline Jacob WeberFriend
Messages: 39
Registered: July 2009
Member
I'm attaching an IResourceChangeListener to the workspace, and listening for IResourceChangeEvent.POST_CHANGE events.

When I refresh a project after adding some files and directories to it outside of Eclipse, Eclipse calls my resourceChanged method several times.

The first delta includes most of the new files. Then there are a few additional calls, each of which include a few additional files.

Is this normal behavior? Shouldn't the resourceChanged method just be called once after a refresh?
Re: Multiple IResourceChangeEvents sent on refresh [message #494093 is a reply to message #494039] Thu, 29 October 2009 08:16 Go to previous messageGo to next message
Alessandro Carraro is currently offline Alessandro CarraroFriend
Messages: 27
Registered: July 2009
Junior Member
Jacob Weber ha scritto:
> I'm attaching an IResourceChangeListener to the workspace, and listening
> for IResourceChangeEvent.POST_CHANGE events.
>
> When I refresh a project after adding some files and directories to it
> outside of Eclipse, Eclipse calls my resourceChanged method several times.
>
> The first delta includes most of the new files. Then there are a few
> additional calls, each of which include a few additional files.
>
> Is this normal behavior? Shouldn't the resourceChanged method just be
> called once after a refresh?
>

I'm not an expert, but here is my opinion:
may be the second delta is about derived resources that are updated
since derived from resources in the first delta?

For example, a resource change in a java source file trigger the "java
compiler builder" that produces/updates the relative java class file
that is inserted in the second delta. In this way there could be lots of
deltas, if there are lots of correlated builders..
Re: Multiple IResourceChangeEvents sent on refresh [message #494200 is a reply to message #494093] Thu, 29 October 2009 14:50 Go to previous message
Jacob Weber is currently offline Jacob WeberFriend
Messages: 39
Registered: July 2009
Member
That would make sense. But the strange thing is, the later deltas include files that should have been part of the first delta. In other words, if I added 20 files and then refreshed, the first delta would only include 15 of them, and the later deltas would include the rest.
Previous Topic:Remove popup info or disable action on popupMenu extension point
Next Topic:Specifying groups / order in newWizardShortcut items
Goto Forum:
  


Current Time: Fri Mar 29 06:25:31 GMT 2024

Powered by FUDForum. Page generated in 0.03204 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top