use of org.eclipse.emf.common.notify.Notifier in project xtext-core by eclipse.
the class ChangeSerializer method applyModifications.
@Override
public void applyModifications(IAcceptor<IEmfResourceChange> changeAcceptor) {
monitor.setTaskName("Preparing Text Changes...");
Set<Resource> resources = Sets.newLinkedHashSet();
for (Pair<Notifier, IModification<? extends Notifier>> p : modifications) {
Notifier context = p.getFirst();
if (context instanceof EObject)
resources.add(((EObject) context).eResource());
else if (context instanceof Resource)
resources.add((Resource) context);
else if (context instanceof ResourceSet) {
throw new IllegalStateException("Not supported");
}
}
for (Resource res : resources) {
// TODO: use the exact context
beginRecordChanges(res);
}
checkCanceled();
for (Pair<Notifier, IModification<? extends Notifier>> entry : modifications) {
apply(entry.getFirst(), entry.getSecond());
}
checkCanceled();
endRecordChanges(changeAcceptor);
}
Aggregations