org.eclipse.xtext.ui.editor
Class PresentationDamager

java.lang.Object
  extended by org.eclipse.xtext.ui.editor.PresentationDamager
All Implemented Interfaces:
org.eclipse.jface.text.presentation.IPresentationDamager

public class PresentationDamager
extends java.lang.Object
implements org.eclipse.jface.text.presentation.IPresentationDamager

This implementations relies on an XtextDocument, which provides information about the damaged region of the last change.

Author:
Sven Efftinge - Initial contribution and API

Constructor Summary
PresentationDamager()
           
 
Method Summary
protected  org.eclipse.jface.text.IRegion computeInterSection(org.eclipse.jface.text.ITypedRegion partition, org.eclipse.jface.text.DocumentEvent e, XtextDocument document)
           
 org.eclipse.jface.text.IRegion getDamageRegion(org.eclipse.jface.text.ITypedRegion partition, org.eclipse.jface.text.DocumentEvent e, boolean documentPartitioningChanged)
           
protected  boolean isEventMatchingLastDamage(org.eclipse.jface.text.DocumentEvent e, org.eclipse.jface.text.IRegion lastDamage)
           
 void setDocument(org.eclipse.jface.text.IDocument document)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PresentationDamager

public PresentationDamager()
Method Detail

setDocument

public void setDocument(org.eclipse.jface.text.IDocument document)
Specified by:
setDocument in interface org.eclipse.jface.text.presentation.IPresentationDamager

getDamageRegion

public org.eclipse.jface.text.IRegion getDamageRegion(org.eclipse.jface.text.ITypedRegion partition,
                                                      org.eclipse.jface.text.DocumentEvent e,
                                                      boolean documentPartitioningChanged)
Specified by:
getDamageRegion in interface org.eclipse.jface.text.presentation.IPresentationDamager

computeInterSection

protected org.eclipse.jface.text.IRegion computeInterSection(org.eclipse.jface.text.ITypedRegion partition,
                                                             org.eclipse.jface.text.DocumentEvent e,
                                                             XtextDocument document)
Returns:
the common region of the given partition and the changed region in the DocumentEvent based on the underlying tokens.

isEventMatchingLastDamage

protected boolean isEventMatchingLastDamage(org.eclipse.jface.text.DocumentEvent e,
                                            org.eclipse.jface.text.IRegion lastDamage)
Returns:
true only if the lastDamage is encloses the affected text of the given DocumentEvent.