Hi,
I have the following scenario:
+-----------+ +----------+
| Parent |1 *| Children |
| |-----------------| |
+-----------+ +----------+
A Parent is associated with several children (Note: NO containment reference)
What I want to do is the following:
When one of the parent's attributes changes, the children shall be notified.
I implemented handleNotificationEvent in parentEditPart:
@Override
protected void handleNotificationEvent(Notification notification) {
super.handleNotificationEvent(notification);
//something has changed, notify my associated Children
Parent parent = (Parent) this.resolveSemanticElement();
for (Children c : parent.getChildren()) {
c.eNotify(notification);
}
}
And I am awaiting the Notification in ChildrenEditPart:
@Override
protected void handleNotificationEvent(Notification notification) {
super.handleNotificationEvent(notification);
system.out.println("something has changed, update myself!!");
}
However it does not work, I get:
java.lang.StackOverflowError
at org.eclipse.emf.transaction.impl.TransactionImpl.commit(TransactionImpl.java:474)
at org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory$DiagramEditingDomain.postcommit(DiagramEditingDomainFactory.java:220)
at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.deactivate(TransactionalEditingDomainImpl.java:543)
at org.eclipse.emf.transaction.impl.TransactionImpl.close(TransactionImpl.java:712)
at org.eclipse.emf.transaction.impl.TransactionImpl.commit(TransactionImpl.java:474)
at org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory$DiagramEditingDomain.postcommit(DiagramEditingDomainFactory.java:220)
at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.deactivate(TransactionalEditingDomainImpl.java:543)
at org.eclipse.emf.transaction.impl.TransactionImpl.close(TransactionImpl.java:712)
at org.eclipse.emf.transaction.impl.TransactionImpl.commit(TransactionImpl.java:474)
at org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory$DiagramEditingDomain.postcommit(DiagramEditingDomainFactory.java:220)
at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.deactivate(TransactionalEditingDomainImpl.java:543)
at org.eclipse.emf.transaction.impl.TransactionImpl.close(TransactionImpl.java:712)
at org.eclipse.emf.transaction.impl.TransactionImpl.commit(TransactionImpl.java:474)
...