use of org.eclipse.emf.transaction.ResourceSetChangeEvent in project InformationSystem by ObeoNetwork.
the class RequirementLinkerPlugin method installDecoratorListenerOnSession.
private void installDecoratorListenerOnSession(Session session) {
TransactionalEditingDomain ted = session.getTransactionalEditingDomain();
if (ted != null) {
NotificationFilter notificationFilter = NotificationFilter.createFeatureFilter(RequirementPackage.Literals.REQUIREMENT__REFERENCED_OBJECT);
ted.addResourceSetListener(new ResourceSetListenerImpl(notificationFilter) {
@Override
public boolean isPostcommitOnly() {
return true;
}
@Override
public void resourceSetChanged(ResourceSetChangeEvent event) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
IDecoratorManager decoratorManager = PlatformUI.getWorkbench().getDecoratorManager();
decoratorManager.update(ObjectWithRequirement.DECORATOR_ID);
}
});
}
});
}
}
use of org.eclipse.emf.transaction.ResourceSetChangeEvent in project InformationSystem by ObeoNetwork.
the class Activator method installDecoratorListenerOnSession.
private void installDecoratorListenerOnSession(final Session session) {
TransactionalEditingDomain ted = session.getTransactionalEditingDomain();
if (ted != null) {
NotificationFilter notificationFilter = NotificationFilter.createFeatureFilter(RequirementPackage.Literals.REQUIREMENT__REFERENCED_OBJECT);
ted.addResourceSetListener(new ResourceSetListenerImpl(notificationFilter) {
@Override
public boolean isPostcommitOnly() {
return true;
}
@Override
public void resourceSetChanged(ResourceSetChangeEvent event) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
refreshDecorationsOnSession(session, false);
}
});
}
});
}
}
Aggregations