Modify a file in response to IResourceChangeListener


Hi there,

In the context of an IResourceChangeListener I need to modify a given preference file in the workspace.  Because of “Note that during resource change event notification, further changes to resources may be disallowed.” the only solution to perform this change is to delay it on a future event (5 seconds later, on the next access to the file to be modified, on the next selection event, etc ..)

I would be interested to know how do you handle such situation ?

Advertisements

3 thoughts on “Modify a file in response to IResourceChangeListener

  1. Yup, see org.eclipse.core.resources.WorkspaceJob. You schedule it immediately, but it’ll run only once it can acquire the lock (scheduling rule) — i.e., not during your change notification.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s