|
|
|
|
|
|
| Re: Notify changes on any models [message #994839 is a reply to message #994832] |
Fri, 28 December 2012 07:22   |
Stefan Weiser Messages: 15 Registered: February 2012 |
Junior 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 07:30   |
Ed Merks Messages: 24529 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.
|
|
|
| Re: Notify changes on any models [message #994916 is a reply to message #994842] |
Fri, 28 December 2012 11:23  |
Stefan Weiser Messages: 15 Registered: February 2012 |
Junior Member |
|
|
Ed Merks wrote on Fri, 28 December 2012 07:30Stefan,
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.
Hello Ed Merks,
this is very helpful, so I need not to try something any more, which is not possible. I will try to focus on the EMF editors to achieve a solution.
Thx for your patience and your help.
|
|
|
Powered by
FUDForum. Page generated in 0.05805 seconds