MultipageEditor and Databinding [message #418983] |
Tue, 06 May 2008 16:33  |
Eclipse User |
|
|
|
Hi,
I have customized the generated emf editor and added some form based
master-details pages. To synchronize, I use EMF databinding (and I am
quite happy with it).
Now I have the following problem:
In some pages I have tree viewers which have input of the form
" editingDomain.getResourceSet().getResources().get(0).getCont ents().get(0) ".
Then I do some changes and make the editor dirty. When I click on
"save", somehow(?) the content reference of the resource changes and my
viewer input gets kind of stale. I didn't find a good solution yet, I
tried to add a commandstack listener but it didn't get notified about
the "save" operation.
Does anybody have an idea?
Thanks,
Michael
|
|
|
|
Re: MultipageEditor and Databinding [message #418985 is a reply to message #418984] |
Wed, 07 May 2008 06:36   |
Eclipse User |
|
|
|
Ed,
I made some progress in my investigations thanks to your hints. I
awkwardly forgot to mention that I also included two GMF diagrams in my
multipage editor. Those have a generated DiagramDocumentProvider with an
inner WorkspaceSynchronizer class which called a resource.unload().
I have to figure out how I need to customize the DiagramDocumentProvider.
Thanks again for responding!
Ed Merks wrote:
> Michael,
>
> I don't expect saving to change the contents of the resource (although
> in the XML with a DocumentRoot case, the prefixes in the
> getXMLNSPrefixMap are updated to reflect the prefixes used in the
> serialization. But you can listen to the resource itself. It is a
> Notifier just like an EObject is a Notifier, so you can listen for when
> the contents change...
>
>
> Michael Haeberlen wrote:
>> Hi,
>>
>> I have customized the generated emf editor and added some form based
>> master-details pages. To synchronize, I use EMF databinding (and I am
>> quite happy with it).
>> Now I have the following problem:
>> In some pages I have tree viewers which have input of the form
>> " editingDomain.getResourceSet().getResources().get(0).getCont ents().get(0) ".
>> Then I do some changes and make the editor dirty. When I click on
>> "save", somehow(?) the content reference of the resource changes and
>> my viewer input gets kind of stale. I didn't find a good solution yet,
>> I tried to add a commandstack listener but it didn't get notified
>> about the "save" operation.
>> Does anybody have an idea?
>>
>> Thanks,
>> Michael
|
|
|
Re: MultipageEditor and Databinding [message #418986 is a reply to message #418985] |
Wed, 07 May 2008 06:45   |
Eclipse User |
|
|
|
Michael,
It sounds like the code might be taking an inappropriate action as a
result of a resource delta. In the generated EMF editor you'll see that
as the resource deltas are processed, it's important to know which
deltas are expected as a result of resources the editor itself has just
saved, i.e, savedResources is populated to influence a subsequent delta
processing is handled...
Michael Haeberlen wrote:
> Ed,
>
> I made some progress in my investigations thanks to your hints. I
> awkwardly forgot to mention that I also included two GMF diagrams in
> my multipage editor. Those have a generated DiagramDocumentProvider
> with an inner WorkspaceSynchronizer class which called a
> resource.unload().
>
> I have to figure out how I need to customize the DiagramDocumentProvider.
>
> Thanks again for responding!
>
> Ed Merks wrote:
>> Michael,
>>
>> I don't expect saving to change the contents of the resource
>> (although in the XML with a DocumentRoot case, the prefixes in the
>> getXMLNSPrefixMap are updated to reflect the prefixes used in the
>> serialization. But you can listen to the resource itself. It is a
>> Notifier just like an EObject is a Notifier, so you can listen for
>> when the contents change...
>>
>>
>> Michael Haeberlen wrote:
>>> Hi,
>>>
>>> I have customized the generated emf editor and added some form based
>>> master-details pages. To synchronize, I use EMF databinding (and I
>>> am quite happy with it).
>>> Now I have the following problem:
>>> In some pages I have tree viewers which have input of the form
>>> " editingDomain.getResourceSet().getResources().get(0).getCont ents().get(0) ".
>>> Then I do some changes and make the editor dirty. When I click on
>>> "save", somehow(?) the content reference of the resource changes and
>>> my viewer input gets kind of stale. I didn't find a good solution
>>> yet, I tried to add a commandstack listener but it didn't get
>>> notified about the "save" operation.
>>> Does anybody have an idea?
>>>
>>> Thanks,
>>> Michael
|
|
|
Re: MultipageEditor and Databinding [message #418988 is a reply to message #418986] |
Wed, 07 May 2008 08:41  |
Eclipse User |
|
|
|
Ed,
yes, the problem really is how I integrated the GMF generated diagrams.
I followed the eclipse corner article (about integrating EMF and GMF
editors) which has the same kind of problem. The GMF generated part
needs some more modification, obviously.
Ed Merks wrote:
> Michael,
>
> It sounds like the code might be taking an inappropriate action as a
> result of a resource delta. In the generated EMF editor you'll see that
> as the resource deltas are processed, it's important to know which
> deltas are expected as a result of resources the editor itself has just
> saved, i.e, savedResources is populated to influence a subsequent delta
> processing is handled...
>
>
> Michael Haeberlen wrote:
>> Ed,
>>
>> I made some progress in my investigations thanks to your hints. I
>> awkwardly forgot to mention that I also included two GMF diagrams in
>> my multipage editor. Those have a generated DiagramDocumentProvider
>> with an inner WorkspaceSynchronizer class which called a
>> resource.unload().
>>
>> I have to figure out how I need to customize the DiagramDocumentProvider.
>>
>> Thanks again for responding!
>>
>> Ed Merks wrote:
>>> Michael,
>>>
>>> I don't expect saving to change the contents of the resource
>>> (although in the XML with a DocumentRoot case, the prefixes in the
>>> getXMLNSPrefixMap are updated to reflect the prefixes used in the
>>> serialization. But you can listen to the resource itself. It is a
>>> Notifier just like an EObject is a Notifier, so you can listen for
>>> when the contents change...
>>>
>>>
>>> Michael Haeberlen wrote:
>>>> Hi,
>>>>
>>>> I have customized the generated emf editor and added some form based
>>>> master-details pages. To synchronize, I use EMF databinding (and I
>>>> am quite happy with it).
>>>> Now I have the following problem:
>>>> In some pages I have tree viewers which have input of the form
>>>> " editingDomain.getResourceSet().getResources().get(0).getCont ents().get(0) ".
>>>> Then I do some changes and make the editor dirty. When I click on
>>>> "save", somehow(?) the content reference of the resource changes and
>>>> my viewer input gets kind of stale. I didn't find a good solution
>>>> yet, I tried to add a commandstack listener but it didn't get
>>>> notified about the "save" operation.
>>>> Does anybody have an idea?
>>>>
>>>> Thanks,
>>>> Michael
|
|
|
Powered by
FUDForum. Page generated in 0.19735 seconds