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