Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » No notification from classifier when package changes
No notification from classifier when package changes [message #478578] Thu, 02 July 2009 05:18 Go to next message
Patrick Oppermann is currently offline Patrick Oppermann
Messages: 10
Registered: July 2009
Junior Member
Hi,

I just tried to attach an adapter to a Class instance to be notified as
soon as it is moved into another package.

In the code below, however, there is no notification, the sysout
statement is not reached:

Class clazz = UMLFactory.eINSTANCE.createClass();
Package package_ = UMLFactory.eINSTANCE.createPackage();
Package package_2 = UMLFactory.eINSTANCE.createPackage();

clazz.setPackage(package_);
clazz.eAdapters().add(new AdapterImpl(){
@Override
public void notifyChanged(Notification msg){
System.out.println("notified");
}
});
clazz.setPackage(package_2);

Is there a way to be notified by a Class when its package changes?

Thanks in advance,
Patrick
Re: No notification from classifier when package changes [message #478586 is a reply to message #478578] Fri, 03 July 2009 20:03 Go to previous message
Kenn Hussey is currently offline Kenn Hussey
Messages: 1618
Registered: July 2009
Senior Member
Patrick,

This appears to be a bug. Please open a Bugzilla request and we'll look
into it.

Kenn

Patrick Oppermann wrote:
> Hi,
>
> I just tried to attach an adapter to a Class instance to be notified as
> soon as it is moved into another package.
>
> In the code below, however, there is no notification, the sysout
> statement is not reached:
>
> Class clazz = UMLFactory.eINSTANCE.createClass();
> Package package_ = UMLFactory.eINSTANCE.createPackage();
> Package package_2 = UMLFactory.eINSTANCE.createPackage();
>
> clazz.setPackage(package_);
> clazz.eAdapters().add(new AdapterImpl(){
> @Override
> public void notifyChanged(Notification msg){
> System.out.println("notified");
> }
> });
> clazz.setPackage(package_2);
>
> Is there a way to be notified by a Class when its package changes?
>
> Thanks in advance,
> Patrick
Re: No notification from classifier when package changes [message #627767 is a reply to message #478578] Fri, 03 July 2009 20:03 Go to previous message
Kenn Hussey is currently offline Kenn Hussey
Messages: 1618
Registered: July 2009
Senior Member
Patrick,

This appears to be a bug. Please open a Bugzilla request and we'll look
into it.

Kenn

Patrick Oppermann wrote:
> Hi,
>
> I just tried to attach an adapter to a Class instance to be notified as
> soon as it is moved into another package.
>
> In the code below, however, there is no notification, the sysout
> statement is not reached:
>
> Class clazz = UMLFactory.eINSTANCE.createClass();
> Package package_ = UMLFactory.eINSTANCE.createPackage();
> Package package_2 = UMLFactory.eINSTANCE.createPackage();
>
> clazz.setPackage(package_);
> clazz.eAdapters().add(new AdapterImpl(){
> @Override
> public void notifyChanged(Notification msg){
> System.out.println("notified");
> }
> });
> clazz.setPackage(package_2);
>
> Is there a way to be notified by a Class when its package changes?
>
> Thanks in advance,
> Patrick
Previous Topic:setting MultiplicityElement upper-value to infinite
Next Topic:Re: The definitive truth about multiple inheritance
Goto Forum:
  


Current Time: Thu Apr 24 01:40:46 EDT 2014

Powered by FUDForum. Page generated in 0.06487 seconds