Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » resource change listeners
resource change listeners [message #419671] Sun, 01 June 2008 16:48 Go to next message
Martin Geisse is currently offline Martin GeisseFriend
Messages: 24
Registered: July 2009
Junior Member
Hello,

I am in a situation like this: A consuming entity has created a resource
set and a resource in it, loaded that resource, and has done something
with the objects contained in it. Another entity now alters the backing
storage of the resource through its own ResourceSet and Resource objects
- for instance, an Eclipse-based editor. The consumer shall be notified
of the modification such that it can re-load its resource and react to
the changes.

When a file is accessed in Eclipse (as an IFile), Eclipse allows to
install resource change listeners that detect such changes. I'd like to
do a similar thing with EMF now. I understand that not all resource
implementations would be able to provide such listeners, e.g. resources
that are loaded through HTTP requests. However, is it possible to do so
for implementations that can provide listeners (e.g. platform:/resource)?

Greetings,
Martin Geisse
Re: resource change listeners [message #419672 is a reply to message #419671] Sun, 01 June 2008 19:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33218
Registered: July 2009
Senior Member
Martin,

Comments below.


Martin Geisse wrote:
> Hello,
>
> I am in a situation like this: A consuming entity has created a
> resource set and a resource in it, loaded that resource, and has done
> something with the objects contained in it. Another entity now alters
> the backing storage of the resource through its own ResourceSet and
> Resource objects - for instance, an Eclipse-based editor. The consumer
> shall be notified of the modification such that it can re-load its
> resource and react to the changes.
Things like CDO would actually allow these two things to share a common
model...
>
> When a file is accessed in Eclipse (as an IFile), Eclipse allows to
> install resource change listeners that detect such changes. I'd like
> to do a similar thing with EMF now. I understand that not all resource
> implementations would be able to provide such listeners, e.g.
> resources that are loaded through HTTP requests. However, is it
> possible to do so for implementations that can provide listeners (e.g.
> platform:/resource)?
EMF doesn't provide any APIs for this. You could provide integration
with Eclipse File System EFS and thereby have your backing store
resources managed just like any other workspace resource and simply rely
on the resource delta processing that generated editors already
provide... From an EMF point of you, you need only unload the resource
and reload it with new contents...
>
> Greetings,
> Martin Geisse


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: resource change listeners [message #419673 is a reply to message #419672] Sun, 01 June 2008 19:20 Go to previous message
Martin Geisse is currently offline Martin GeisseFriend
Messages: 24
Registered: July 2009
Junior Member
Ed Merks wrote:

> Things like CDO would actually allow these two things to share a common
> model...

Sounds interesting either way, so I'll definitely have a look at it.

> EMF doesn't provide any APIs for this. You could provide integration
> with Eclipse File System EFS and thereby have your backing store
> resources managed just like any other workspace resource and simply rely
> on the resource delta processing that generated editors already
> provide...

Okay. I already expected so, but I wanted to be sure I don't miss an
already-existing API for that.

Thanks for you help.

Greetings,
Martin Geisse
Previous Topic:[EMF.Edit] Decorators and ItemProviders
Next Topic:Order of undo in an EMFCommandOperation for a transaction with pre-commit
Goto Forum:
  


Current Time: Thu Sep 26 20:29:54 GMT 2024

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

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

Back to the top