KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > presentation > IPresentationRepairer


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  *******************************************************************************/

11 package org.eclipse.jface.text.presentation;
12
13
14
15 import org.eclipse.jface.text.IDocument;
16 import org.eclipse.jface.text.ITypedRegion;
17 import org.eclipse.jface.text.TextPresentation;
18
19
20 /**
21  * A presentation repairer is a strategy used by a presentation reconciler to
22  * rebuild a damaged region in a document's presentation. A presentation
23  * repairer is assumed to be specific for a particular document content type.
24  * The presentation repairer gets the region which it should repair and
25  * constructs a "repair description". The presentation repairer merges the steps
26  * contained within this description into the text presentation passed into
27  * <code>createPresentation</code>.
28  * <p>
29  * This interface may be implemented by clients. Alternatively, clients may use
30  * the rule-based default implementation
31  * {@link org.eclipse.jface.text.rules.DefaultDamagerRepairer}. Implementers
32  * should be registered with a presentation reconciler in order get involved in
33  * the reconciling process.
34  * </p>
35  *
36  * @see IPresentationReconciler
37  * @see IDocument
38  * @see org.eclipse.swt.custom.StyleRange
39  * @see TextPresentation
40  */

41 public interface IPresentationRepairer {
42
43
44     /**
45      * Tells the presentation repairer on which document it will work.
46      *
47      * @param document the damager's working document
48      */

49     void setDocument(IDocument document);
50
51     /**
52      * Fills the given presentation with the style ranges which when applied to the
53      * presentation reconciler's text viewer repair the presentation damage described by
54      * the given region.
55      *
56      * @param presentation the text presentation to be filled by this repairer
57      * @param damage the damage to be repaired
58      */

59     void createPresentation(TextPresentation presentation, ITypedRegion damage);
60 }
61
Popular Tags