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