pavery | b0763c0 | 2005-10-17 15:55:28 +0000 | [diff] [blame] | 1 | package org.eclipse.wst.sse.ui.internal.reconcile.validator; |
| 2 | |
| 3 | import org.eclipse.jface.text.IDocument; |
| 4 | import org.eclipse.jface.text.IRegion; |
| 5 | import org.eclipse.wst.validation.internal.provisional.core.IReporter; |
| 6 | import org.eclipse.wst.validation.internal.provisional.core.IValidationContext; |
| 7 | |
| 8 | /** |
| 9 | * Interface to allow for "partial document" as you type validation. |
| 10 | * |
| 11 | */ |
| 12 | public interface ISourceValidator { |
| 13 | |
| 14 | /** |
| 15 | * As you type validation is getting "hooked up" to this IDocument. |
| 16 | * This is the instance of IDocument that the validator should |
| 17 | * operate on for each validate call. |
| 18 | * |
| 19 | * @param document |
| 20 | */ |
| 21 | void connect(IDocument document); |
| 22 | |
| 23 | /** |
| 24 | * The same IDocument passed in from the connect() method. |
| 25 | * This indicates that as you type validation is "shutting down" |
| 26 | * for this IDocument. |
| 27 | * |
| 28 | * @param document |
| 29 | */ |
| 30 | void disconnect(IDocument document); |
| 31 | |
| 32 | /** |
| 33 | * Like IValidator#validate(IValidationContext helper, IReporter reporter) |
| 34 | * except passes the dirty region, so document validation can be better |
| 35 | * optimized. |
| 36 | * |
| 37 | * @param dirtyRegion |
| 38 | * @param helper |
| 39 | * @param reporter |
| 40 | */ |
| 41 | void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter); |
| 42 | } |