01: package newprocess.adapter;
02:
03: import newprocess.Expression;
04: import newprocess.NewprocessPackage;
05: import newprocess.Root;
06:
07: import org.eclipse.emf.common.notify.Notification;
08: import org.eclipse.emf.common.notify.impl.SingletonAdapterImpl;
09:
10: /**
11: * @author ts
12: *
13: * Listen for changes of the rootport to update the expression
14: */
15: public class RootTermAdapter extends SingletonAdapterImpl {
16:
17: // Singleton
18: public static RootTermAdapter INSTANCE = new RootTermAdapter();
19:
20: /**
21: *
22: * @see org.eclipse.emf.common.notify.impl.SingletonAdapterImpl#notifyChanged(org.eclipse.emf.common.notify.Notification)
23: *
24: * @author ts
25: */
26: @Override
27: public void notifyChanged(Notification msg) {
28: super .notifyChanged(msg);
29: if (msg.getEventType() == Notification.SET
30: && msg.getFeatureID(NewprocessPackage.class) == NewprocessPackage.ROOT__TERM) {
31: Root rp = (Root) msg.getNotifier();
32: Expression expr = (Expression) rp.eContainer();
33: if (expr != null)
34: expr.updateExpression();
35: }
36: }
37: }
|