Skip to main content



      Home
Home » Modeling » EMF » Notifications on creation of EObjects
Notifications on creation of EObjects [message #653521] Thu, 10 February 2011 00:49 Go to next message
Eclipse UserFriend
Hi,

Is there a way to get notifications on creation of EObjects just like the way we can get for modifying its feature like add, remove, move and so on..

Thanks and regards,
Priya
Re: Notifications on creation of EObjects [message #653528 is a reply to message #653521] Thu, 10 February 2011 01:24 Go to previous messageGo to next message
Eclipse UserFriend
Am 10.02.2011 06:50, schrieb Priya:
> Hi,
>
> Is there a way to get notifications on creation of EObjects just like the way we can get for modifying its feature like add, remove, move and so on..
Notifications are only sent for actual modification of existing objects, not for object creation. How would you attach an adapter to an object before you can get hold of it?

You are notified, though, when you attach your new object to the contents of an existing object.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: Notifications on creation of EObjects [message #653678 is a reply to message #653528] Thu, 10 February 2011 11:52 Go to previous messageGo to next message
Eclipse UserFriend
Was just wondering then what exactly is the type Notification.CREATE meant for?

Thanks,
Priya
Re: Notifications on creation of EObjects [message #653680 is a reply to message #653678] Thu, 10 February 2011 12:04 Go to previous messageGo to next message
Eclipse UserFriend
Basically I am creating an EObject this way (copying/duplicating)

EObject create(EObject eObject) {
return eObject.eClass().getEpackage().getEFactoryInstance().create( eObject.eClass());
}

when this happens I want to set some relation between the original EObject and the newly created EObject. I want to handle this in a notification handler way. Please let me know if there is a way to do this?

Thanks,
Priya
Re: Notifications on creation of EObjects [message #653709 is a reply to message #653678] Thu, 10 February 2011 13:37 Go to previous message
Eclipse UserFriend
Am 10.02.2011 17:52, schrieb Priya:
> Was just wondering then what exactly is the type Notification.CREATE meant for?

I see it's obsolete:

@Deprecated
int CREATE = 0;

I guess has never been used, just like EStore.create(EClass)...

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Previous Topic:[CDO] Exception using Resource Import
Next Topic:Custom serialization of Map$Entry
Goto Forum:
  


Current Time: Sat Jul 12 01:11:36 EDT 2025

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

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

Back to the top