if ((delta.getFlags() & (IErlElementDelta.F_CONTENT | IErlElementDelta.F_CHILDREN)) == 0) {
return;
}
final IErlElement de = delta.getElement();
if (de instanceof IErlModule && de != fModule) {
return;
}
final ProjectionAnnotationModel model = (ProjectionAnnotationModel) fEditor
.getAdapter(ProjectionAnnotationModel.class);
if (model == null) {
return;
}
final IDocumentProvider provider = fEditor.getDocumentProvider();
try {
fCachedModel = model;
fCachedDocument = provider.getDocument(fEditor.getEditorInput());
if (fCachedDocument.getNumberOfLines() > PerformanceTuning.get()
.getFoldingLimit()) {
// disable folding for files larger than this
model.removeAllAnnotations();
return;
}
final Map<ErlangProjectionAnnotation, Position> additions = new HashMap<ErlangProjectionAnnotation, Position>();
final List<ErlangProjectionAnnotation> deletions = new ArrayList<ErlangProjectionAnnotation>();
final List<ErlangProjectionAnnotation> updates = new ArrayList<ErlangProjectionAnnotation>();
// use a linked map to maintain ordering of comments
final Map<ErlangProjectionAnnotation, Position> updated = new LinkedHashMap<ErlangProjectionAnnotation, Position>();
computeAdditions(fModule, updated);
final Map<Object, List<Tuple>> previous = createAnnotationMap(model);
for (final Entry<ErlangProjectionAnnotation, Position> entry : updated
.entrySet()) {
final ErlangProjectionAnnotation newAnnotation = entry.getKey();
final IErlElement element = newAnnotation.getElement();
final Position newPosition = entry.getValue();
final List<Tuple> annotations = previous.get(element);
if (annotations == null) {