Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Notifications on creation of EObjects
Notifications on creation of EObjects [message #653521] Thu, 10 February 2011 05:49 Go to next message
Priya Missing name is currently offline Priya Missing nameFriend
Messages: 14
Registered: July 2009
Junior Member
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 06:24 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6446
Registered: July 2009
Senior Member
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 16:52 Go to previous messageGo to next message
Priya Missing name is currently offline Priya Missing nameFriend
Messages: 14
Registered: July 2009
Junior Member
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 17:04 Go to previous messageGo to next message
Priya Missing name is currently offline Priya Missing nameFriend
Messages: 14
Registered: July 2009
Junior Member
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 18:37 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6446
Registered: July 2009
Senior Member
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 Oct 19 05:50:21 GMT 2019

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

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

Back to the top