eNotification [message #198133] |
Mon, 21 July 2008 17:16 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Hi,
I am accessing the underlying model objects because I need to create
objects which exist within the model but do not have a graphical
counterpart. When I add these elements to the base object, I get an
exception(but the first add will still be executed), I have traced it and
it to do with the notification line which exists in every models setters.
i.e.
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,......)
How do I avoid this exception, some way of manually notifying the
application of the change??
Any help would be great!
Wayne
[Updated on: Wed, 22 February 2012 18:17] by Moderator Report message to a moderator
|
|
|
Re: eNotification [message #198150 is a reply to message #198133] |
Mon, 21 July 2008 17:34 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Hi, Wayne,
I guess from your description that you are getting an
IllegalStateException with a message indicating that you need a
read/write transaction to modify the model. Is that right?
Any changes that you make to the model (semantics or notation) must be
performed in the context of a transaction, because GMF is implemented on
a transactional editing domain. Usually, you will use the
AbstractEMFOperation to encapsulate model changes and execute them on
Eclipse's IOperationHistory.
See the documentation in the EMF Transaction Developer Guide for
details:
http://help.eclipse.org/ganymede/topic/org.eclipse.emf.works pace.doc/references/overview/operations.html
HTH,
Christian
On Mon, 2008-07-21 at 17:16 +0000, Wayne wrote:
> Hi,
> I am accessing the underlying model objects because I need to create
> objects which exist within the model but do not have a graphical
> counterpart. When I add these elements to the base object, I get an
> exception(but the first add will still be executed), I have traced it and
> it to do with the notification line which exists in every models setters.
> i.e.
>
> if (eNotificationRequired())
> eNotify(new ENotificationImpl(this, Notification.SET,......)
>
> How do I avoid this exception, some way of manually notifying the
> application of the change??
>
> Any help would be great!
> Wayne
>
[Updated on: Wed, 22 February 2012 18:18] by Moderator Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03624 seconds