use of org.eclipse.xtext.ide.serializer.impl.EObjectDescriptionDeltaProvider.Deltas in project xtext-core by eclipse.
the class ReferenceUpdater method needsUpdating.
protected boolean needsUpdating(IReferenceUpdaterContext context, IUpdatableReference ref) {
QualifiedName fqn = getQualifiedName(ref);
if (fqn == null) {
return false;
}
EObject target = ref.getTargetEObject();
Deltas deltas = context.getEObjectDescriptionDeltas();
Delta delta = deltas.getDelta(target);
if (delta != null && !containsReferenceText(delta, fqn)) {
return true;
}
Delta targetDelta = findContainingDelta(deltas, target);
if (targetDelta != null && targetDelta.getObject() == target) {
return true;
}
Delta sourceDelta = findContainingDelta(deltas, ref.getSourceEObject());
return !Objects.equal(sourceDelta, targetDelta);
}
use of org.eclipse.xtext.ide.serializer.impl.EObjectDescriptionDeltaProvider.Deltas in project xtext-core by eclipse.
the class ChangeSerializer method endRecordChanges.
protected void endRecordChanges(IAcceptor<IEmfResourceChange> changeAcceptor) {
if (updaters.isEmpty()) {
return;
}
List<IResourceSnapshot> snapshots = getSnapshots();
Deltas deltas = deltaProvider.getDelta(this, snapshots);
List<ResourceUpdater> updaters = Lists.newArrayList(this.updaters.values());
if (updateRelatedFiles && updateCrossReferences) {
List<RelatedResource> related = relatedResourcesProvider.getRelatedResources(deltas.getSnapshots());
for (RelatedResource ref : related) {
RelatedResourceUpdater updater = createResourceUpdater(ref);
updaters.add(updater);
}
}
monitor.beginTask("Creating Text Changes...", updaters.size());
for (ResourceUpdater updater : updaters) {
updater.applyChange(deltas, changeAcceptor);
monitor.worked(1);
checkCanceled();
}
for (ResourceUpdater updater : updaters) {
updater.unload();
}
}
Aggregations