129
|
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 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13 module dwtx.jface.text.reconciler.IReconcilingStrategy;
|
|
14
|
131
|
15 import dwtx.jface.text.reconciler.IReconciler; // packageimport
|
|
16 import dwtx.jface.text.reconciler.DirtyRegionQueue; // packageimport
|
|
17 import dwtx.jface.text.reconciler.AbstractReconcileStep; // packageimport
|
|
18 import dwtx.jface.text.reconciler.IReconcilingStrategyExtension; // packageimport
|
|
19 import dwtx.jface.text.reconciler.MonoReconciler; // packageimport
|
|
20 import dwtx.jface.text.reconciler.IReconcileStep; // packageimport
|
|
21 import dwtx.jface.text.reconciler.AbstractReconciler; // packageimport
|
|
22 import dwtx.jface.text.reconciler.Reconciler; // packageimport
|
|
23 import dwtx.jface.text.reconciler.IReconcilableModel; // packageimport
|
|
24 import dwtx.jface.text.reconciler.DirtyRegion; // packageimport
|
|
25 import dwtx.jface.text.reconciler.IReconcileResult; // packageimport
|
|
26 import dwtx.jface.text.reconciler.IReconcilerExtension; // packageimport
|
|
27
|
|
28
|
129
|
29 import dwt.dwthelper.utils;
|
|
30
|
|
31 import dwtx.jface.text.IDocument;
|
|
32 import dwtx.jface.text.IRegion;
|
|
33
|
|
34
|
|
35 /**
|
|
36 * A reconciling strategy is used by an reconciler to reconcile a model
|
|
37 * based on text of a particular content type. It provides methods for
|
|
38 * incremental as well as non-incremental reconciling.
|
|
39 * <p>
|
|
40 * If a reconcile strategy consists of several steps between which
|
|
41 * model transformation is desired the each step should implement
|
|
42 * {@link dwtx.jface.text.reconciler.IReconcileStep}.
|
|
43 * </p>
|
|
44 * <p>
|
|
45 * In order to provide backward compatibility for clients of <code>IReconcilingStrategy</code>, extension
|
|
46 * interfaces are used to provide a means of evolution. The following extension interfaces exist:
|
|
47 * <ul>
|
|
48 * <li>{@link dwtx.jface.text.reconciler.IReconcilingStrategyExtension} since version 2.0 introducing
|
|
49 * the following functions:
|
|
50 * <ul>
|
|
51 * <li>usage of a progress monitor</li>
|
|
52 * <li>initial reconciling step: if a reconciler runs as periodic activity in the background, this
|
|
53 * methods offers the reconciler a chance for initializing its strategies and achieving a
|
|
54 * reconciled state before the periodic activity starts.</li>
|
|
55 * </ul>
|
|
56 * </li>
|
|
57 * </ul>
|
|
58 * </p>
|
|
59 * <p>
|
|
60 * This interface must be implemented by clients. Implementers should be
|
|
61 * registered with a reconciler in order get involved in the reconciling
|
|
62 * process.
|
|
63 * </p>
|
|
64 */
|
|
65 public interface IReconcilingStrategy {
|
|
66
|
|
67 /**
|
|
68 * Tells this reconciling strategy on which document it will
|
|
69 * work. This method will be called before any other method
|
|
70 * and can be called multiple times. The regions passed to the
|
|
71 * other methods always refer to the most recent document
|
|
72 * passed into this method.
|
|
73 *
|
|
74 * @param document the document on which this strategy will work
|
|
75 */
|
|
76 void setDocument(IDocument document);
|
|
77
|
|
78 /**
|
|
79 * Activates incremental reconciling of the specified dirty region.
|
|
80 * As a dirty region might span multiple content types, the segment of the
|
|
81 * dirty region which should be investigated is also provided to this
|
|
82 * reconciling strategy. The given regions refer to the document passed into
|
|
83 * the most recent call of {@link #setDocument(IDocument)}.
|
|
84 *
|
|
85 * @param dirtyRegion the document region which has been changed
|
|
86 * @param subRegion the sub region in the dirty region which should be reconciled
|
|
87 */
|
|
88 void reconcile(DirtyRegion dirtyRegion, IRegion subRegion);
|
|
89
|
|
90 /**
|
|
91 * Activates non-incremental reconciling. The reconciling strategy is just told
|
|
92 * that there are changes and that it should reconcile the given partition of the
|
|
93 * document most recently passed into {@link #setDocument(IDocument)}.
|
|
94 *
|
|
95 * @param partition the document partition to be reconciled
|
|
96 */
|
|
97 void reconcile(IRegion partition);
|
|
98 }
|