package newprocess.adapter;
import newprocess.Expression;
import newprocess.NewprocessPackage;
import newprocess.Root;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.SingletonAdapterImpl;
/**
* @author ts
*
* Listen for changes of the rootport to update the expression
*/
public class RootTermAdapter extends SingletonAdapterImpl {
// Singleton
public static RootTermAdapter INSTANCE = new RootTermAdapter();
/**
*
* @see org.eclipse.emf.common.notify.impl.SingletonAdapterImpl#notifyChanged(org.eclipse.emf.common.notify.Notification)
*
* @author ts
*/
@Override
public void notifyChanged(Notification msg) {
super.notifyChanged(msg);
if (msg.getEventType() == Notification.SET
&& msg.getFeatureID(NewprocessPackage.class) == NewprocessPackage.ROOT__TERM) {
Root rp =(Root)msg.getNotifier();
Expression expr = (Expression)rp.eContainer();
if(expr != null)expr.updateExpression();
}
}
}
|