]> git.uio.no Git - ifi-stolz-refaktor.git/blame - case-study/jdt-after/ui/org/eclipse/jdt/internal/ui/text/JavaPresentationReconciler.java
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-after / ui / org / eclipse / jdt / internal / ui / text / JavaPresentationReconciler.java
CommitLineData
1b2798f6
EK
1/*******************************************************************************
2 * Copyright (c) 2000, 2006 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
12package org.eclipse.jdt.internal.ui.text;
13
14import org.eclipse.jface.text.IDocument;
15import org.eclipse.jface.text.IRegion;
16import org.eclipse.jface.text.TextPresentation;
17import org.eclipse.jface.text.presentation.PresentationReconciler;
18
19
20/**
21 * Presentation reconciler, adding functionality for operation without a viewer.
22 *
23 * @since 3.0
24 */
25public class JavaPresentationReconciler extends PresentationReconciler {
26
27 /** Last used document */
28 private IDocument fLastDocument;
29
30 /**
31 * Constructs a "repair description" for the given damage and returns
32 * this description as a text presentation.
33 * <p>
34 * NOTE: Should not be used if this reconciler is installed on a viewer.
35 * </p>
36 *
37 * @param damage the damage to be repaired
38 * @param document the document whose presentation must be repaired
39 * @return the presentation repair description as text presentation
40 */
41 public TextPresentation createRepairDescription(IRegion damage, IDocument document) {
42 if (document != fLastDocument) {
43 setDocumentToDamagers(document);
44 setDocumentToRepairers(document);
45 fLastDocument= document;
46 }
47 return createPresentation(damage, document);
48 }
49}