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.presentation.IPresentationRepairer;
|
|
14
|
131
|
15 import dwtx.jface.text.presentation.IPresentationDamager; // packageimport
|
|
16 import dwtx.jface.text.presentation.IPresentationReconciler; // packageimport
|
|
17 import dwtx.jface.text.presentation.PresentationReconciler; // packageimport
|
|
18 import dwtx.jface.text.presentation.IPresentationReconcilerExtension; // packageimport
|
|
19
|
|
20
|
129
|
21 import dwt.dwthelper.utils;
|
|
22
|
|
23
|
|
24
|
|
25 import dwtx.jface.text.IDocument;
|
|
26 import dwtx.jface.text.ITypedRegion;
|
|
27 import dwtx.jface.text.TextPresentation;
|
|
28
|
|
29
|
|
30 /**
|
|
31 * A presentation repairer is a strategy used by a presentation reconciler to
|
|
32 * rebuild a damaged region in a document's presentation. A presentation
|
|
33 * repairer is assumed to be specific for a particular document content type.
|
|
34 * The presentation repairer gets the region which it should repair and
|
|
35 * constructs a "repair description". The presentation repairer merges the steps
|
|
36 * contained within this description into the text presentation passed into
|
|
37 * <code>createPresentation</code>.
|
|
38 * <p>
|
|
39 * This interface may be implemented by clients. Alternatively, clients may use
|
|
40 * the rule-based default implementation
|
|
41 * {@link dwtx.jface.text.rules.DefaultDamagerRepairer}. Implementers
|
|
42 * should be registered with a presentation reconciler in order get involved in
|
|
43 * the reconciling process.
|
|
44 * </p>
|
|
45 *
|
|
46 * @see IPresentationReconciler
|
|
47 * @see IDocument
|
|
48 * @see dwt.custom.StyleRange
|
|
49 * @see TextPresentation
|
|
50 */
|
|
51 public interface IPresentationRepairer {
|
|
52
|
|
53
|
|
54 /**
|
|
55 * Tells the presentation repairer on which document it will work.
|
|
56 *
|
|
57 * @param document the damager's working document
|
|
58 */
|
|
59 void setDocument(IDocument document);
|
|
60
|
|
61 /**
|
|
62 * Fills the given presentation with the style ranges which when applied to the
|
|
63 * presentation reconciler's text viewer repair the presentation damage described by
|
|
64 * the given region.
|
|
65 *
|
|
66 * @param presentation the text presentation to be filled by this repairer
|
|
67 * @param damage the damage to be repaired
|
|
68 */
|
|
69 void createPresentation(TextPresentation presentation, ITypedRegion damage);
|
|
70 }
|