protected IPresentationDamager createRegionDamager() { return new PresentationDamager(); }
public IRegion getDamageRegion(ITypedRegion partition, DocumentEvent e, boolean documentPartitioningChanged) { if (!(e.getDocument() instanceof IXtextDocument)) { return new Region(0, 0); } XtextDocument document = (XtextDocument) e.getDocument(); IRegion lastDamage = document.getLastDamage(); // check whether this is just a presentation invalidation not based on a real document change if (lastDamage == null || !isEventMatchingLastDamage(e, lastDamage)) { IRegion result = computeInterSection(partition, e, document); return result; } if (!TextUtilities.overlaps(partition, lastDamage) && lastDamage.getOffset()<e.getDocument().getLength()) { if (documentPartitioningChanged) return partition; return lastDamage; } int offset = Math.max(lastDamage.getOffset(),partition.getOffset()); int endOffset = Math.min(lastDamage.getOffset()+lastDamage.getLength(),partition.getOffset()+partition.getLength()); IRegion result = new Region(offset,endOffset-offset); return result; }
protected IPresentationDamager createRegionDamager() { return new PresentationDamager(); }