How to get fine grained notifications after a resource save? [message #333175] |
Thu, 27 November 2008 13:08  |
Eclipse User |
|
|
|
Hi,
I'm looking for a way to be notified when an IFile has been saved and to be
told about the specific regions of the file that changed. For example, if I
added a space on line 5 and line 10 and than saved, is there a way for me to
be notified after the save and to be given the deltas that say what exactly
was changed? My file is a CDT or JDT file if that makes a difference.
I have looked at using:
ResourceSetListener - This doesn't provide any specific context about
what area's of the resource have changed
DocumentListener - This is notified after every key change, not
after a save
IElementChangeListener - This doesn't provide any fine grained delta
information either (at least the CDT one doesn't)
IMarkerUpdater - changing one space at the beginning of the
file seems to change all the markers positions so this doesn't help identify
explictly which markers' regions were changed.
Please let me know if anyone knows of another way to accomplish this.
Thanks in advance,
Adam
|
|
|
Re: How to get fine grained notifications after a resource save? [message #333179 is a reply to message #333175] |
Thu, 27 November 2008 18:30  |
Eclipse User |
|
|
|
Adam,
Comments below.
Adam wrote:
> Hi,
>
> I'm looking for a way to be notified when an IFile has been saved and to be
> told about the specific regions of the file that changed.
You can know it's saved via IResourceDelta on the workspace, and if
history is being tracked you could find out the old contents to compare
the two.
> For example, if I
> added a space on line 5 and line 10 and than saved, is there a way for me to
> be notified after the save and to be given the deltas that say what exactly
> was changed?
I don't think so. If you can listen to the document itself, you could
record the changes so that when a save happens you'll remember what's
changed.
> My file is a CDT or JDT file if that makes a difference.
>
> I have looked at using:
> ResourceSetListener - This doesn't provide any specific context about
> what area's of the resource have changed
> DocumentListener - This is notified after every key change, not
> after a save
> IElementChangeListener - This doesn't provide any fine grained delta
> information either (at least the CDT one doesn't)
> IMarkerUpdater - changing one space at the beginning of the
> file seems to change all the markers positions so this doesn't help identify
> explictly which markers' regions were changed.
>
> Please let me know if anyone knows of another way to accomplish this.
> Thanks in advance,
> Adam
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02522 seconds