Home » Modeling » EMF » MultipageEditor and Databinding
| |
Re: MultipageEditor and Databinding [message #418985 is a reply to message #418984] |
Wed, 07 May 2008 10:36 |
Michael Haeberlen Messages: 52 Registered: July 2009 |
Member |
|
|
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 10:45 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
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
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: MultipageEditor and Databinding [message #418988 is a reply to message #418986] |
Wed, 07 May 2008 12:41 |
Michael Haeberlen Messages: 52 Registered: July 2009 |
Member |
|
|
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
|
|
|
Goto Forum:
Current Time: Sat Apr 20 04:07:22 GMT 2024
Powered by FUDForum. Page generated in 0.05714 seconds
|