Posts Tagged delta

Today I was desperately trying to figure out how to get eclipse to tell me when a Bookmark had been deleted, so that I could update my plugins internal data representation.

I found lots of api’s which was all well and good but finding a code example was a lot harder. Also the guys on the irc channel were too busy to help, so I kept searching.

It turns out that you need to fiddle with the IResourceChangeListener and IResourceDeltaVisitor to traverse a delta (basically a tree representation of all the changes that have just occurred) and look for your bookmarks.

Below is example code for creating a listener, visitor and how to attach it to the workspace as a change listener.