129
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2000, 2008 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.IReconciler;
|
|
14
|
131
|
15 import dwtx.jface.text.reconciler.DirtyRegionQueue; // packageimport
|
|
16 import dwtx.jface.text.reconciler.IReconcilingStrategy; // 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.ITextViewer;
|
|
32
|
|
33
|
|
34 /**
|
|
35 * An <code>IReconciler</code> defines and maintains a model of the content
|
|
36 * of the text viewer's document in the presence of changes applied to this
|
|
37 * document. An <code>IReconciler</code> is a {@link dwtx.jface.text.ITextViewer} add-on.
|
|
38 * <p>
|
|
39 * Reconcilers are assumed to be asynchronous, i.e. they allow a certain
|
|
40 * temporal window of inconsistency between the document and the model of
|
|
41 * the content of this document.
|
|
42 * </p>
|
|
43 * <p>
|
|
44 * Reconcilers have a list of {@link dwtx.jface.text.reconciler.IReconcilingStrategy}
|
|
45 * objects each of which is registered for a particular document content type.
|
|
46 * The reconciler uses the strategy objects to react on the changes applied
|
|
47 * to the text viewer's document.
|
|
48 *</p>
|
|
49 * <p>
|
|
50 * In order to provide backward compatibility for clients of <code>IReconciler</code>, extension
|
|
51 * interfaces are used to provide a means of evolution. The following extension interfaces exist:
|
|
52 * <ul>
|
|
53 * <li>{@link dwtx.jface.text.reconciler.IReconcilerExtension} since version 3.0 introducing
|
|
54 * the ability to be aware of documents with multiple partitionings.</li>
|
|
55 * </ul>
|
|
56 * </p>
|
|
57 * <p>
|
|
58 * The interface can be implemented by clients. By default, clients use
|
|
59 * {@link dwtx.jface.text.reconciler.MonoReconciler} or
|
|
60 * {@link dwtx.jface.text.reconciler.Reconciler} as the standard
|
|
61 * implementers of this interface.
|
|
62 * </p>
|
|
63 *
|
|
64 * @see ITextViewer
|
|
65 * @see IReconcilingStrategy
|
|
66 */
|
|
67 public interface IReconciler {
|
|
68
|
|
69 /**
|
|
70 * Installs the reconciler on the given text viewer. After this method has been
|
|
71 * finished, the reconciler is operational, i.e., it works without requesting
|
|
72 * further client actions until <code>uninstall</code> is called.
|
|
73 *
|
|
74 * @param textViewer the viewer on which the reconciler is installed
|
|
75 */
|
|
76 void install(ITextViewer textViewer);
|
|
77
|
|
78 /**
|
|
79 * Removes the reconciler from the text viewer it has
|
|
80 * previously been installed on.
|
|
81 */
|
|
82 void uninstall();
|
|
83
|
|
84 /**
|
|
85 * Returns the reconciling strategy registered with the reconciler
|
|
86 * for the specified content type.
|
|
87 *
|
|
88 * @param contentType the content type for which to determine the reconciling strategy
|
|
89 * @return the reconciling strategy registered for the given content type, or
|
|
90 * <code>null</code> if there is no such strategy
|
|
91 */
|
|
92 IReconcilingStrategy getReconcilingStrategy(String contentType);
|
|
93 }
|