return false;
}
@Override
public void resourceSetChanged(ResourceSetChangeEvent event) {
final IDiagramTypeProvider provider = diagramEditor.getDiagramTypeProvider();
final Diagram diagram = provider.getDiagram();
if (diagram != null && diagram.getPictogramLinks().isEmpty()) {
return;
}
final Set<EObject> changedBOs = new HashSet<EObject>();
final List<Notification> notifications = event.getNotifications();
for (final Notification notification : notifications) {
final Object notifier = notification.getNotifier();
if (notifier instanceof EObject) {
final EObject eNotifier = (EObject) notifier;
changedBOs.add(eNotifier);
}
}
final INotificationService notificationService = provider.getNotificationService();
final PictogramElement[] dirtyPEs
= notificationService.calculateRelatedPictogramElements(changedBOs.toArray());
if (dirtyPEs.length > 0) {
// do an asynchronous update in the UI thread
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
IDiagramEditor diagramEditor = provider.getDiagramEditor();
if (provider.isAutoUpdateAtRuntime() && diagramEditor.isDirty()) {
notificationService.updatePictogramElements(dirtyPEs);
} else {
diagramEditor.refresh();
}
}