Skip to main content
summaryrefslogtreecommitdiffstats
blob: 1e09976ca94433e18c8aa4c388b9aff1fa47fb82 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package org.eclipse.wst.sse.ui.internal.reconcile.validator;

import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;

/**
 * Interface to allow for "partial document" as you type validation.
 *
 */
public interface ISourceValidator {
	
	/**
	 * As you type validation is getting "hooked up" to this IDocument.
	 * This is the instance of IDocument that the validator should
	 * operate on for each validate call.
	 * 
	 * @param document
	 */
	void connect(IDocument document);
	
	/**
	 * The same IDocument passed in from the connect() method.
	 * This indicates that as you type validation is "shutting down"
	 * for this IDocument.
	 * 
	 * @param document
	 */
	void disconnect(IDocument document);
	
	/**
	 * Like IValidator#validate(IValidationContext helper, IReporter reporter)
	 * except passes the dirty region, so document validation can be better
	 * optimized.
	 * 
	 * @param dirtyRegion
	 * @param helper
	 * @param reporter
	 */
	void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter);
}

Back to the top