Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » eNotification
eNotification [message #198133] Mon, 21 July 2008 17:16 Go to next message
Eclipse UserFriend
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
Eclipse UserFriend
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

Previous Topic:1 node with 2 possible icons
Next Topic:Deleting connections
Goto Forum:
  


Current Time: Mon May 25 05:48:34 GMT 2020

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

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

Back to the top