KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > reconciler > IReconcilingStrategy


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jface.text.reconciler;
12
13 import org.eclipse.jface.text.IDocument;
14 import org.eclipse.jface.text.IRegion;
15
16
17 /**
18  * A reconciling strategy is used by an reconciler to reconcile a model
19  * based on text of a particular content type. It provides methods for
20  * incremental as well as non-incremental reconciling.
21  * <p>
22  * If a reconcile strategy consists of several steps between which
23  * model transformation is desired the each step should implement
24  * {@link org.eclipse.jface.text.reconciler.IReconcileStep}.
25  * </p>
26  * <p>
27  * In order to provide backward compatibility for clients of <code>IReconcilingStrategy</code>, extension
28  * interfaces are used to provide a means of evolution. The following extension interfaces exist:
29  * <ul>
30  * <li>{@link org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension} since version 2.0 introducing
31  * the following functions:
32  * <ul>
33  * <li>usage of a progress monitor</li>
34  * <li>initial reconciling step: if a reconciler runs as periodic activity in the background, this
35  * methods offers the reconciler a chance for initializing its strategies and achieving a
36  * reconciled state before the periodic activity starts.</li>
37  * </ul>
38  * </li>
39  * </ul>
40  * </p>
41  * <p>
42  * This interface must be implemented by clients. Implementers should be
43  * registered with a reconciler in order get involved in the reconciling
44  * process.
45  * </p>
46  */

47 public interface IReconcilingStrategy {
48
49     /**
50      * Tells this reconciling strategy on which document it will
51      * work. This method will be called before any other method
52      * and can be called multiple times. The regions passed to the
53      * other methods always refer to the most recent document
54      * passed into this method.
55      *
56      * @param document the document on which this strategy will work
57      */

58     void setDocument(IDocument document);
59
60     /**
61      * Activates incremental reconciling of the specified dirty region.
62      * As a dirty region might span multiple content types, the segment of the
63      * dirty region which should be investigated is also provided to this
64      * reconciling strategy. The given regions refer to the document passed into
65      * the most recent call of {@link #setDocument(IDocument)}.
66      *
67      * @param dirtyRegion the document region which has been changed
68      * @param subRegion the sub region in the dirty region which should be reconciled
69      */

70     void reconcile(DirtyRegion dirtyRegion, IRegion subRegion);
71
72     /**
73      * Activates non-incremental reconciling. The reconciling strategy is just told
74      * that there are changes and that it should reconcile the given partition of the
75      * document most recently passed into {@link #setDocument(IDocument)}.
76      *
77      * @param partition the document partition to be reconciled
78      */

79     void reconcile(IRegion partition);
80 }
81
Popular Tags