|
Re: TriggerListener for changing values of Element properties from Stereotype [message #473329 is a reply to message #473318] |
Wed, 27 June 2007 14:17 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Francis,
This isn't really an EMF question, because you're dealing with the
relationship of stereotype applications to elements, which is a UML thing
:-)
Anyway, the owner of the fooStereotypeProperty that changed and which is the
subject of the Notification is the FooStereotype application (instance).
Get this by casting the result of Notification::getNotifier() as an
EObject.
If you want the element (Foo or FooAction) to which this FooStereotype
instance is applied, use the UMLUtil::getBaseElement(EObject) utility
method.
HTH,
Christian
Francis wrote:
> Hi,
>
> I need to create a transaction listener (E.g.
> org.eclipse.emf.transaction.TriggerListener) that listens to changes in
> the values of Element properties from an applied Stereotype.
>
> For example:
> A Behavior (named Foo) and a corresponding CallBehaviorAction (named
> FooAction) has an applied Stereotype (named FooStereotype) which has a
> Property (named fooStereotypeProperty). When the value of
> fooStereotypeProperty of Foo changes, I want to do something and change
> also the value of fooStereotypeProperty of FooAction (and vice-versa).
>
> I tried to inspect the Notification but I can't find a way to have access
> to the owner of the property (in this case, it's Foo). This is also an EMF
> question but I'm not sure where to post it so pardon me if this should be
> in the EMF thread.
>
> Thanks,
> Francis
|
|
|
|
Re: TriggerListener for changing values of Element properties from Stereotype [message #622589 is a reply to message #473318] |
Wed, 27 June 2007 14:17 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Francis,
This isn't really an EMF question, because you're dealing with the
relationship of stereotype applications to elements, which is a UML thing
:-)
Anyway, the owner of the fooStereotypeProperty that changed and which is the
subject of the Notification is the FooStereotype application (instance).
Get this by casting the result of Notification::getNotifier() as an
EObject.
If you want the element (Foo or FooAction) to which this FooStereotype
instance is applied, use the UMLUtil::getBaseElement(EObject) utility
method.
HTH,
Christian
Francis wrote:
> Hi,
>
> I need to create a transaction listener (E.g.
> org.eclipse.emf.transaction.TriggerListener) that listens to changes in
> the values of Element properties from an applied Stereotype.
>
> For example:
> A Behavior (named Foo) and a corresponding CallBehaviorAction (named
> FooAction) has an applied Stereotype (named FooStereotype) which has a
> Property (named fooStereotypeProperty). When the value of
> fooStereotypeProperty of Foo changes, I want to do something and change
> also the value of fooStereotypeProperty of FooAction (and vice-versa).
>
> I tried to inspect the Notification but I can't find a way to have access
> to the owner of the property (in this case, it's Foo). This is also an EMF
> question but I'm not sure where to post it so pardon me if this should be
> in the EMF thread.
>
> Thanks,
> Francis
|
|
|
|
Powered by
FUDForum. Page generated in 0.03888 seconds