EContentAdapter vs Listening to commands [message #989818] |
Sat, 08 December 2012 01:01 |
|
Hi,
We have a Editor (not using emf.edit) which is based on EMF model.
We want that on change of a EObject or its content, Editor should adapt based on notifications. We used EContentAdapter and it worked fine.
We just came across a situation we have do some set of operations on a EObjects content. During this operation (many content of EObjects are changed and implemented by RecordingCommand) we get into a situation where Editor might become inconsistent. Hence we want to notify only on completion of the command.
One solution we have to stop listing via EContentAdapter but rather listen to EditingDomain() and only reach when some objects are changed. Via editing domain i think the notification only come when some command is fully executed and not between.
Do you think this approach will be good or is there a better solution ?
Thanks and Regards,
Ashwani Kr Sharma
[Updated on: Sat, 08 December 2012 01:02] Report message to a moderator
|
|
|
Re: EContentAdapter vs Listening to commands [message #989835 is a reply to message #989818] |
Sat, 08 December 2012 06:08 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Ashwani,
Comments below.
On 08/12/2012 2:01 AM, Ashwani Kr Sharma wrote:
> Hi,
>
> We have a Editor (not using emf.edit) which is based on EMF model.
> We want that on change of a EObject or its content, Editor should
> adapt based on notifications. We used EContentAdapter and it worked fine.
>
> We just came across a situation we have do some set of operations on a
> EObjects content. During this operation (many content of EObjects are
> changed and implemented by RecordingCommand) we get into a situation
> where Editor might become inconsistent. Hence we want to notify only
> on completion of the command.
>
> One solution we have to stop listing via EContentAdapter but rather
> listend to EditingDomain() and only reach when some objects are
> changed. Via editing domain i think the notification only come when
> some command is fully executed and not between.
>
> Do you think this approach will be good or is there a better solution ?
Yes, listening to the command stack is a good way to know when a set of
related changes have all been completed.
>
> Thanks and Regards,
> Ashwani Kr Sharma
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03062 seconds