Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Question about notification events
Question about notification events [message #232704] Thu, 05 April 2007 12:25 Go to next message
Eclipse UserFriend
Originally posted by: ayalandzhiev.sbnd.net

Hello I have a following problem for example there is an EditPart and
childs EditParts. My purpose is to catch when attribute of model for
child EditPart is changed one way is to add the method:
protected void handleNotificationEvent(Notification event) {
}

for every child EditPart but this solution is not good for me. I search
for way to catch this notification on ParentEditPart, that means is some
attribute of ChildEditPart model is changed to be able to manage it on
the ParentEditPart level.

Thanks in advance!

Regards,
Atanas.
Re: Question about notification events [message #232742 is a reply to message #232704] Fri, 06 April 2007 13:53 Go to previous message
Eclipse UserFriend
Originally posted by: ayalandzhiev.sbnd.net

I found the way if someone needs here is the code I have putted in the
parent EditPart code :

diagram = DiagramEventBroker.getInstance(getEditingDomain());


List list = getChildren();
Iterator iter = list.iterator();
GraphicalEditPart child = null;
while (iter.hasNext()) {
child = (GraphicalEditPart) iter.next();
MyListener lsitener = new MyListener();
EObject emfObject = (EObjectImpl) ((Node) child.getModel())
.getElement();
EStructuralFeature feature = emfObject.eClass()
.getEStructuralFeature("value");
diagram.addNotificationListener(emfObject, feature, lsitener);

After that lsitener is called on every change of attribute "value" for
child model of child's EditPart.

Atanas Yalandzhiev wrote:
> Hello I have a following problem for example there is an EditPart and
> childs EditParts. My purpose is to catch when attribute of model for
> child EditPart is changed one way is to add the method:
> protected void handleNotificationEvent(Notification event) {
> }
>
> for every child EditPart but this solution is not good for me. I search
> for way to catch this notification on ParentEditPart, that means is some
> attribute of ChildEditPart model is changed to be able to manage it on
> the ParentEditPart level.
>
> Thanks in advance!
>
> Regards,
> Atanas.
Previous Topic:WARNING: Prevented recursive attempt to activate part...
Next Topic:LayoutManager or locator for Shapes?
Goto Forum:
  


Current Time: Thu Apr 25 21:10:58 GMT 2024

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

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

Back to the top