Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EContentAdapter vs Listening to commands
EContentAdapter vs Listening to commands [message #989818] Fri, 07 December 2012 20:01 Go to next message
Ashwani Kr Sharma is currently offline Ashwani Kr Sharma
Messages: 117
Registered: July 2009
Location: Bangalore, India
Senior Member

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: Fri, 07 December 2012 20:02]

Report message to a moderator

Re: EContentAdapter vs Listening to commands [message #989835 is a reply to message #989818] Sat, 08 December 2012 01:08 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25739
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
Previous Topic:Why does ECollections.singletonEList return a List<T> instead of EList<T>?
Next Topic:opposite reference from Map$Entry to its container
Goto Forum:
  


Current Time: Wed Apr 16 00:37:35 EDT 2014

Powered by FUDForum. Page generated in 0.01511 seconds