Home » Modeling » EMF » Notify changes on any models
| | | | | |
Re: Notify changes on any models [message #994839 is a reply to message #994832] |
Fri, 28 December 2012 12:22 |
Stefan Weiser Messages: 57 Registered: February 2012 |
Member |
|
|
Ed Merks wrote on Fri, 28 December 2012 06:47Stefan,
Comments below.
On 28/12/2012 12:31 PM, Stefan Weiser wrote:
> Hello Ed Merks,
> thank you for your hints.
>
> Now I can identify changes made by code but not changes in a running
> instance of Eclipse.
>
> Adding it to the ResourceSet doesn't really solve the problem I've
> got. The ResourceSet seems to be a snapshot from the selected part and
> doesn't recognize further changes afterwards.
I have no idea what you're doing in the code you showed. Yes of course
it's just local objects that will be garbage collected unless you keep
some reference to it...
> Or I don't use it in a correct way.
> So what can I do, if I'd like to notify changes I'm doing on the
> models in an editor in an Eclipse-instance.
In the generated editor, you can add such a content adapter to the
editing domain's resource set, e.g., by specializing the createModel method.
> Snapshots of the models doesn't really help me for my task. I hope my
> problem is understandable.
OK, then I think my approach won't work in manner I'd like to. It seem that there are 2 ways of possible implementations:
- An editor-specific implementation, which identifies changes on models.
- Implementing a ResourceChangeListener on the workspace, which is not EMF specific.
I hoped that it is possible to use the INotifyChangedListener but I didn't find any API usable for my task.
|
|
|
Re: Notify changes on any models [message #994842 is a reply to message #994839] |
Fri, 28 December 2012 12:30 |
Ed Merks Messages: 33217 Registered: July 2009 |
Senior Member |
|
|
Stefan,
Listening to the workspace is the only way to know about changes that
are actually saved. You can't in general know about changes happening
internal to editors, and each editor generally maintains it's own local
instances. Generated EMF editors do implement IEditingDomainProvider
which provides access to the editing domain and hence the resource set.
On 28/12/2012 1:22 PM, Stefan Weiser wrote:
> Ed Merks wrote on Fri, 28 December 2012 06:47
>> Stefan,
>>
>> Comments below.
>>
>> On 28/12/2012 12:31 PM, Stefan Weiser wrote:
>> > Hello Ed Merks,
>> > thank you for your hints.
>> >
>> > Now I can identify changes made by code but not changes in a
>> running > instance of Eclipse.
>> >
>> > Adding it to the ResourceSet doesn't really solve the problem I've
>> > got. The ResourceSet seems to be a snapshot from the selected part
>> and > doesn't recognize further changes afterwards.
>> I have no idea what you're doing in the code you showed. Yes of
>> course it's just local objects that will be garbage collected unless
>> you keep some reference to it...
>> > Or I don't use it in a correct way.
>> > So what can I do, if I'd like to notify changes I'm doing on the >
>> models in an editor in an Eclipse-instance.
>> In the generated editor, you can add such a content adapter to the
>> editing domain's resource set, e.g., by specializing the createModel
>> method.
>> > Snapshots of the models doesn't really help me for my task. I hope
>> my > problem is understandable.
>
> OK, then I think my approach won't work in manner I'd like to. It seem
> that there are 2 ways of possible implementations:
>
> An editor-specific implementation, which identifies changes on models.
> Implementing a ResourceChangeListener on the workspace, which is not
> EMF specific.
>
> I hoped that it is possible to use the INotifyChangedListener but I
> didn't find any API usable for my task.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| | |
Re: Notify changes on any models [message #1354134 is a reply to message #1352519] |
Wed, 14 May 2014 05:59 |
Ed Merks Messages: 33217 Registered: July 2009 |
Senior Member |
|
|
Wenjing,
So none of the hints in this thread have helped?
On 13/05/2014 4:51 PM, Wenjing Yuan wrote:
> Hi Stefan,
>
> I just saw your questions about detecting the changes in Eclipse
> running instance,
> right now I encounter the same problem, I have the editingDomain in
> hand, so how could I detect any changes including editing the
> attributes in this domain by using notification or EAdapter perhaps?
> Any hints would be appreciated.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Tue Sep 24 01:08:30 GMT 2024
Powered by FUDForum. Page generated in 0.05476 seconds
|