Skip to main content


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] Sat, 08 December 2012 01:01 Go to next message
Ashwani Kr Sharma is currently offline Ashwani Kr SharmaFriend
Messages: 119
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: 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 Go to previous message
Ed Merks is currently offline Ed MerksFriend
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/
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: Fri Apr 19 07:29:24 GMT 2024

Powered by FUDForum. Page generated in 0.01910 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top