|
|
Re: EMF Notification: how to not get our own modifications? [message #966232 is a reply to message #965947] |
Wed, 31 October 2012 21:29 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Victor,
There's no way to know what/who caused the change. Of course if you did
the modification, you already know you'll get a notification for that...
On 31/10/2012 5:31 PM, Victor Mising name wrote:
> Hi,
>
> I have two pieces of code modifying the same EMF model.
>
> When one modifies it, notifications are sent, to everyone, including
> the one that modifies it.
>
> Is there any way to detect who did the modification that made the
> notification happen?
>
> My only need is to be able, when I modify a model, to detect in my
> listener that I was the one actually modifying the model.
>
> Thank you for any help :)
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: EMF Notification: how to not get our own modifications? [message #966875 is a reply to message #966232] |
Thu, 01 November 2012 09:53 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
An approach that I've used to break similar selectionChanged loops is to
have a private e.g. selectionChanging normally falsevariable. In the
handler, if the variable is false is it is set true to indicate
processing a selection change and restored in a finally clause. If
already set you know that you're in a nested loop and should probably
just return promptly.
Regards
Ed Willink
On 31/10/2012 21:29, Ed Merks wrote:
> Victor,
>
> There's no way to know what/who caused the change. Of course if you
> did the modification, you already know you'll get a notification for
> that...
>
> On 31/10/2012 5:31 PM, Victor Mising name wrote:
>> Hi,
>>
>> I have two pieces of code modifying the same EMF model.
>>
>> When one modifies it, notifications are sent, to everyone, including
>> the one that modifies it.
>>
>> Is there any way to detect who did the modification that made the
>> notification happen?
>>
>> My only need is to be able, when I modify a model, to detect in my
>> listener that I was the one actually modifying the model.
>>
>> Thank you for any help :)
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03665 seconds