eNotification [message #198133] |
Mon, 21 July 2008 13:16  |
Eclipse User |
|
|
|
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 13:17] by Moderator
|
|
|
Re: eNotification [message #198150 is a reply to message #198133] |
Mon, 21 July 2008 13:34  |
Eclipse User |
|
|
|
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 13:18] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04524 seconds