diff options
Diffstat (limited to 'org.eclipse.jface.text/src/org/eclipse/jface/text/presentation/IPresentationDamager.java')
-rw-r--r-- | org.eclipse.jface.text/src/org/eclipse/jface/text/presentation/IPresentationDamager.java | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/presentation/IPresentationDamager.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/presentation/IPresentationDamager.java new file mode 100644 index 00000000000..3f2ba767b02 --- /dev/null +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/presentation/IPresentationDamager.java @@ -0,0 +1,54 @@ +package org.eclipse.jface.text.presentation; + +/* + * (c) Copyright IBM Corp. 2000, 2001. + * All Rights Reserved. + */ + + +import org.eclipse.jface.text.DocumentEvent; +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.IRegion; +import org.eclipse.jface.text.ITypedRegion; + + +/** + * Presentation damagers are used by a presentation reconciler to determine the + * region of the document's presentation which must be rebuilt because of the + * occurrence of a document change. A presentation damager is assumed to be + * specific for a particular document content type. A presentation damager is + * expected to return a damage region which is a valid input for a presentation repairer. + * I.e. having access to the damage region only the repairer must be able to derive + * all the information neede to sucessfully repair this region.<p> + * This interface must either be implemented by clients or clients use the rule-based + * default implementation <code>RuleBasedDamagerRepairer</code>. Implementers should be + * registered with a presentation reconciler in order get involved in the reconciling + * process. + * + * @see IPresentationReconciler + * @see IDocument + * @see DocumentEvent + * @see IPresentationRepairer + */ +public interface IPresentationDamager { + + /** + * Tells the presentation damager on which document it will work. + * + * @param document the damager's working document + */ + void setDocument(IDocument document); + + /** + * Returns the damage in the document's presentation caused by the given document change. + * The damage is restricted to the specified partition for which the presentation damager is + * responsible. The damage may also depend on whether the document change also caused changes + * of the document's partitioning. + * + * @param partition the partition inside which the damage must be determined + * @param event the event describing the change whose damage must be determined + * @param documentPartitioningChange indicates whether the given change changed the document's partitioning + * @return the computed damage + */ + IRegion getDamageRegion(ITypedRegion partition, DocumentEvent event, boolean documentPartitioningChanged); +}
\ No newline at end of file |